List of usage examples for android.graphics Typeface DEFAULT
Typeface DEFAULT
To view the source code for android.graphics Typeface DEFAULT.
Click Source Link
From source file:jp.ksksue.app.terminal.AndroidUSBSerialMonitorLite.java
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_WORD_LIST_ACTIVITY) { if (resultCode == RESULT_OK) { try { String strWord = data.getStringExtra("word"); etWrite.setText(strWord); // Set a cursor position last etWrite.setSelection(etWrite.getText().length()); } catch (Exception e) { Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show(); }/* w ww .ja v a 2 s. c o m*/ } } else if (requestCode == REQUEST_PREFERENCE) { SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this); String res = pref.getString("display_list", Integer.toString(DISP_CHAR)); mDisplayType = Integer.valueOf(res); res = pref.getString("fontsize_list", Integer.toString(12)); mTextFontSize = Integer.valueOf(res); mTvSerial.setTextSize(mTextFontSize); res = pref.getString("typeface_list", Integer.toString(3)); switch (Integer.valueOf(res)) { case 0: mTextTypeface = Typeface.DEFAULT; break; case 1: mTextTypeface = Typeface.SANS_SERIF; break; case 2: mTextTypeface = Typeface.SERIF; break; case 3: mTextTypeface = Typeface.MONOSPACE; break; } mTvSerial.setTypeface(mTextTypeface); etWrite.setTypeface(mTextTypeface); res = pref.getString("readlinefeedcode_list", Integer.toString(LINEFEED_CODE_CRLF)); mReadLinefeedCode = Integer.valueOf(res); res = pref.getString("writelinefeedcode_list", Integer.toString(LINEFEED_CODE_CRLF)); mWriteLinefeedCode = Integer.valueOf(res); res = pref.getString("email_edittext", "@gmail.com"); mEmailAddress = res; int intRes; res = pref.getString("baudrate_list", Integer.toString(9600)); intRes = Integer.valueOf(res); if (mBaudrate != intRes) { mBaudrate = intRes; mSerial.setBaudrate(mBaudrate); } res = pref.getString("databits_list", Integer.toString(UartConfig.DATA_BITS8)); intRes = Integer.valueOf(res); if (mDataBits != intRes) { mDataBits = Integer.valueOf(res); mSerial.setDataBits(mDataBits); } res = pref.getString("parity_list", Integer.toString(UartConfig.PARITY_NONE)); intRes = Integer.valueOf(res); if (mParity != intRes) { mParity = intRes; mSerial.setParity(mParity); } res = pref.getString("stopbits_list", Integer.toString(UartConfig.STOP_BITS1)); intRes = Integer.valueOf(res); if (mStopBits != intRes) { mStopBits = intRes; mSerial.setStopBits(mStopBits); } res = pref.getString("flowcontrol_list", Integer.toString(UartConfig.FLOW_CONTROL_OFF)); intRes = Integer.valueOf(res); if (mFlowControl != intRes) { mFlowControl = intRes; if (mFlowControl == UartConfig.FLOW_CONTROL_ON) { mSerial.setDtrRts(true, true); } else { mSerial.setDtrRts(false, false); } } /* res = pref.getString("break_list", Integer.toString(FTDriver.FTDI_SET_NOBREAK)); intRes = Integer.valueOf(res) << 14; if (mBreak != intRes) { mBreak = intRes; mSerial.setSerialPropertyBreak(mBreak, FTDriver.CH_A); mSerial.setSerialPropertyToChip(FTDriver.CH_A); } */ res = pref.getString("play_interval", "3"); intRes = Integer.valueOf(res); mPlayIntervalSeconds = intRes; } }
From source file:org.uguess.android.sysinfo.NetStateManager.java
void setFont(TextView txt, int type) { if (txt.getTypeface() == null || txt.getTypeface().getStyle() != type) { txt.setTypeface(Typeface.DEFAULT, type); } }
From source file:com.jjoe64.graphview_demos.fragments.Home.java
void loadDefaultSettingValues() { SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(getActivity()); String res = pref.getString("display_list", Integer.toString(DISP_CHAR)); mDisplayType = Integer.valueOf(res); res = pref.getString("fontsize_list", Integer.toString(12)); mTextFontSize = Integer.valueOf(res); res = pref.getString("typeface_list", Integer.toString(3)); switch (Integer.valueOf(res)) { case 0:// w w w .j a va 2 s .co m mTextTypeface = Typeface.DEFAULT; break; case 1: mTextTypeface = Typeface.SANS_SERIF; break; case 2: mTextTypeface = Typeface.SERIF; break; case 3: mTextTypeface = Typeface.MONOSPACE; break; } mTvSerial.setTypeface(mTextTypeface); //etWrite.setTypeface(mTextTypeface); res = pref.getString("readlinefeedcode_list", Integer.toString(LINEFEED_CODE_CRLF)); mReadLinefeedCode = Integer.valueOf(res); res = pref.getString("writelinefeedcode_list", Integer.toString(LINEFEED_CODE_CRLF)); mWriteLinefeedCode = Integer.valueOf(res); res = pref.getString("email_edittext", "@gmail.com"); mEmailAddress = res; res = pref.getString("baudrate_list", Integer.toString(57600)); mBaudrate = Integer.valueOf(res); res = pref.getString("databits_list", Integer.toString(UartConfig.DATA_BITS8)); mDataBits = Integer.valueOf(res); res = pref.getString("parity_list", Integer.toString(UartConfig.PARITY_NONE)); mParity = Integer.valueOf(res); res = pref.getString("stopbits_list", Integer.toString(UartConfig.STOP_BITS1)); mStopBits = Integer.valueOf(res); res = pref.getString("flowcontrol_list", Integer.toString(UartConfig.FLOW_CONTROL_OFF)); mFlowControl = Integer.valueOf(res); }
From source file:com.photon.phresco.nativeapp.eshop.activity.ProductDetailActivity.java
/** * Create the details sections at the bottom of the screen dynamically * * @param details// w w w .ja v a2 s. co m * @throws NumberFormatException */ private void renderProdcutDetails(Map<String, String> details) { try { LinearLayout tl = (LinearLayout) findViewById(R.id.product_details_layout); int totalDetails = details.size(); int cnt = 1; PhrescoLogger.info(TAG + "renderProdcutDetails() - totalDetails : " + totalDetails); TextView lblDetailLabel = null; for (Entry<String, String> entry : details.entrySet()) { // Create a TextView to hold the label for product detail lblDetailLabel = new TextView(this); if (cnt == 1) { lblDetailLabel.setBackgroundResource(R.drawable.view_cart_item_top); } else if (cnt == totalDetails) { lblDetailLabel.setBackgroundResource(R.drawable.view_cart_item_bottom); } else { lblDetailLabel.setBackgroundResource(R.drawable.view_cart_item_middle); } lblDetailLabel.setText(entry.getKey() + ": " + entry.getValue()); lblDetailLabel.setGravity(Gravity.CENTER); lblDetailLabel.setTypeface(Typeface.DEFAULT, style.TextViewStyle); lblDetailLabel.setTextColor(Color.WHITE); lblDetailLabel.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f)); tl.addView(lblDetailLabel); cnt++; } } catch (Exception ex) { PhrescoLogger.info(TAG + "renderProdcutDetails - Exception : " + ex.toString()); PhrescoLogger.warning(ex); } }
From source file:devlight.io.library.ArcProgressStackView.java
public void setTypeface(final String typeface) { Typeface tempTypeface;/*from w w w .jav a 2s .com*/ try { if (isInEditMode()) return; tempTypeface = Typeface.createFromAsset(getContext().getAssets(), typeface); } catch (Exception e) { tempTypeface = Typeface.create(Typeface.DEFAULT, Typeface.NORMAL); } setTypeface(tempTypeface); }
From source file:com.mobicage.rogerthat.GroupDetailActivity.java
private void setViewColors(View view, TextView name, boolean selected) { T.UI();// w w w .ja v a 2 s. co m Resources resources = getResources(); name.setTextColor(ContextCompat.getColor(mService, android.R.color.primary_text_light)); if (selected) { view.setBackgroundColor(ContextCompat.getColor(mService, R.color.mc_highlight_background)); name.setTypeface(Typeface.DEFAULT_BOLD); } else { view.setBackgroundColor(ContextCompat.getColor(mService, R.color.mc_background_color)); name.setTypeface(Typeface.DEFAULT); } }
From source file:cn.oddcloud.www.navigationtabbar.ntb.NavigationTabBar.java
public void setTypeface(final String typeface) { if (TextUtils.isEmpty(typeface)) return;/* w w w .j a v a 2 s .c o m*/ Typeface tempTypeface; try { tempTypeface = Typeface.createFromAsset(getContext().getAssets(), typeface); } catch (Exception e) { tempTypeface = Typeface.create(Typeface.DEFAULT, Typeface.NORMAL); e.printStackTrace(); } setTypeface(tempTypeface); }
From source file:kz.qobyzbook.activities.DMPlayerBaseActivity.java
@TargetApi(Build.VERSION_CODES.LOLLIPOP) private void displayView(int position) { Log.d(TAG, "displayView(" + position + ")"); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawerLayout); Fragment fragment = null;/*ww w. j av a 2 s . c o m*/ Class fragmentClass = null; switch (position) { case 1: { fragmentClass = FragmentKirispe.class; toolbar.setTitle(getResources().getString(R.string.kirispe)); // drawer.setBackground(getResources().getDrawable(R.drawable.qobyz_turaly)); rl_one.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_zero.setBackgroundColor(ContextCompat.getColor(this, R.color.list_row_hover_start_color)); rl_two.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_three.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_four.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_five.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_six.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_seven.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_eight.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_nine.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_ten.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); tv_zero.setTypeface(Typeface.DEFAULT_BOLD); tv_one.setTypeface(Typeface.DEFAULT); tv_two.setTypeface(Typeface.DEFAULT); tv_three.setTypeface(Typeface.DEFAULT); tv_four.setTypeface(Typeface.DEFAULT); tv_five.setTypeface(Typeface.DEFAULT); tv_six.setTypeface(Typeface.DEFAULT); tv_seven.setTypeface(Typeface.DEFAULT); tv_eight.setTypeface(Typeface.DEFAULT); tv_nine.setTypeface(Typeface.DEFAULT); tv_ten.setTypeface(Typeface.DEFAULT); tv_zero.setTextColor(getResources().getColor(R.color.cpv_default_color)); tv_one.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_two.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_three.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_four.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_five.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_six.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_seven.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_eight.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_nine.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_ten.setTextColor(getResources().getColor(R.color.text_color_gray)); } break; case 2: fragmentClass = QobyzFragment.class; toolbar.setTitle(getResources().getString(R.string.about_qobyz)); // drawer.setBackground(getResources().getDrawable(R.drawable.qobyz_turaly)); rl_zero.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_one.setBackgroundColor(ContextCompat.getColor(this, R.color.list_row_hover_start_color)); rl_two.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_three.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_four.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_five.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_six.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_seven.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_eight.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_nine.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_ten.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); tv_one.setTypeface(Typeface.DEFAULT_BOLD); tv_two.setTypeface(Typeface.DEFAULT); tv_three.setTypeface(Typeface.DEFAULT); tv_four.setTypeface(Typeface.DEFAULT); tv_five.setTypeface(Typeface.DEFAULT); tv_six.setTypeface(Typeface.DEFAULT); tv_seven.setTypeface(Typeface.DEFAULT); tv_eight.setTypeface(Typeface.DEFAULT); tv_nine.setTypeface(Typeface.DEFAULT); tv_zero.setTypeface(Typeface.DEFAULT); tv_ten.setTypeface(Typeface.DEFAULT); tv_one.setTextColor(getResources().getColor(R.color.cpv_default_color)); tv_two.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_three.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_four.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_five.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_six.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_seven.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_eight.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_nine.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_zero.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_ten.setTextColor(getResources().getColor(R.color.text_color_gray)); break; case 3: fragmentClass = PersonsFragment.class; toolbar.setTitle(getResources().getString(R.string.persons)); // drawer.setBackground(getResources().getDrawable(R.drawable.qobyzshylar)); rl_one.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_two.setBackgroundColor(ContextCompat.getColor(this, R.color.list_row_hover_start_color)); rl_three.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_four.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_five.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_six.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_seven.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_eight.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_nine.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_ten.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_zero.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); tv_one.setTypeface(Typeface.DEFAULT); tv_two.setTypeface(Typeface.DEFAULT_BOLD); tv_three.setTypeface(Typeface.DEFAULT); tv_four.setTypeface(Typeface.DEFAULT); tv_five.setTypeface(Typeface.DEFAULT); tv_six.setTypeface(Typeface.DEFAULT); tv_seven.setTypeface(Typeface.DEFAULT); tv_eight.setTypeface(Typeface.DEFAULT); tv_nine.setTypeface(Typeface.DEFAULT); tv_zero.setTypeface(Typeface.DEFAULT); tv_ten.setTypeface(Typeface.DEFAULT); tv_two.setTextColor(getResources().getColor(R.color.cpv_default_color)); tv_one.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_three.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_four.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_five.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_six.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_seven.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_eight.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_nine.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_zero.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_ten.setTextColor(getResources().getColor(R.color.text_color_gray)); break; case 4: fragmentClass = LessonFragment.class; toolbar.setTitle(getResources().getString(R.string.lessons)); // drawer.setBackground(getResources().getDrawable(R.drawable.lessons)); rl_one.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_two.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_three.setBackgroundColor(ContextCompat.getColor(this, R.color.list_row_hover_start_color)); rl_four.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_five.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_six.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_seven.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_eight.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_nine.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_ten.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_zero.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); tv_one.setTypeface(Typeface.DEFAULT); tv_two.setTypeface(Typeface.DEFAULT); tv_three.setTypeface(Typeface.DEFAULT_BOLD); tv_four.setTypeface(Typeface.DEFAULT); tv_five.setTypeface(Typeface.DEFAULT); tv_six.setTypeface(Typeface.DEFAULT); tv_seven.setTypeface(Typeface.DEFAULT); tv_eight.setTypeface(Typeface.DEFAULT); tv_nine.setTypeface(Typeface.DEFAULT); tv_zero.setTypeface(Typeface.DEFAULT); tv_ten.setTypeface(Typeface.DEFAULT); tv_three.setTextColor(getResources().getColor(R.color.cpv_default_color)); tv_two.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_one.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_four.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_five.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_six.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_seven.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_eight.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_nine.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_zero.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_ten.setTextColor(getResources().getColor(R.color.text_color_gray)); break; case 5: { fragmentClass = FragmentVideoLessons.class; toolbar.setTitle(getResources().getString(R.string.beine_sabaqtar)); // drawer.setBackground(getResources().getDrawable(R.drawable.video)); rl_one.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_two.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_three.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_five.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_four.setBackgroundColor(ContextCompat.getColor(this, R.color.list_row_hover_start_color)); rl_six.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_seven.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_eight.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_nine.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_ten.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_zero.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); tv_one.setTypeface(Typeface.DEFAULT); tv_two.setTypeface(Typeface.DEFAULT); tv_three.setTypeface(Typeface.DEFAULT); tv_four.setTypeface(Typeface.DEFAULT); tv_five.setTypeface(Typeface.DEFAULT_BOLD); tv_six.setTypeface(Typeface.DEFAULT); tv_seven.setTypeface(Typeface.DEFAULT); tv_eight.setTypeface(Typeface.DEFAULT); tv_nine.setTypeface(Typeface.DEFAULT); tv_zero.setTypeface(Typeface.DEFAULT); tv_ten.setTypeface(Typeface.DEFAULT); tv_five.setTextColor(getResources().getColor(R.color.cpv_default_color)); tv_two.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_three.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_four.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_one.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_six.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_seven.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_eight.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_nine.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_zero.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_ten.setTextColor(getResources().getColor(R.color.text_color_gray)); } break; case 6: { fragmentClass = FragmentAudioLesson.class; toolbar.setTitle(getResources().getString(R.string.audio)); // drawer.setBackground(getResources().getDrawable(R.drawable.audio)); rl_one.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_two.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_three.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_five.setBackgroundColor(ContextCompat.getColor(this, R.color.list_row_hover_start_color)); rl_four.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_six.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_seven.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_eight.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_nine.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_ten.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_zero.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); tv_one.setTypeface(Typeface.DEFAULT); tv_two.setTypeface(Typeface.DEFAULT); tv_three.setTypeface(Typeface.DEFAULT); tv_four.setTypeface(Typeface.DEFAULT_BOLD); tv_five.setTypeface(Typeface.DEFAULT); tv_six.setTypeface(Typeface.DEFAULT); tv_seven.setTypeface(Typeface.DEFAULT); tv_eight.setTypeface(Typeface.DEFAULT); tv_nine.setTypeface(Typeface.DEFAULT); tv_zero.setTypeface(Typeface.DEFAULT); tv_ten.setTypeface(Typeface.DEFAULT); tv_four.setTextColor(getResources().getColor(R.color.cpv_default_color)); tv_two.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_three.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_one.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_five.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_six.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_seven.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_eight.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_nine.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_zero.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_ten.setTextColor(getResources().getColor(R.color.text_color_gray)); } break; case 7: { fragmentClass = FragmentFavorite.class; toolbar.setTitle(getResources().getString(R.string.playlist)); // drawer.setBackground(getResources().getDrawable(R.drawable.test)); rl_one.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_two.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_three.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_four.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_five.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_six.setBackgroundColor(ContextCompat.getColor(this, R.color.list_row_hover_start_color)); rl_seven.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_eight.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_nine.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_ten.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_zero.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); tv_one.setTypeface(Typeface.DEFAULT); tv_two.setTypeface(Typeface.DEFAULT); tv_three.setTypeface(Typeface.DEFAULT); tv_four.setTypeface(Typeface.DEFAULT); tv_five.setTypeface(Typeface.DEFAULT); tv_six.setTypeface(Typeface.DEFAULT_BOLD); tv_seven.setTypeface(Typeface.DEFAULT); tv_eight.setTypeface(Typeface.DEFAULT); tv_nine.setTypeface(Typeface.DEFAULT); tv_zero.setTypeface(Typeface.DEFAULT); tv_ten.setTypeface(Typeface.DEFAULT); tv_six.setTextColor(getResources().getColor(R.color.cpv_default_color)); tv_two.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_three.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_four.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_five.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_seven.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_one.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_eight.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_nine.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_zero.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_ten.setTextColor(getResources().getColor(R.color.text_color_gray)); } break; case 8: { fragmentClass = FragmentTest.class; toolbar.setTitle(getResources().getString(R.string.test)); // drawer.setBackground(getResources().getDrawable(R.drawable.test)); rl_one.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_two.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_three.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_four.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_five.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_six.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_seven.setBackgroundColor(ContextCompat.getColor(this, R.color.list_row_hover_start_color)); rl_eight.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_nine.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_ten.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_zero.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); tv_one.setTypeface(Typeface.DEFAULT); tv_two.setTypeface(Typeface.DEFAULT); tv_three.setTypeface(Typeface.DEFAULT); tv_four.setTypeface(Typeface.DEFAULT); tv_five.setTypeface(Typeface.DEFAULT); tv_seven.setTypeface(Typeface.DEFAULT_BOLD); tv_six.setTypeface(Typeface.DEFAULT); tv_eight.setTypeface(Typeface.DEFAULT); tv_nine.setTypeface(Typeface.DEFAULT); tv_zero.setTypeface(Typeface.DEFAULT); tv_ten.setTypeface(Typeface.DEFAULT); tv_seven.setTextColor(getResources().getColor(R.color.cpv_default_color)); tv_two.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_three.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_four.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_five.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_one.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_six.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_eight.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_nine.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_zero.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_ten.setTextColor(getResources().getColor(R.color.text_color_gray)); } break; case 9: { fragmentClass = FragmentAuthor.class; toolbar.setTitle(getResources().getString(R.string.autor)); // drawer.setBackground(getResources().getDrawable(R.drawable.test)); rl_one.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_two.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_three.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_four.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_five.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_six.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_seven.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_eight.setBackgroundColor(ContextCompat.getColor(this, R.color.list_row_hover_start_color)); rl_nine.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_ten.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_zero.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); tv_one.setTypeface(Typeface.DEFAULT); tv_two.setTypeface(Typeface.DEFAULT); tv_three.setTypeface(Typeface.DEFAULT); tv_four.setTypeface(Typeface.DEFAULT); tv_five.setTypeface(Typeface.DEFAULT); tv_six.setTypeface(Typeface.DEFAULT); tv_seven.setTypeface(Typeface.DEFAULT); tv_nine.setTypeface(Typeface.DEFAULT); tv_eight.setTypeface(Typeface.DEFAULT_BOLD); tv_zero.setTypeface(Typeface.DEFAULT); tv_ten.setTypeface(Typeface.DEFAULT); tv_one.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_two.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_three.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_four.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_five.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_six.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_seven.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_nine.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_ten.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_zero.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_eight.setTextColor(getResources().getColor(R.color.cpv_default_color)); } break; case 10: { fragmentClass = FragmentAboutProject.class; toolbar.setTitle(getResources().getString(R.string.zhoba_turaly)); // drawer.setBackground(getResources().getDrawable(R.drawable.about_project)); rl_one.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_two.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_three.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_four.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_five.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_six.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_seven.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_eight.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_ten.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_nine.setBackgroundColor(ContextCompat.getColor(this, R.color.list_row_hover_start_color)); rl_zero.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); tv_one.setTypeface(Typeface.DEFAULT); tv_two.setTypeface(Typeface.DEFAULT); tv_three.setTypeface(Typeface.DEFAULT); tv_four.setTypeface(Typeface.DEFAULT); tv_five.setTypeface(Typeface.DEFAULT); tv_six.setTypeface(Typeface.DEFAULT); tv_seven.setTypeface(Typeface.DEFAULT); tv_eight.setTypeface(Typeface.DEFAULT); tv_nine.setTypeface(Typeface.DEFAULT); tv_zero.setTypeface(Typeface.DEFAULT); tv_ten.setTypeface(Typeface.DEFAULT_BOLD); tv_ten.setTextColor(getResources().getColor(R.color.cpv_default_color)); tv_two.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_three.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_four.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_five.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_six.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_seven.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_eight.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_one.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_zero.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_nine.setTextColor(getResources().getColor(R.color.text_color_gray)); } break; case 11: { fragmentClass = FragmentNews.class; toolbar.setTitle(getResources().getString(R.string.news)); // drawer.setBackground(getResources().getDrawable(R.drawable.settings)); rl_one.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_two.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_three.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_four.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_five.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_six.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_seven.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_eight.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_ten.setBackgroundColor(ContextCompat.getColor(this, R.color.list_row_hover_start_color)); rl_nine.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); rl_zero.setBackgroundColor(ContextCompat.getColor(this, R.color.white)); tv_one.setTypeface(Typeface.DEFAULT); tv_two.setTypeface(Typeface.DEFAULT); tv_three.setTypeface(Typeface.DEFAULT); tv_four.setTypeface(Typeface.DEFAULT); tv_five.setTypeface(Typeface.DEFAULT); tv_six.setTypeface(Typeface.DEFAULT); tv_seven.setTypeface(Typeface.DEFAULT); tv_eight.setTypeface(Typeface.DEFAULT); tv_nine.setTypeface(Typeface.DEFAULT_BOLD); tv_zero.setTypeface(Typeface.DEFAULT); tv_ten.setTypeface(Typeface.DEFAULT); tv_one.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_two.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_three.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_four.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_five.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_six.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_seven.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_ten.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_eight.setTextColor(getResources().getColor(R.color.text_color_gray)); tv_nine.setTextColor(getResources().getColor(R.color.cpv_default_color)); tv_zero.setTextColor(getResources().getColor(R.color.text_color_gray)); } break; default: break; } if (fragmentClass != null) { try { fragment = (Fragment) fragmentClass.newInstance(); } catch (Exception e) { e.printStackTrace(); } FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager.beginTransaction().replace(R.id.fragment, fragment).commit(); drawer.closeDrawer(GravityCompat.START); } else drawer.closeDrawer(GravityCompat.START); }
From source file:cn.oddcloud.www.navigationtabbar.ntb.NavigationTabBar.java
private void setBadgeTypeface() { mBadgePaint .setTypeface(mIsBadgeUseTypeface ? mTypeface : Typeface.create(Typeface.DEFAULT, Typeface.NORMAL)); }
From source file:devlight.io.library.ntb.NavigationTabBar.java
protected void setBadgeTypeface() { mBadgePaint .setTypeface(mIsBadgeUseTypeface ? mTypeface : Typeface.create(Typeface.DEFAULT, Typeface.NORMAL)); }