List of usage examples for android.graphics Typeface BOLD
int BOLD
To view the source code for android.graphics Typeface BOLD.
Click Source Link
From source file:info.hl.mediam.CreateGroupActivity.java
@Override protected Dialog onCreateDialog(int id) { switch (id) { case GET_IMAGE_DIALOG: mGetImageDialog = new Dialog(CreateGroupActivity.this, R.style.TransparentDialogTheme); mGetImageDialog.getWindow().setGravity(Gravity.BOTTOM); mGetImageDialog.setContentView(R.layout.dialog_get_image); // Grab the window of the dialog, and change the width WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); Window window = mGetImageDialog.getWindow(); lp.copyFrom(window.getAttributes()); // This makes the dialog take up the full width lp.width = WindowManager.LayoutParams.MATCH_PARENT; lp.height = WindowManager.LayoutParams.WRAP_CONTENT; window.setAttributes(lp);// w w w. j a va 2 s . com final Button btnGallery = (Button) mGetImageDialog.findViewById(R.id.btnGallery); btnGallery.setTypeface(MediamApp.getTfMyriadProBold(), Typeface.BOLD); btnGallery.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent galleryIntent = new Intent(CreateGroupActivity.this, CameraCropActivity.class); galleryIntent.putExtra("type", "gallery"); galleryIntent.putExtra("createGroup", true); CreateGroupActivity.this.startActivity(galleryIntent); mGetImageDialog.dismiss(); } }); final Button btnCamera = (Button) mGetImageDialog.findViewById(R.id.btnCamera); btnCamera.setTypeface(MediamApp.getTfMyriadProBold(), Typeface.BOLD); btnCamera.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent cameraIntent = new Intent(CreateGroupActivity.this, CameraCropActivity.class); cameraIntent.putExtra("type", "camera"); cameraIntent.putExtra("createGroup", true); CreateGroupActivity.this.startActivity(cameraIntent); mGetImageDialog.dismiss(); } }); final Button btnRemovePhoto = (Button) mGetImageDialog.findViewById(R.id.btnRemovePhoto); btnRemovePhoto.setTypeface(MediamApp.getTfMyriadProBold(), Typeface.BOLD); btnRemovePhoto.setOnClickListener(new OnClickListener() { public void onClick(View v) { mGroupAvatarId = ""; gGroupImage = null; Utils.displayImage(mGroupAvatarId, mIvGroupImage, ImageLoader.LARGE, R.drawable.group_stub_large, false); mGetImageDialog.dismiss(); } }); return mGetImageDialog; default: return null; } }
From source file:com.android.contacts.common.list.ContactListItemView.java
public ContactListItemView(Context context, AttributeSet attrs) { super(context, attrs); TypedArray a;//from w w w . j av a 2 s . c o m if (R.styleable.ContactListItemView != null) { // Read all style values a = getContext().obtainStyledAttributes(attrs, R.styleable.ContactListItemView); mPreferredHeight = a.getDimensionPixelSize(R.styleable.ContactListItemView_list_item_height, mPreferredHeight); mActivatedBackgroundDrawable = a.getDrawable(R.styleable.ContactListItemView_activated_background); mGapBetweenImageAndText = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_gap_between_image_and_text, mGapBetweenImageAndText); mGapBetweenLabelAndData = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_gap_between_label_and_data, mGapBetweenLabelAndData); mPresenceIconMargin = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_presence_icon_margin, mPresenceIconMargin); mPresenceIconSize = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_presence_icon_size, mPresenceIconSize); mDefaultPhotoViewSize = a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_photo_size, mDefaultPhotoViewSize); mTextIndent = a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_text_indent, mTextIndent); mTextOffsetTop = a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_text_offset_top, mTextOffsetTop); mDataViewWidthWeight = a.getInteger(R.styleable.ContactListItemView_list_item_data_width_weight, mDataViewWidthWeight); mLabelViewWidthWeight = a.getInteger(R.styleable.ContactListItemView_list_item_label_width_weight, mLabelViewWidthWeight); mNameTextViewTextColor = a.getColor(R.styleable.ContactListItemView_list_item_name_text_color, mNameTextViewTextColor); mNameTextViewTextSize = (int) a.getDimension(R.styleable.ContactListItemView_list_item_name_text_size, (int) getResources().getDimension(R.dimen.contact_browser_list_item_text_size)); mVideoCallIconSize = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_video_call_icon_size, mVideoCallIconSize); mVideoCallIconMargin = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_video_call_icon_margin, mVideoCallIconMargin); setPaddingRelative(a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_padding_left, 0), a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_padding_top, 0), a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_padding_right, 0), a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_padding_bottom, 0)); a.recycle(); } mTextHighlighter = new TextHighlighter(Typeface.BOLD); if (R.styleable.Theme != null) { a = getContext().obtainStyledAttributes(R.styleable.Theme); mSecondaryTextColor = a.getColorStateList(R.styleable.Theme_android_textColorSecondary); a.recycle(); } mHeaderWidth = getResources().getDimensionPixelSize(R.dimen.contact_list_section_header_width); if (mActivatedBackgroundDrawable != null) { mActivatedBackgroundDrawable.setCallback(this); } mNameHighlightSequence = new ArrayList<HighlightSequence>(); mNumberHighlightSequence = new ArrayList<HighlightSequence>(); setLayoutDirection(View.LAYOUT_DIRECTION_LOCALE); }
From source file:systems.soapbox.ombuds.client.ui.WalletTransactionsFragment.java
@Override public void onLoadFinished(final Loader<List<Transaction>> loader, final List<Transaction> transactions) { final Direction direction = ((TransactionsLoader) loader).getDirection(); adapter.replace(transactions);/*www.j a va 2s . c o m*/ if (transactions.isEmpty()) { viewGroup.setDisplayedChild(1); final SpannableStringBuilder emptyText = new SpannableStringBuilder("You have no Bitcoin."); emptyText.setSpan(new StyleSpan(Typeface.BOLD), 0, emptyText.length(), SpannableStringBuilder.SPAN_POINT_MARK); emptyText.append("\n\n").append(getString(R.string.profile_email_for_bitcoin)); emptyView.setText(emptyText); } else { viewGroup.setDisplayedChild(2); } }
From source file:com.mifos.mifosxdroid.online.generatecollectionsheet.GenerateCollectionSheetFragment.java
private void inflateCollectionTable(CollectionSheetResponse collectionSheetResponse) { //Clear old views in case they are present. if (tableProductive.getChildCount() > 0) { tableProductive.removeAllViews(); }//from ww w . j a v a 2 s . com //A List to be used to inflate Attendance Spinners ArrayList<String> attendanceTypes = new ArrayList<>(); attendanceTypeOptions.clear(); attendanceTypeOptions = presenter.filterAttendanceTypes(collectionSheetResponse.getAttendanceTypeOptions(), attendanceTypes); additionalPaymentTypeMap.clear(); additionalPaymentTypeMap = presenter.filterPaymentTypes(collectionSheetResponse.getPaymentTypeOptions(), paymentTypes); //Add the heading Row TableRow headingRow = new TableRow(getContext()); TableRow.LayoutParams headingRowParams = new TableRow.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); headingRowParams.gravity = Gravity.CENTER; headingRowParams.setMargins(0, 0, 0, 10); headingRow.setLayoutParams(headingRowParams); TextView tvGroupName = new TextView(getContext()); tvGroupName.setText(collectionSheetResponse.getGroups().get(0).getGroupName()); tvGroupName.setTypeface(tvGroupName.getTypeface(), Typeface.BOLD); tvGroupName.setGravity(Gravity.CENTER); headingRow.addView(tvGroupName); for (LoanProducts loanProduct : collectionSheetResponse.getLoanProducts()) { TextView tvProduct = new TextView(getContext()); tvProduct.setText(getString(R.string.collection_loan_product, loanProduct.getName())); tvProduct.setTypeface(tvProduct.getTypeface(), Typeface.BOLD); tvProduct.setGravity(Gravity.CENTER); headingRow.addView(tvProduct); } for (SavingsProduct savingsProduct : collectionSheetResponse.getSavingsProducts()) { TextView tvSavingProduct = new TextView(getContext()); tvSavingProduct.setText(getString(R.string.collection_saving_product, savingsProduct.getName())); tvSavingProduct.setTypeface(tvSavingProduct.getTypeface(), Typeface.BOLD); tvSavingProduct.setGravity(Gravity.CENTER); headingRow.addView(tvSavingProduct); } TextView tvAttendance = new TextView(getContext()); tvAttendance.setText(getString(R.string.attendance)); tvAttendance.setGravity(Gravity.CENTER); tvAttendance.setTypeface(tvAttendance.getTypeface(), Typeface.BOLD); headingRow.addView(tvAttendance); tableProductive.addView(headingRow); for (ClientCollectionSheet clientCollectionSheet : collectionSheetResponse.getGroups().get(0) .getClients()) { //Insert rows TableRow row = new TableRow(getContext()); TableRow.LayoutParams rowParams = new TableRow.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); rowParams.gravity = Gravity.CENTER; rowParams.setMargins(0, 0, 0, 10); row.setLayoutParams(rowParams); //Column 1: Client Name and Id TextView tvClientName = new TextView(getContext()); tvClientName.setText( concatIdWithName(clientCollectionSheet.getClientName(), clientCollectionSheet.getClientId())); row.addView(tvClientName); //Subsequent columns: The Loan products for (LoanProducts loanProduct : collectionSheetResponse.getLoanProducts()) { //Since there may be several items in this column, create a container. LinearLayout productContainer = new LinearLayout(getContext()); productContainer.setOrientation(LinearLayout.HORIZONTAL); //Iterate through all the loans in of this type and add in the container for (LoanCollectionSheet loan : clientCollectionSheet.getLoans()) { if (loanProduct.getName().equals(loan.getProductShortName())) { //This loan should be shown in this column. So, add it in the container. EditText editText = new EditText(getContext()); editText.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL); editText.setText(String.format(Locale.getDefault(), "%f", 0.0)); //Set the loan id as the Tag of the EditText // in format 'TYPE:ID' which //will later be used as the identifier for this. editText.setTag(TYPE_LOAN + ":" + loan.getLoanId()); productContainer.addView(editText); } } row.addView(productContainer); } //After Loans, show Savings columns for (SavingsProduct product : collectionSheetResponse.getSavingsProducts()) { //Since there may be several Savings items in this column, create a container. LinearLayout productContainer = new LinearLayout(getContext()); productContainer.setOrientation(LinearLayout.HORIZONTAL); //Iterate through all the Savings in of this type and add in the container for (SavingsCollectionSheet saving : clientCollectionSheet.getSavings()) { if (saving.getProductId() == product.getId()) { //Add the saving in the container EditText editText = new EditText(getContext()); editText.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL); editText.setText(String.format(Locale.getDefault(), "%f", 0.0)); //Set the Saving id as the Tag of the EditText // in 'TYPE:ID' format which //will later be used as the identifier for this. editText.setTag(TYPE_SAVING + ":" + saving.getSavingsId()); productContainer.addView(editText); } } row.addView(productContainer); } Spinner spAttendance = new Spinner(getContext()); //Set the clientId as its tag which will be used as identifier later. spAttendance.setTag(clientCollectionSheet.getClientId()); setSpinner(spAttendance, attendanceTypes); row.addView(spAttendance); tableProductive.addView(row); } if (btnSubmitProductive.getVisibility() != View.VISIBLE) { //Show the button the first time sheet is loaded. btnSubmitProductive.setVisibility(View.VISIBLE); btnSubmitProductive.setOnClickListener(this); } //If this block has been executed, that means the CollectionSheet //which is already shown is for groups. btnSubmitProductive.setTag(TAG_TYPE_COLLECTION); if (tableAdditional.getVisibility() != View.VISIBLE) { tableAdditional.setVisibility(View.VISIBLE); } //Show Additional Views TableRow rowPayment = new TableRow(getContext()); TextView tvLabelPayment = new TextView(getContext()); tvLabelPayment.setText(getString(R.string.payment_type)); rowPayment.addView(tvLabelPayment); Spinner spPayment = new Spinner(getContext()); setSpinner(spPayment, paymentTypes); rowPayment.addView(spPayment); tableAdditional.addView(rowPayment); TableRow rowAccount = new TableRow(getContext()); TextView tvLabelAccount = new TextView(getContext()); tvLabelAccount.setText(getString(R.string.account_number)); rowAccount.addView(tvLabelAccount); EditText etPayment = new EditText(getContext()); rowAccount.addView(etPayment); tableAdditional.addView(rowAccount); TableRow rowCheck = new TableRow(getContext()); TextView tvLabelCheck = new TextView(getContext()); tvLabelCheck.setText(getString(R.string.cheque_number)); rowCheck.addView(tvLabelCheck); EditText etCheck = new EditText(getContext()); rowCheck.addView(etCheck); tableAdditional.addView(rowCheck); TableRow rowRouting = new TableRow(getContext()); TextView tvLabelRouting = new TextView(getContext()); tvLabelRouting.setText(getString(R.string.routing_code)); rowRouting.addView(tvLabelRouting); EditText etRouting = new EditText(getContext()); rowRouting.addView(etRouting); tableAdditional.addView(rowRouting); TableRow rowReceipt = new TableRow(getContext()); TextView tvLabelReceipt = new TextView(getContext()); tvLabelReceipt.setText(getString(R.string.receipt_number)); rowReceipt.addView(tvLabelReceipt); EditText etReceipt = new EditText(getContext()); rowReceipt.addView(etReceipt); tableAdditional.addView(rowReceipt); TableRow rowBank = new TableRow(getContext()); TextView tvLabelBank = new TextView(getContext()); tvLabelBank.setText(getString(R.string.bank_number)); rowBank.addView(tvLabelBank); EditText etBank = new EditText(getContext()); rowBank.addView(etBank); tableAdditional.addView(rowBank); }
From source file:com.taobao.weex.dom.WXStyle.java
public static int getFontWeight(Map<String, Object> style) { int typeface = android.graphics.Typeface.NORMAL; if (style != null) { Object temp = style.get(Constants.Name.FONT_WEIGHT); if (temp != null) { String fontWeight = temp.toString(); switch (fontWeight) { case "600": case "700": case "800": case "900": case Constants.Value.BOLD: typeface = Typeface.BOLD; break; }// w w w. j a v a 2 s.co m } } return typeface; }
From source file:com.saulcintero.moveon.fragments.Summary3.java
private XYMultipleSeriesRenderer getRenderer_type1() { XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer(2); XYSeriesRenderer r = new XYSeriesRenderer(); r.setLineWidth(2f);/*from w ww . j av a2 s .c o m*/ r.setColor(Color.rgb(0, 0, 188)); r.setFillBelowLine(true); r.setFillPoints(true); renderer.addSeriesRenderer(r); TypedValue outValue1 = new TypedValue(); TypedValue outValue2 = new TypedValue(); TypedValue outValue3 = new TypedValue(); TypedValue outValue4 = new TypedValue(); mContext.getResources().getValue(R.dimen.xy_chart_text_size_value, outValue1, true); mContext.getResources().getValue(R.dimen.xy_labels_text_size_value, outValue2, true); mContext.getResources().getValue(R.dimen.xy_axis_title_text_size_value, outValue3, true); mContext.getResources().getValue(R.dimen.xy_legend_text_size_value, outValue4, true); float xyChartTextSizeValue = outValue1.getFloat(); float xyLabelsTextSizeValue = outValue1.getFloat(); float xyAxisTitleTextSizeValue = outValue1.getFloat(); float xyLegendTextSizeValue = outValue1.getFloat(); r = new XYSeriesRenderer(); r.setColor(Color.rgb(255, 124, 0)); r.setFillPoints(true); r.setLineWidth(2.5f); r.setDisplayChartValues(false); r.setChartValuesTextSize(xyChartTextSizeValue); renderer.addSeriesRenderer(r); renderer.setAxesColor(Color.WHITE); renderer.setLabelsColor(Color.LTGRAY); renderer.setBackgroundColor(Color.TRANSPARENT); renderer.setTextTypeface("sans_serif", Typeface.BOLD); renderer.setLabelsTextSize(xyLabelsTextSizeValue); renderer.setAxisTitleTextSize(xyAxisTitleTextSizeValue); renderer.setLegendTextSize(xyLegendTextSizeValue); renderer.setXTitle(FunctionUtils.capitalizeFirtsLetter(getString(R.string.minutes))); renderer.setYTitle( isMetric ? getString(R.string.long_unit1_detail_7) : getString(R.string.long_unit2_detail_7)); renderer.setYTitle(FunctionUtils.capitalizeFirtsLetter( isMetric ? getString(R.string.long_unit1_detail_10) : getString(R.string.long_unit2_detail_10)), 1); renderer.setYAxisAlign(Align.RIGHT, 1); renderer.setYLabelsAlign(Align.RIGHT, 1); renderer.setYAxisMin(min_altitude, 1); renderer.setYAxisMax(max_altitude); renderer.setXLabels(20); renderer.setYLabels(20); renderer.setYLabelsAlign(Align.LEFT); renderer.setShowGrid(false); float smallest = 0; if (0 > min_altitude) smallest = min_altitude; float highest = max_speed; if (max_speed < max_altitude) highest = max_altitude; renderer.setXAxisMin(0); renderer.setXAxisMax((float) ((float) timeList.get(timeList.size() - 1) / 60)); renderer.setYAxisMin(smallest); renderer.setYAxisMax(highest); return renderer; }
From source file:org.dalol.orthodoxmezmurmedia.utilities.widgets.AmharicKeyboardView.java
private void handleModifiers(List<String> typographyList) { modifiersContainer.removeAllViews(); for (int i = 0; i < typographyList.size(); i++) { String typography = typographyList.get(i); TextView modifierKey = new TextView(getContext()); modifierKey.setText(typography); modifierKey.setTextColor(Color.WHITE); modifierKey.setIncludeFontPadding(false); modifierKey.setTypeface(mCharTypeface, Typeface.BOLD); modifierKey.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); modifierKey.setBackgroundDrawable( ContextCompat.getDrawable(getContext(), R.drawable.keyboard_modifierkey_bg)); modifierKey.setTextSize(18f);// w w w . j a v a 2 s. c om modifierKey.setGravity(Gravity.CENTER); modifierKey.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (mEditText == null) { return; } TextView textView = (TextView) v; if (!mEditText.isFocused()) mEditText.requestFocus(); Editable editableText = mEditText.getText(); int start = mEditText.getSelectionStart(); if (start == 0) return; CharSequence textViewText = textView.getText(); if (mEnableModifierFlag) { mEnableModifierFlag = false; editableText.replace(start - 1, start, textViewText); } else { editableText.insert(start, textViewText); } } }); LayoutParams params = new LayoutParams(0, LayoutParams.MATCH_PARENT, 1); int margin = getCustomSize(1.5f); params.setMargins(margin, margin, margin, margin); modifiersContainer.addView(modifierKey, params); } }
From source file:com.android.contacts.list.ContactListItemView.java
public ContactListItemView(Context context, AttributeSet attrs) { super(context, attrs); TypedArray a;/*from w w w. j a v a2 s . c o m*/ if (R.styleable.ContactListItemView != null) { // Read all style values a = getContext().obtainStyledAttributes(attrs, R.styleable.ContactListItemView); mPreferredHeight = a.getDimensionPixelSize(R.styleable.ContactListItemView_list_item_height, mPreferredHeight); mActivatedBackgroundDrawable = a.getDrawable(R.styleable.ContactListItemView_activated_background); mGapBetweenImageAndText = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_gap_between_image_and_text, mGapBetweenImageAndText); mGapBetweenIndexerAndImage = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_gap_between_indexer_and_image, mGapBetweenIndexerAndImage); mGapBetweenLabelAndData = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_gap_between_label_and_data, mGapBetweenLabelAndData); mPresenceIconMargin = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_presence_icon_margin, mPresenceIconMargin); mPresenceIconSize = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_presence_icon_size, mPresenceIconSize); mDefaultPhotoViewSize = a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_photo_size, mDefaultPhotoViewSize); mTextIndent = a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_text_indent, mTextIndent); mTextOffsetTop = a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_text_offset_top, mTextOffsetTop); mAvatarOffsetTop = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_avatar_offset_top, mAvatarOffsetTop); mDataViewWidthWeight = a.getInteger(R.styleable.ContactListItemView_list_item_data_width_weight, mDataViewWidthWeight); mLabelViewWidthWeight = a.getInteger(R.styleable.ContactListItemView_list_item_label_width_weight, mLabelViewWidthWeight); mNameTextViewTextColor = a.getColor(R.styleable.ContactListItemView_list_item_name_text_color, mNameTextViewTextColor); mNameTextViewTextSize = (int) a.getDimension(R.styleable.ContactListItemView_list_item_name_text_size, (int) getResources().getDimension(R.dimen.contact_browser_list_item_text_size)); mVideoCallIconSize = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_video_call_icon_size, mVideoCallIconSize); mVideoCallIconMargin = a.getDimensionPixelOffset( R.styleable.ContactListItemView_list_item_video_call_icon_margin, mVideoCallIconMargin); setPaddingRelative(a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_padding_left, 0), a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_padding_top, 0), a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_padding_right, 0), a.getDimensionPixelOffset(R.styleable.ContactListItemView_list_item_padding_bottom, 0)); a.recycle(); } mTextHighlighter = new TextHighlighter(Typeface.BOLD); if (R.styleable.Theme != null) { a = getContext().obtainStyledAttributes(R.styleable.Theme); mSecondaryTextColor = a.getColorStateList(R.styleable.Theme_android_textColorSecondary); a.recycle(); } mHeaderWidth = getResources().getDimensionPixelSize(R.dimen.contact_list_section_header_width); if (mActivatedBackgroundDrawable != null) { mActivatedBackgroundDrawable.setCallback(this); } mNameHighlightSequence = new ArrayList<HighlightSequence>(); mNumberHighlightSequence = new ArrayList<HighlightSequence>(); setLayoutDirection(View.LAYOUT_DIRECTION_LOCALE); }
From source file:com.plusapp.pocketbiceps.app.MainActivity.java
private void initializeCountDrawer() { // Gravity property aligns the text momentsCounter.setGravity(Gravity.CENTER_VERTICAL); momentsCounter.setTypeface(null, Typeface.BOLD); if (isDarkTheme) { momentsCounter.setTextColor(getResources().getColor(R.color.colorCardViewBlue)); } else {//from w ww. j a v a2 s . co m momentsCounter.setTextColor(getResources().getColor(R.color.colorAccent)); } momentsCounter.setText(String.valueOf(momentsCount)); }
From source file:com.mobicage.rogerthat.plugins.friends.ServiceSearchActivity.java
private TextView setCatorySelected(LinearLayout label, final boolean selected) { final View labelIndicatorView = label.findViewById(R.id.indicator); final TextView labelTextView = (TextView) label.findViewById(R.id.category); if (selected) { labelIndicatorView.setVisibility(View.VISIBLE); labelTextView.setTypeface(Typeface.create(labelTextView.getTypeface(), Typeface.BOLD)); labelTextView.setTextColor(getResources().getColor(R.color.mc_blue2)); } else {/* w ww.jav a 2 s .com*/ labelIndicatorView.setVisibility(View.INVISIBLE); labelTextView.setTypeface(Typeface.create(labelTextView.getTypeface(), Typeface.NORMAL)); labelTextView.setTextColor(getResources().getColor(android.R.color.secondary_text_light)); } return labelTextView; }