Example usage for android.graphics Typeface BOLD

List of usage examples for android.graphics Typeface BOLD

Introduction

In this page you can find the example usage for android.graphics Typeface BOLD.

Prototype

int BOLD

To view the source code for android.graphics Typeface BOLD.

Click Source Link

Usage

From source file:im.vector.adapters.GroupViewHolder.java

/**
 * Refresh the holder layout/*from  w w w  . j a v  a  2 s.  com*/
 *
 * @param context                 the context
 * @param group                   the group
 * @param isInvitation            true if it is an invitation
 * @param moreGroupActionListener the more actions listener
 */
public void populateViews(final Context context, final MXSession session, final Group group,
        final AbsAdapter.GroupInvitationListener invitationListener, final boolean isInvitation,
        final AbsAdapter.MoreGroupActionListener moreGroupActionListener) {
    // sanity check
    if (null == group) {
        Log.e(LOG_TAG, "## populateViews() : null group");
        return;
    }

    if (isInvitation) {
        vGroupMembersCount.setText("!");
        vGroupMembersCount.setTypeface(null, Typeface.BOLD);
        GradientDrawable shape = new GradientDrawable();
        shape.setShape(GradientDrawable.RECTANGLE);
        shape.setCornerRadius(100);
        shape.setColor(ContextCompat.getColor(context, R.color.vector_fuchsia_color));
        vGroupMembersCount.setBackground(shape);
        vGroupMembersCount.setVisibility(View.VISIBLE);
    } else {
        vGroupMembersCount.setVisibility(View.GONE);
    }

    vGroupName.setText(group.getDisplayName());
    vGroupName.setTypeface(null, Typeface.NORMAL);

    VectorUtils.loadGroupAvatar(context, session, vGroupAvatar, group);

    vGroupTopic.setText(group.getShortDescription());

    if (vGroupMoreActionClickArea != null && vGroupMoreActionAnchor != null) {
        vGroupMoreActionClickArea.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (null != moreGroupActionListener) {
                    moreGroupActionListener.onMoreActionClick(vGroupMoreActionAnchor, group);
                }
            }
        });
    }
}

From source file:com.money.manager.ex.reports.PayeeReportFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    setListAdapter(null);/*www .  j a v  a  2s.  co m*/
    setSearchMenuVisible(true);

    //create header view
    mHeaderListView = (LinearLayout) addListViewHeaderFooter(R.layout.item_generic_report_2_columns);
    TextView txtColumn1 = (TextView) mHeaderListView.findViewById(R.id.textViewColumn1);
    TextView txtColumn2 = (TextView) mHeaderListView.findViewById(R.id.textViewColumn2);
    //set header
    txtColumn1.setText(R.string.payee);
    txtColumn1.setTypeface(null, Typeface.BOLD);
    txtColumn2.setText(R.string.amount);
    txtColumn2.setTypeface(null, Typeface.BOLD);
    //add to list view
    getListView().addHeaderView(mHeaderListView);

    //create footer view
    mFooterListView = (LinearLayout) addListViewHeaderFooter(R.layout.item_generic_report_2_columns);
    txtColumn1 = (TextView) mFooterListView.findViewById(R.id.textViewColumn1);
    txtColumn2 = (TextView) mFooterListView.findViewById(R.id.textViewColumn2);
    //set footer
    txtColumn1.setText(R.string.total);
    txtColumn1.setTypeface(null, Typeface.BOLD_ITALIC);
    txtColumn2.setText(R.string.total);
    txtColumn2.setTypeface(null, Typeface.BOLD_ITALIC);
    //add to list view
    //getListView().addFooterView(mFooterListView);

    //set adapter
    PayeeReportAdapter adapter = new PayeeReportAdapter(getActivity(), null);
    setListAdapter(adapter);

    super.onActivityCreated(savedInstanceState);
}

From source file:com.rachelgrau.rachel.health4theworldstroke.Activities.InfoActivity.java

public void addHeaderWithText(String text) {
    LinearLayout ll = (LinearLayout) findViewById(R.id.text_linear_layout);
    TextView textView = new TextView(this);
    textView.setTypeface(null, Typeface.BOLD);
    textView.setText(text);//  w w  w.  j a  v  a2  s. c om
    textView.setPadding(40, 40, 40, 10);
    textView.setTextSize(20);
    textView.setBackgroundColor(Color.WHITE);
    ll.addView(textView);
}

From source file:fyp.hkust.facet.activity.SettingsActivity.java

private void convertPreferenceToUseCustomFont(Preference somePreference) {
    Typeface fontType = FontManager.getTypeface(getApplicationContext(), FontManager.APP_FONT);

    CustomTypeFaceSpan customTypefaceSpan = new CustomTypeFaceSpan("", fontType);

    SpannableStringBuilder ss;/*from  w  ww.j av  a 2  s.  c  o  m*/
    if (somePreference.getTitle() != null) {
        ss = new SpannableStringBuilder(somePreference.getTitle().toString());
        ss.setSpan(new StyleSpan(Typeface.BOLD), 0, ss.length(), 0);
        ss.setSpan(customTypefaceSpan, 0, ss.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
        somePreference.setTitle(ss);
    }

    if (somePreference.getSummary() != null) {
        ss = new SpannableStringBuilder(somePreference.getSummary().toString());
        ss.setSpan(customTypefaceSpan, 0, ss.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
        somePreference.setSummary(ss);
    }
}

From source file:com.allmycode.flags.other.MyActivityOther.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);//from   w  w w .  ja v a 2  s  .com
    targetActivity = (EditText) findViewById(R.id.editText1);
    flags = (EditText) findViewById(R.id.editText2);
    cheatSheet = (EditText) findViewById(R.id.editText3);
    for (String item : flagsList) {
        cheatSheet.append(item);
        cheatSheet.append("\n");
    }
    Intent whoCalled = getIntent();
    helloView = ((TextView) findViewById(R.id.textView3));
    helloView.setTextColor(android.graphics.Color.WHITE);
    helloView.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
    helloView.setText("Flags: 0x" + Integer.toHexString(whoCalled.getFlags()));
    if (whoCalled.getExtras() != null) {
        boolean areErrors = whoCalled.getExtras().getBoolean("existErrors", false);
        if (areErrors) {
            helloView.append(" There were errors!");
            helloView.setTextColor(android.graphics.Color.RED);
            helloView.setTypeface(Typeface.DEFAULT, Typeface.BOLD);
        }
    }
    ActivityManager am = (ActivityManager) getSystemService(Service.ACTIVITY_SERVICE);
    List<ActivityManager.RunningAppProcessInfo> processes;
    processes = am.getRunningAppProcesses();
    for (ActivityManager.RunningAppProcessInfo info : processes) {
        Log.i("Process:", info.processName);
    }
}

From source file:com.messagesight.mqtthelper.PayloadAdapter.java

@Override
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
    String headerTitle = (String) getGroup(groupPosition);
    if (convertView == null) {
        LayoutInflater inflater = (LayoutInflater) this.ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        convertView = inflater.inflate(R.layout.list_group, null);
    }//from  ww  w .  j  a v  a2 s  .c om

    TextView lblListHeader = (TextView) convertView.findViewById(R.id.lblListHeader);
    lblListHeader.setTypeface(null, Typeface.BOLD);
    String[] tempTitle = headerTitle.split(":");
    headerTitle = tempTitle[0];
    lblListHeader.setText(headerTitle);
    return convertView;
}

From source file:com.money.manager.ex.reports.CategoriesReportFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    setListAdapter(null);/*  w  w w  . java 2  s  .  com*/
    setSearchMenuVisible(true);

    //create header view
    LinearLayout mListViewHeader = (LinearLayout) addListViewHeaderFooter(
            R.layout.item_generic_report_2_columns);
    TextView txtColumn1 = (TextView) mListViewHeader.findViewById(R.id.textViewColumn1);
    TextView txtColumn2 = (TextView) mListViewHeader.findViewById(R.id.textViewColumn2);
    //set header
    txtColumn1.setText(R.string.category);
    txtColumn1.setTypeface(null, Typeface.BOLD);
    txtColumn2.setText(R.string.amount);
    txtColumn2.setTypeface(null, Typeface.BOLD);
    //add to list view
    getListView().addHeaderView(mListViewHeader);

    //create footer view
    mListViewFooter = (LinearLayout) addListViewHeaderFooter(R.layout.item_generic_report_2_columns);
    txtColumn1 = (TextView) mListViewFooter.findViewById(R.id.textViewColumn1);
    txtColumn2 = (TextView) mListViewFooter.findViewById(R.id.textViewColumn2);
    //set footer
    txtColumn1.setText(R.string.total);
    txtColumn1.setTypeface(null, Typeface.BOLD_ITALIC);
    txtColumn2.setText(R.string.total);
    txtColumn2.setTypeface(null, Typeface.BOLD_ITALIC);

    //add to list view --> move to load finished
    //getListView().addFooterView(mListViewFooter);

    //set adapter
    CategoriesReportAdapter adapter = new CategoriesReportAdapter(getActivity(), null);
    setListAdapter(adapter);
    //call super method
    super.onActivityCreated(savedInstanceState);
}

From source file:com.sachinshinde.theweatherapp.utils.LUtils.java

public void setMediumTypeface(TextView textView) {
    if (hasL()) {
        if (sMediumTypeface == null) {
            sMediumTypeface = Typeface.create("sans-serif-medium", Typeface.NORMAL);
        }//from   w  ww .  j a  va2  s .  co  m

        textView.setTypeface(sMediumTypeface);
    } else {
        textView.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD);
    }
}

From source file:org.egov.android.view.activity.StatusSummaryActivity.java

/**
 * To set the layout for the StatusSummaryActivity ,call complaint status api
 *//*from w  ww . j  a v a 2 s  .  co m*/
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_status_summary);

    heading = (TextView) findViewById(R.id.status_heading);
    heading.setTypeface(heading.getTypeface(), Typeface.BOLD);

    register = (TextView) findViewById(R.id.register_info);
    forwarded = (TextView) findViewById(R.id.forworded_info);
    closed = (TextView) findViewById(R.id.closed_info);

    String id = getIntent().getExtras().getString("complaintId");
    complaintTypeName = getIntent().getExtras().getString("complaintTypeName");
    complaintStatus = getIntent().getExtras().getString("status");
    complaintDate = getIntent().getExtras().getString("created_date");
    lastModifiedDate = getIntent().getExtras().getString("lastModifiedDate");

    heading.setText(complaintTypeName);

    ApiController.getInstance().getComplaintStatus(this, id);
}

From source file:Main.java

private static Typeface getTextTypeface(final CharSequence text) {
    if (!(text instanceof SpannableString)) {
        return Typeface.DEFAULT;
    }//  w  w  w . j  ava2 s  .  c  om

    final SpannableString ss = (SpannableString) text;
    final StyleSpan[] styles = ss.getSpans(0, text.length(), StyleSpan.class);
    if (styles.length == 0) {
        return Typeface.DEFAULT;
    }

    if (styles[0].getStyle() == Typeface.BOLD) {
        return Typeface.DEFAULT_BOLD;
    }
    // TODO: BOLD_ITALIC, ITALIC case?
    return Typeface.DEFAULT;
}