List of usage examples for android.graphics Typeface DEFAULT_BOLD
Typeface DEFAULT_BOLD
To view the source code for android.graphics Typeface DEFAULT_BOLD.
Click Source Link
From source file:com.pukulab.puku0x.gscalendar.CalendarActivity.java
@Override public void onDayClick(final long dayInMillis) { // Reset the previously selected TextView to his previous Typeface if (mSelectedTextView != null) { mSelectedTextView.setTypeface(mSelectedTypeface); mSelectedTextView.setBackgroundColor(getResources().getColor(android.R.color.background_light)); }//w w w . j a v a2s .co m final TextView day = mCalendarView.getTextViewForDate(dayInMillis); if (day != null) { // Remember the selected TextView and it's font mSelectedTypeface = day.getTypeface(); mSelectedTextView = day; // Show the selected TextView as bold day.setTypeface(Typeface.DEFAULT_BOLD); day.setBackgroundColor(getResources().getColor(R.color.theme_color_transparent)); } // ? Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(dayInMillis); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); mDisplayedDate = calendar.getTime(); // ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { //actionBar.setDisplayHomeAsUpEnabled(true); //actionBar.setTitle(mDisplayedUser.name); actionBar.setSubtitle(DateFormat.format(getString(R.string.date_year_month_day), mDisplayedDate)); } // ? mDailyScheduleList.clear(); for (ScheduleData d : mScheduleDataList) { if (d.date.equals(mDisplayedDate)) { // //TextView tv_date = (TextView) findViewById(R.id.tv_schedule_date); //tv_date.setText(DateFormat.format(getString(R.string.date_month_day_week), d.date)); // ???? if (!d.scheduleList.isEmpty()) { mDailyScheduleList.addAll(d.scheduleList); } } } mDailyScheduleaListAdapter.notifyDataSetChanged(); }
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;/* w ww . ja va2 s . c om*/ 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:com.amaze.carbonfilemanager.fragments.ProcessViewer.java
/** * Initialize chart for the first time/* w w w . j a va2 s. c om*/ * @param totalBytes maximum value for x-axis */ private void chartInit(long totalBytes) { mLineChart.setBackgroundColor(accentColor); mLineChart.getLegend().setEnabled(false); // no description text mLineChart.getDescription().setEnabled(false); XAxis xAxis = mLineChart.getXAxis(); YAxis yAxisLeft = mLineChart.getAxisLeft(); mLineChart.getAxisRight().setEnabled(false); yAxisLeft.setTextColor(Color.WHITE); yAxisLeft.setAxisLineColor(Color.TRANSPARENT); yAxisLeft.setTypeface(Typeface.DEFAULT_BOLD); yAxisLeft.setGridColor(Utils.getColor(getContext(), R.color.white_translucent)); xAxis.setAxisMaximum(Futils.readableFileSizeFloat(totalBytes)); xAxis.setAxisMinimum(0.0f); xAxis.setAxisLineColor(Color.TRANSPARENT); xAxis.setGridColor(Color.TRANSPARENT); xAxis.setTextColor(Color.WHITE); xAxis.setTypeface(Typeface.DEFAULT_BOLD); mLineChart.setData(mLineData); mLineChart.invalidate(); }
From source file:com.cssweb.android.view.PriceMini.java
public void drawIndex(Canvas canvas) { //canvas.restore(); Paint paint = this.mPaint; paint.setTypeface(Typeface.DEFAULT_BOLD); paint.setAntiAlias(true);//from w ww . j av a2 s .c om if (quoteData != null) { try { JSONArray jArr = quoteData.getJSONArray("data"); JSONObject jo = jArr.getJSONObject(0); double zrsp = jo.getDouble("zrsp"); double zjcj = jo.getDouble("zjcj"); paint.setTextSize(mTextSize * 2); setColor(paint, zjcj, zrsp); paint.setTextAlign(Paint.Align.LEFT); canvas.translate(DX * 0.5f, DY * 2f); canvas.drawText(Utils.dataFormation(zjcj, stockdigit), x, y, paint); paint.setStyle(Paint.Style.STROKE); paint.setTextSize(mTextSize); double zhangd = jo.getDouble("zd"); if (zhangd < 0) { paint.setColor(GlobalColor.colorPriceDown); } else if (zhangd > 0) { paint.setColor(GlobalColor.colorpriceUp); } else { paint.setColor(GlobalColor.colorPriceEqual); } canvas.translate(0, DY * 0.8f); String zhangdie = Utils.dataFormation(zhangd, stockdigit); if (zhangdie.equals("-")) canvas.drawText("", x, y, paint); else canvas.drawText(zhangdie, x, y, paint); double zhangf = jo.getDouble("zf"); if (zhangf < 0) { paint.setColor(GlobalColor.colorPriceDown); } else if (zhangf > 0) { paint.setColor(GlobalColor.colorpriceUp); } else { paint.setColor(GlobalColor.colorPriceEqual); } canvas.translate(DX * 3.5f, 0); String zhangfu = Utils.dataFormation(zhangf * 100, stockdigit); if (zhangfu.equals("-")) canvas.drawText("", x, y, paint); else canvas.drawText(zhangfu + "%", x, y, paint); paint.setColor(GlobalColor.colorLabelName); canvas.translate(-DX * 3.5f, DY * 1.2f); //canvas.translate(-DX*0.5f, DY*2f); canvas.drawText("", x, y, paint); canvas.translate(0, DY); canvas.drawText("??", x, y, paint); canvas.translate(0, DY); canvas.drawText("??", x, y, paint); canvas.translate(0, DY); canvas.drawText("", x, y, paint); canvas.translate(0, DY); canvas.drawText("", x, y, paint); paint.setColor(GlobalColor.colorLabelName); paint.setTextAlign(Paint.Align.LEFT); canvas.translate(width / 2 - DX, -DY * 7); canvas.drawText("", x, y, paint); canvas.translate(0, DY); canvas.drawText("", x, y, paint); canvas.translate(0, DY); canvas.drawText("", x, y, paint); canvas.translate(0, DY); canvas.drawText("", x, y, paint); paint.setTextAlign(Paint.Align.RIGHT); paint.setColor(GlobalColor.colorLabelName); canvas.translate(0, 0); canvas.drawText(Utils.dataFormation(zrsp, stockdigit), x, y, paint); canvas.translate(width / 2, -DY * 3); paint.setTextAlign(Paint.Align.RIGHT); double jrkp = jo.getDouble("jrkp"); setColor(paint, jrkp, zrsp); canvas.drawText(Utils.dataFormation(jrkp, stockdigit), x, y, paint); canvas.translate(0, DY); double zg = jo.getDouble("zgcj"); setColor(paint, zg, zrsp); canvas.drawText(Utils.dataFormation(zg, stockdigit), x, y, paint); canvas.translate(0, DY); double zd = jo.getDouble("zdcj"); setColor(paint, zd, zrsp); canvas.drawText(Utils.dataFormation(zd, stockdigit), x, y, paint); paint.setColor(GlobalColor.colorStockName); canvas.translate(0, DY); double amp = jo.getDouble("amp"); if (amp == 0) canvas.drawText("", x, y, paint); else canvas.drawText(Utils.dataFormation(jo.getDouble("amp") * 100, 1) + "%", x, y, paint); paint.setColor(GlobalColor.colorStockName); canvas.translate(0, DY); canvas.drawText(Utils.getAmountFormat(jo.getDouble("cjsl"), true), x, y, paint); canvas.translate(0, DY); canvas.drawText(Utils.getAmountFormat(jo.getDouble("cjje"), true), x, y, paint); canvas.translate(0, DY); paint.setColor(GlobalColor.colorpriceUp); canvas.drawText(String.valueOf(jo.getInt("zj")), x, y, paint); canvas.translate(0, DY); paint.setColor(GlobalColor.colorPriceDown); canvas.drawText(String.valueOf(jo.getInt("dj")), x, y, paint); } catch (JSONException e) { Log.e(TAG, e.toString()); } } else {//????? paint.setTextAlign(Paint.Align.LEFT); paint.setColor(GlobalColor.colorLabelName); canvas.translate(DX, DY * 2f); canvas.drawText("-", x, y, paint); paint.setStyle(Paint.Style.STROKE); paint.setTextSize(mTextSize); canvas.translate(-DX / 2, DY * 0.8f); canvas.drawText("-", x, y, paint); canvas.translate(DX * 2.5f, 0); canvas.drawText("-", x, y, paint); canvas.translate(-DX * 2.5f, DY * 1.2f); canvas.drawText("", x, y, paint); canvas.translate(0, DY); canvas.drawText("??", x, y, paint); canvas.translate(0, DY); canvas.drawText("??", x, y, paint); canvas.translate(0, DY); canvas.drawText("", x, y, paint); canvas.translate(0, DY); canvas.drawText("", x, y, paint); paint.setTextAlign(Paint.Align.LEFT); canvas.translate(width / 2 - DX, -DY * 7); canvas.drawText("", x, y, paint); canvas.translate(0, DY); canvas.drawText("", x, y, paint); canvas.translate(0, DY); canvas.drawText("", x, y, paint); canvas.translate(0, DY); canvas.drawText("", x, y, paint); } }
From source file:com.alexcruz.papuhwalls.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { this.Preferences = new Preferences(getApplicationContext()); super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); context = this; CustomActivityOnCrash.install(this); prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); if (prefs.getBoolean(Preferences.IS_FIRST__RUN, true)) { startActivity(new Intent(this, Slides.class)); finish();//from w w w. ja v a 2s .co m } if (Build.VERSION.SDK_INT >= 23 && PermissionChecker.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PermissionChecker.PERMISSION_GRANTED) { requestPermissions(new String[] { Manifest.permission.READ_EXTERNAL_STORAGE }, REQUEST_READ_STORAGE_PERMISSION); } else { // Do absolutely NOTHING } final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); com.alexcruz.papuhwalls.Preferences.themeMe(this, toolbar); Home = getResources().getString(R.string.app_name); final String Home = getResources().getString(R.string.section_home); AllWalls = getResources().getString(R.string.section_all_walls); AndroidWalls = getResources().getString(R.string.section_android_walls); BwWalls = getResources().getString(R.string.section_bw_walls); BlurWalls = getResources().getString(R.string.section_blur_walls); CloudsWalls = getResources().getString(R.string.section_clouds_walls); MiscWalls = getResources().getString(R.string.section_misc_walls); MustachesWalls = getResources().getString(R.string.section_mustaches_walls); NexusWalls = getResources().getString(R.string.section_nexus_walls); OriginalWalls = getResources().getString(R.string.section_original_walls); PapuhWalls = getResources().getString(R.string.section_papuh_walls); SolidsWalls = getResources().getString(R.string.section_solids_walls); StarsWalls = getResources().getString(R.string.section_stars_walls); RomCategory = getResources().getString(R.string.section_rom_category); AicpWalls = getResources().getString(R.string.section_aicp_walls); BrokenOsWalls = getResources().getString(R.string.section_brokenos_walls); CandyWalls = getResources().getString(R.string.section_candy_walls); DuWalls = getResources().getString(R.string.section_du_walls); EosWalls = getResources().getString(R.string.section_eos_walls); LiquidsmoothWalls = getResources().getString(R.string.section_liquidsmooth_walls); OmniWalls = getResources().getString(R.string.section_omni_walls); OrionWalls = getResources().getString(R.string.section_orion_walls); PaWalls = getResources().getString(R.string.section_pa_walls); PacromWalls = getResources().getString(R.string.section_pacrom_walls); RrWalls = getResources().getString(R.string.section_rr_walls); SlimWalls = getResources().getString(R.string.section_slim_walls); TeslaWalls = getResources().getString(R.string.section_tesla_walls); TwistedAOSPWalls = getResources().getString(R.string.section_twistedaosp_walls); ValidusWalls = getResources().getString(R.string.section_validus_walls); Settings = getResources().getString(R.string.settings); LiveWallpaper = getResources().getString(R.string.live_wallpaper_description); MuzeiSettings = getResources().getString(R.string.muzei_settings); AboutApp = getResources().getString(R.string.section_aboutapp); currentItem = 1; final IProfile profile = new ProfileDrawerItem().withName("Alex Cruz aka Mazda") .withIcon(getResources().getDrawable(R.drawable.alexcruz)).withIdentifier(1); int header = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(getString(R.string.time_context_headers), false)) { if (header < TIME_SUNRISE || header >= TIME_NIGHT) { if (PreferenceManager.getDefaultSharedPreferences(this) .getBoolean(getString(R.string.poly_time_context_headers), false)) { header = R.drawable.poly_night; } else { header = R.drawable.night; } } else if (header >= TIME_SUNRISE && header < TIME_MORNING) { if (PreferenceManager.getDefaultSharedPreferences(this) .getBoolean(getString(R.string.poly_time_context_headers), false)) { header = R.drawable.poly_sunrise; } else { header = R.drawable.sunrise; } } else if (header >= TIME_MORNING && header < TIME_NOON) { if (PreferenceManager.getDefaultSharedPreferences(this) .getBoolean(getString(R.string.poly_time_context_headers), false)) { header = R.drawable.poly_morning; } else { header = R.drawable.morning; } } else if (header >= TIME_NOON && header < TIME_AFTERNOON) { if (PreferenceManager.getDefaultSharedPreferences(this) .getBoolean(getString(R.string.poly_time_context_headers), false)) { header = R.drawable.poly_noon; } else { header = R.drawable.noon; } } else if (header >= TIME_AFTERNOON && header < TIME_SUNSET) { if (PreferenceManager.getDefaultSharedPreferences(this) .getBoolean(getString(R.string.poly_time_context_headers), false)) { header = R.drawable.poly_afternoon; } else { header = R.drawable.afternoon; } } else if (header >= TIME_SUNSET && header < TIME_NIGHT) { if (PreferenceManager.getDefaultSharedPreferences(this) .getBoolean(getString(R.string.poly_time_context_headers), false)) { header = R.drawable.poly_sunset; } else { header = R.drawable.sunset; } } } else { header = R.drawable.header; } String versionName; try { versionName = getPackageManager().getPackageInfo(getPackageName(), 0).versionName; } catch (Exception e) { throw new RuntimeException(e); } headerResult = new AccountHeaderBuilder().withActivity(this).withHeaderBackground(header) .withSelectionFirstLine(getResources().getString(R.string.app_long_name)) .withSelectionSecondLine("v" + versionName).withSelectionListEnabledForSingleProfile(false) .addProfiles(profile).withOnAccountHeaderListener(new AccountHeader.OnAccountHeaderListener() { @Override public boolean onProfileChanged(View view, IProfile profile, boolean current) { if (profile instanceof IDrawerItem && ((IDrawerItem) profile).getIdentifier() == PROFILE_SETTING) { int count = 100 + headerResult.getProfiles().size() + 1; if (headerResult.getProfiles() != null) { Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { getResources().getString(R.string.email_address) }); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getResources().getText(R.string.artsource_name)); emailIntent.setType("plain/text"); startActivity(Intent.createChooser(emailIntent, "Contact Alex")); } else { headerResult.addProfiles(profile); } } return false; } }).withSavedInstance(savedInstanceState).build(); result = new DrawerBuilder().withActivity(this).withToolbar(toolbar).withAccountHeader(headerResult) .withHeader(R.layout.header).withSavedInstance(savedInstanceState).withScrollToTopAfterClick(true) .withFooterDivider(true).withSliderBackgroundColor(Preferences.Drawer()) .withStatusBarColor( Preferences.StatusBarTint() ? tint(Preferences.Theme(), 0.8) : Preferences.Theme()) .addDrawerItems( new PrimaryDrawerItem().withName(Home).withIcon(R.drawable.ic_home) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(1), new PrimaryDrawerItem().withName(AllWalls).withIcon(R.drawable.ic_allwalls) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(2).withBadge("1630+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(AndroidWalls).withIcon(R.drawable.ic_android) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(3).withBadge("17+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(BwWalls).withIcon(R.drawable.ic_bw) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(4).withBadge("56+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(BlurWalls).withIcon(R.drawable.ic_blur) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(5).withBadge("10+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(CloudsWalls).withIcon(R.drawable.ic_clouds) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(6).withBadge("60+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(MiscWalls).withIcon(R.drawable.ic_misc) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(7).withBadge("41+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(MustachesWalls).withIcon(R.drawable.ic_mustaches) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(8).withBadge("10+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(NexusWalls).withIcon(R.drawable.ic_nexus) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(9).withBadge("98+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(OriginalWalls).withIcon(R.drawable.ic_original) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(10).withBadge("343+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(PapuhWalls).withIcon(R.drawable.ic_papuh) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(11).withBadge("24+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(SolidsWalls).withIcon(R.drawable.ic_solids) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(12).withBadge("72+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(StarsWalls).withIcon(R.drawable.ic_stars) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(13).withBadge("11+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new SectionDrawerItem().withName(RomCategory).withTypeface(Typeface.DEFAULT_BOLD) .withTextColor(Preferences.DrawerText()), new PrimaryDrawerItem().withName(AicpWalls).withIcon(R.drawable.ic_aicp) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(15).withBadge("84+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(BrokenOsWalls).withIcon(R.drawable.ic_brokenos) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(16).withBadge("53+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(CandyWalls).withIcon(R.drawable.ic_candy) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(17).withBadge("80+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(DuWalls).withIcon(R.drawable.ic_dirtyunicorns) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(18).withBadge("139+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(EosWalls).withIcon(R.drawable.ic_eos) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(19).withBadge("48+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(LiquidsmoothWalls).withIcon(R.drawable.ic_liquidsmooth) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(20).withBadge("65+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(OmniWalls).withIcon(R.drawable.ic_omni) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(21).withBadge("29+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(OrionWalls).withIcon(R.drawable.ic_orion) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(22).withBadge("10+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(PaWalls).withIcon(R.drawable.ic_pa) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(23).withBadge("10+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(PacromWalls).withIcon(R.drawable.ic_pacrom) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(24).withBadge("21+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(RrWalls).withIcon(R.drawable.ic_rr) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(25).withBadge("54+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(SlimWalls).withIcon(R.drawable.ic_slim) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(26).withBadge("8+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(TeslaWalls).withIcon(R.drawable.ic_tesla) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(27).withBadge("43+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(TwistedAOSPWalls).withIcon(R.drawable.ic_twistedaosp) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(28).withBadge("43+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(ValidusWalls).withIcon(R.drawable.ic_validus) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(29).withBadge("258+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new DividerDrawerItem(), new SecondaryDrawerItem().withName(Settings).withIcon(R.drawable.ic_settings) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(30), new SecondaryDrawerItem().withName(LiveWallpaper) .withIcon(R.drawable.ic_device_now_wallpaper).withIconTintingEnabled(true) .withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(33), new SecondaryDrawerItem().withName(MuzeiSettings).withIcon(R.drawable.ic_muzei) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(31), new SecondaryDrawerItem().withName(AboutApp).withIcon(R.drawable.ic_about) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(32)) .withOnDrawerListener(new Drawer.OnDrawerListener() { @Override public void onDrawerOpened(View drawerView) { } @Override public void onDrawerClosed(View drawerView) { } @Override public void onDrawerSlide(View drawerView, float slideOffset) { } }).withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() { @Override public boolean onItemClick(View view, int position, IDrawerItem drawerItem) { boolean isMuzeiInstalled = Preferences.isAppInstalled(context, "net.nurik.roman.muzei"); boolean isConnected = isConnected(MainActivity.this); if (drawerItem != null) { switch (drawerItem.getIdentifier()) { case 1: switchFragment(1, Home, "BaseActivity"); break; case 2: if (isConnected) { switchWalls(2, AllWalls, "AllWalls"); } else { showNotConnectedDialog(); } break; case 3: if (isConnected) { switchWalls(3, AndroidWalls, "AndroidWalls"); } else { showNotConnectedDialog(); } break; case 4: if (isConnected) { switchWalls(4, BwWalls, "BwWalls"); } else { showNotConnectedDialog(); } break; case 5: if (isConnected) { switchWalls(5, BlurWalls, "BlurWalls"); } else { showNotConnectedDialog(); } break; case 6: if (isConnected) { switchWalls(6, BwWalls, "CloudsWalls"); } else { showNotConnectedDialog(); } break; case 7: if (isConnected) { switchWalls(7, MiscWalls, "MiscWalls"); } else { showNotConnectedDialog(); } break; case 8: if (isConnected) { switchWalls(8, MustachesWalls, "MustachesWalls"); } else { showNotConnectedDialog(); } break; case 9: if (isConnected) { switchWalls(9, NexusWalls, "NexusWalls"); } else { showNotConnectedDialog(); } break; case 10: if (isConnected) { switchWalls(10, OriginalWalls, "OriginalWalls"); } else { showNotConnectedDialog(); } break; case 11: if (isConnected) { switchWalls(11, PapuhWalls, "PapuhWalls"); } else { showNotConnectedDialog(); } break; case 12: if (isConnected) { switchWalls(12, SolidsWalls, "SolidsWalls"); } else { showNotConnectedDialog(); } break; case 13: if (isConnected) { switchWalls(13, StarsWalls, "StarsWalls"); } else { showNotConnectedDialog(); } break; case 14: setTitle(R.string.section_rom_category); ; break; case 15: if (isConnected) { switchWalls(15, AicpWalls, "AicpWalls"); } else { showNotConnectedDialog(); } break; case 16: if (isConnected) { switchWalls(16, BrokenOsWalls, "BrokenOsWalls"); } else { showNotConnectedDialog(); } break; case 17: if (isConnected) { switchWalls(17, CandyWalls, "CandyWalls"); } else { showNotConnectedDialog(); } break; case 18: if (isConnected) { switchWalls(18, DuWalls, "DuWalls"); } else { showNotConnectedDialog(); } break; case 19: if (isConnected) { switchWalls(19, EosWalls, "EosWalls"); } else { showNotConnectedDialog(); } break; case 20: if (isConnected) { switchWalls(20, LiquidsmoothWalls, "LiquidsmoothWalls"); } else { showNotConnectedDialog(); } break; case 21: if (isConnected) { switchWalls(21, OmniWalls, "OmniWalls"); } else { showNotConnectedDialog(); } break; case 22: if (isConnected) { switchWalls(22, OrionWalls, "OrionWalls"); } else { showNotConnectedDialog(); } break; case 23: if (isConnected) { switchWalls(23, PaWalls, "PaWalls"); } else { showNotConnectedDialog(); } break; case 24: if (isConnected) { switchWalls(24, PacromWalls, "PacromWalls"); } else { showNotConnectedDialog(); } break; case 25: if (isConnected) { switchWalls(25, RrWalls, "RrWalls"); } else { showNotConnectedDialog(); } break; case 26: if (isConnected) { switchWalls(26, SlimWalls, "SlimWalls"); } else { showNotConnectedDialog(); } break; case 27: if (isConnected) { switchWalls(27, TeslaWalls, "TeslaWalls"); } else { showNotConnectedDialog(); } break; case 28: if (isConnected) { switchWalls(28, TwistedAOSPWalls, "TwistedAOSPWalls"); } else { showNotConnectedDialog(); } break; case 29: if (isConnected) { switchWalls(29, ValidusWalls, "ValidusWalls"); } else { showNotConnectedDialog(); } break; case 30: Intent SettingsIntent = new Intent(MainActivity.this, SettingsActivity.class); startActivityForResult(SettingsIntent, 0); break; case 31: if (isMuzeiInstalled) { Intent launchMuzeiIntent = new Intent(MainActivity.this, Settings.class); startActivityForResult(launchMuzeiIntent, 0); } else { // Do absolutely NOTHING } break; case 32: switchFragment(32, AboutApp, "Credits"); break; case 33: Intent LWIntent = new Intent(MainActivity.this, com.alexcruz.papuhwalls.Live.Settings.class); startActivityForResult(LWIntent, 0); break; } } return false; } }).withOnDrawerItemLongClickListener(new Drawer.OnDrawerItemLongClickListener() { @Override public boolean onItemLongClick(View view, int position, IDrawerItem drawerItem) { if (drawerItem instanceof SecondaryDrawerItem) { } return false; } }).build(); result.setSelection(1, true); boolean isMuzeiInstalled = Preferences.isAppInstalled(context, "net.nurik.roman.muzei"); if (!isMuzeiInstalled) { result.removeItem(31); } else { // Do absolutely NOTHING } if (Preferences.getLiveWalls().size() == 0 & isConnected(this)) new SetupLW(this).execute(); }
From source file:com.example.drugsformarinemammals.Dose_Information.java
public TextView createTitleTextView() { TextView title_textview = new TextView(this); title_textview.setTextSize(20);//www . j ava2 s .c o m title_textview.setTextColor(getResources().getColor(R.color.darkGray)); title_textview.setTypeface(Typeface.SANS_SERIF, Typeface.DEFAULT_BOLD.getStyle()); return title_textview; }
From source file:com.cssweb.android.view.PriceView.java
public void drawHKPrice(Canvas canvas) { //canvas.restore(); Paint paint = this.mPaint; tPaint.setColor(GlobalColor.clrLine); tPaint.setStyle(Paint.Style.STROKE); tPaint.setStrokeWidth(1);// ww w .j ava 2 s .c o m this.x = 0; this.y = 0; startX = x + tips / 2; endX = width - tips / 2; canvas.drawRect(startX, DY / 4, endX, height - DY / 4, tPaint); // canvas.drawLine(startX, DY+DY/4, endX, DY+DY/4, tPaint); canvas.drawLine(startX, DY * 5 + DY / 4, endX, DY * 5 + DY / 4, tPaint); canvas.drawLine(startX, DY * 10 + DY / 4, endX, DY * 10 + DY / 4, tPaint); canvas.drawLine(startX, DY * 16 + DY / 4, endX, DY * 16 + DY / 4, tPaint); if (quoteData != null) { try { JSONArray jArr = quoteData.getJSONArray("data"); JSONObject jo = jArr.getJSONObject(0); String str = ""; double zrsp = jo.getDouble("zrsp"); canvas.translate(0, DY); paint.setTypeface(Typeface.DEFAULT_BOLD); paint.setAntiAlias(true); paint.setTextSize(mTextSize); // paint.setTextAlign(Paint.Align.LEFT); // paint.setColor(GlobalColor.colorLabelName); // canvas.drawText("", x+tips, y, paint); // // paint.setTextAlign(Paint.Align.RIGHT); // canvas.translate(width/2, 0); // if(jo.getDouble("wb")<0) // paint.setColor(GlobalColor.colorPriceDown); // else if(jo.getDouble("wb")>0) // paint.setColor(GlobalColor.colorpriceUp); // else // paint.setColor(GlobalColor.colorPriceEqual); // canvas.drawText(Utils.dataFormation(jo.getDouble("wb")*100, 1)+"%", x, y, paint); // // paint.setTextAlign(Paint.Align.LEFT); // paint.setColor(GlobalColor.colorLabelName); // canvas.drawText("", x+tips, y, paint); // // paint.setTextAlign(Paint.Align.RIGHT); // canvas.translate(width/2, 0); // if(jo.getDouble("wc")<0) { // paint.setColor(GlobalColor.colorPriceDown); // canvas.drawText("-" + Utils.getAmountFormat(Math.abs(jo.getDouble("wc")), true), x-tips, y, paint); // } // else if(jo.getDouble("wc")>0) { // paint.setColor(GlobalColor.colorpriceUp); // canvas.drawText(Utils.getAmountFormat(jo.getDouble("wc"), true), x-tips, y, paint); // } // else { // paint.setColor(GlobalColor.colorPriceEqual); // canvas.drawText(Utils.getAmountFormat(jo.getDouble("wc"), true), x-tips, y, paint); // } // // canvas.translate(-width, DY); paint.setTextAlign(Paint.Align.LEFT); paint.setColor(GlobalColor.colorLabelName); canvas.drawText("?", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("?", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("?", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("?", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("?", x + tips, y, paint); paint.setTextAlign(Paint.Align.RIGHT); canvas.translate(width / 2, -DY * 4); for (int i = 5; i >= 1; i--) { double temp2 = jo.getDouble("sjw" + i); setColor(paint, temp2, zrsp); str = Utils.dataFormation(temp2, stockdigit, jo.getInt("tp")); canvas.drawText(str, x, y, paint); if (i != 1) canvas.translate(0, DY); } paint.setColor(GlobalColor.colorStockName); canvas.translate(width / 2, -DY * 4); for (int i = 5; i >= 1; i--) { paint.setTextAlign(Paint.Align.RIGHT); canvas.drawText(Utils.getAmountFormat(jo.getInt("ssl" + i), false), x - tips, y, paint); if (i != 1) canvas.translate(0, DY); } canvas.translate(-width, DY); paint.setTextAlign(Paint.Align.LEFT); paint.setColor(GlobalColor.colorLabelName); canvas.drawText("", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("", x + tips, y, paint); canvas.translate(width / 2, -DY * 4); paint.setTextAlign(Paint.Align.RIGHT); for (int i = 1; i <= 5; i++) { double temp2 = jo.getDouble("bjw" + i); setColor(paint, temp2, zrsp); str = Utils.dataFormation(temp2, stockdigit, jo.getInt("tp")); canvas.drawText(str, x, y, paint); if (i != 5) canvas.translate(0, DY); } paint.setColor(GlobalColor.colorStockName); canvas.translate(width / 2, -DY * 4); for (int i = 1; i <= 5; i++) { paint.setTextAlign(Paint.Align.RIGHT); canvas.drawText(Utils.getAmountFormat(jo.getInt("bsl" + i), false), x - tips, y, paint); if (i != 5) canvas.translate(0, DY); } canvas.translate(-width, DY); paint.setTextAlign(Paint.Align.LEFT); paint.setColor(GlobalColor.colorLabelName); canvas.drawText("", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("?", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("?", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("?", x + tips, y, paint); canvas.translate(width / 2, -DY * 6); paint.setTextAlign(Paint.Align.RIGHT); double zjcj = jo.getDouble("zjcj"); setColor(paint, zjcj, zrsp); canvas.drawText(Utils.dataFormation(zjcj, stockdigit, jo.getInt("tp")), x, y, paint); canvas.translate(0, DY); double zhangd = jo.getDouble("zd"); if (zhangd < 0) { paint.setColor(GlobalColor.colorPriceDown); } else if (zhangd > 0) { paint.setColor(GlobalColor.colorpriceUp); } else { paint.setColor(GlobalColor.colorPriceEqual); } String zhangdie = Utils.dataFormation(zhangd, stockdigit, jo.getInt("tp")); if (zhangdie.equals("-") || zhangdie.equals("")) canvas.drawText("", x, y, paint); else canvas.drawText(zhangdie, x, y, paint); double zhangf = jo.getDouble("zf"); if (zhangf < 0) { paint.setColor(GlobalColor.colorPriceDown); } else if (zhangf > 0) { paint.setColor(GlobalColor.colorpriceUp); } else { paint.setColor(GlobalColor.colorPriceEqual); } canvas.translate(0, DY); String zhangfu = Utils.dataFormation(zhangf * 100, 1, jo.getInt("tp")); if (zhangfu.equals("-") || zhangfu.equals("")) canvas.drawText("", x, y, paint); else canvas.drawText(zhangfu + "%", x, y, paint); paint.setColor(GlobalColor.colorStockName); canvas.translate(0, DY); canvas.drawText(Utils.getAmountFormat(jo.getInt("cjsl"), false), x, y, paint); paint.setColor(GlobalColor.colorpriceUp); canvas.translate(0, DY); canvas.drawText(Utils.getAmountFormat(jo.getDouble("wp"), false), x, y, paint); paint.setColor(GlobalColor.colorStockName); canvas.translate(0, DY); canvas.drawText(Utils.getAmountFormat(jo.getInt("msgs"), true), x, y, paint); canvas.translate(0, -DY * 5); paint.setTextAlign(Paint.Align.LEFT); paint.setColor(GlobalColor.colorLabelName); canvas.drawText("", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("?", x + tips, y, paint); // canvas.drawText("?", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("", x + tips, y, paint); canvas.translate(0, DY); canvas.drawText("", x + tips, y, paint); canvas.translate(width / 2, -DY * 5); paint.setTextAlign(Paint.Align.RIGHT); double jrkp = jo.getDouble("jrkp"); setColor(paint, jrkp, zrsp); canvas.drawText(Utils.dataFormation(jrkp, stockdigit, jo.getInt("tp")), x - tips, y, paint); canvas.translate(0, DY); double zg = jo.getDouble("zgcj"); setColor(paint, zg, zrsp); canvas.drawText(Utils.dataFormation(zg, stockdigit, jo.getInt("tp")), x - tips, y, paint); canvas.translate(0, DY); double zd = jo.getDouble("zdcj"); setColor(paint, zd, zrsp); canvas.drawText(Utils.dataFormation(zd, stockdigit, jo.getInt("tp")), x - tips, y, paint); paint.setColor(GlobalColor.colorStockName); // canvas.translate(0, DY); // canvas.drawText(Utils.dataFormation(jo.getDouble("lb"), 1), x - tips, y, paint); canvas.translate(0, DY); canvas.drawText(Utils.getAmountFormat(jo.getDouble("cjje"), false), x - tips, y, paint); paint.setColor(GlobalColor.colorPriceDown); canvas.translate(0, DY); canvas.drawText(Utils.getAmountFormat(jo.getDouble("np"), false), x - tips, y, paint); } catch (JSONException e) { Log.e(TAG, e.toString()); } } }
From source file:com.anysoftkeyboard.keyboards.views.AnyKeyboardViewBase.java
protected boolean setValueFromTheme(TypedArray remoteTypedArray, final int[] padding, final int localAttrId, final int remoteTypedArrayIndex) { try {/* ww w .j a va 2 s.co m*/ switch (localAttrId) { case android.R.attr.background: Drawable keyboardBackground = remoteTypedArray.getDrawable(remoteTypedArrayIndex); if (keyboardBackground == null) return false; CompatUtils.setViewBackgroundDrawable(this, keyboardBackground); break; case android.R.attr.paddingLeft: padding[0] = remoteTypedArray.getDimensionPixelSize(remoteTypedArrayIndex, -1); if (padding[0] == -1) return false; break; case android.R.attr.paddingTop: padding[1] = remoteTypedArray.getDimensionPixelSize(remoteTypedArrayIndex, -1); if (padding[1] == -1) return false; break; case android.R.attr.paddingRight: padding[2] = remoteTypedArray.getDimensionPixelSize(remoteTypedArrayIndex, -1); if (padding[2] == -1) return false; break; case android.R.attr.paddingBottom: padding[3] = remoteTypedArray.getDimensionPixelSize(remoteTypedArrayIndex, -1); if (padding[3] == -1) return false; break; case R.attr.keyBackground: mKeyBackground = remoteTypedArray.getDrawable(remoteTypedArrayIndex); if (mKeyBackground == null) return false; break; case R.attr.keyHysteresisDistance: mKeyHysteresisDistance = remoteTypedArray.getDimensionPixelOffset(remoteTypedArrayIndex, -1); if (mKeyHysteresisDistance == -1) return false; break; case R.attr.verticalCorrection: mOriginalVerticalCorrection = mVerticalCorrection = remoteTypedArray .getDimensionPixelOffset(remoteTypedArrayIndex, -1); if (mOriginalVerticalCorrection == -1) return false; break; case R.attr.keyTextSize: mKeyTextSize = remoteTypedArray.getDimensionPixelSize(remoteTypedArrayIndex, -1); if (mKeyTextSize == -1) return false; // you might ask yourself "why did Menny sqrt root the factor?" // I'll tell you; the factor is mostly for the height, not the // font size, // but I also factorize the font size because I want the text to // be a little like // the key size. // the whole factor maybe too much, so I ease that a bit. if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) mKeyTextSize = (float) (mKeyTextSize * Math.sqrt(AnyApplication.getConfig().getKeysHeightFactorInLandscape())); else mKeyTextSize = (float) (mKeyTextSize * Math.sqrt(AnyApplication.getConfig().getKeysHeightFactorInPortrait())); Logger.d(TAG, "AnySoftKeyboardTheme_keyTextSize " + mKeyTextSize); break; case R.attr.keyTextColor: mKeyTextColor = remoteTypedArray.getColorStateList(remoteTypedArrayIndex); if (mKeyTextColor == null) { mKeyTextColor = new ColorStateList(new int[][] { { 0 } }, new int[] { remoteTypedArray.getColor(remoteTypedArrayIndex, 0xFF000000) }); } break; case R.attr.labelTextSize: mLabelTextSize = remoteTypedArray.getDimensionPixelSize(remoteTypedArrayIndex, -1); if (mLabelTextSize == -1) return false; if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) mLabelTextSize = mLabelTextSize * AnyApplication.getConfig().getKeysHeightFactorInLandscape(); else mLabelTextSize = mLabelTextSize * AnyApplication.getConfig().getKeysHeightFactorInPortrait(); break; case R.attr.keyboardNameTextSize: mKeyboardNameTextSize = remoteTypedArray.getDimensionPixelSize(remoteTypedArrayIndex, -1); if (mKeyboardNameTextSize == -1) return false; if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) mKeyboardNameTextSize = mKeyboardNameTextSize * AnyApplication.getConfig().getKeysHeightFactorInLandscape(); else mKeyboardNameTextSize = mKeyboardNameTextSize * AnyApplication.getConfig().getKeysHeightFactorInPortrait(); break; case R.attr.keyboardNameTextColor: mKeyboardNameTextColor = remoteTypedArray.getColor(remoteTypedArrayIndex, Color.WHITE); break; case R.attr.shadowColor: mShadowColor = remoteTypedArray.getColor(remoteTypedArrayIndex, 0); break; case R.attr.shadowRadius: mShadowRadius = remoteTypedArray.getDimensionPixelOffset(remoteTypedArrayIndex, 0); break; case R.attr.shadowOffsetX: mShadowOffsetX = remoteTypedArray.getDimensionPixelOffset(remoteTypedArrayIndex, 0); break; case R.attr.shadowOffsetY: mShadowOffsetY = remoteTypedArray.getDimensionPixelOffset(remoteTypedArrayIndex, 0); break; case R.attr.backgroundDimAmount: mBackgroundDimAmount = remoteTypedArray.getFloat(remoteTypedArrayIndex, -1f); if (mBackgroundDimAmount == -1f) return false; break; case R.attr.keyPreviewBackground: Drawable keyPreviewBackground = remoteTypedArray.getDrawable(remoteTypedArrayIndex); if (keyPreviewBackground == null) return false; mPreviewPopupTheme.setPreviewKeyBackground(keyPreviewBackground); break; case R.attr.keyPreviewTextColor: mPreviewPopupTheme.setPreviewKeyTextColor(remoteTypedArray.getColor(remoteTypedArrayIndex, 0xFFF)); break; case R.attr.keyPreviewTextSize: mPreviewPopupTheme .setPreviewKeyTextSize(remoteTypedArray.getDimensionPixelSize(remoteTypedArrayIndex, 0)); break; case R.attr.keyPreviewLabelTextSize: mPreviewPopupTheme .setPreviewLabelTextSize(remoteTypedArray.getDimensionPixelSize(remoteTypedArrayIndex, 0)); break; case R.attr.keyPreviewOffset: mPreviewPopupTheme .setVerticalOffset(remoteTypedArray.getDimensionPixelOffset(remoteTypedArrayIndex, 0)); break; case R.attr.previewAnimationType: int previewAnimationType = remoteTypedArray.getInteger(remoteTypedArrayIndex, -1); if (previewAnimationType == -1) return false; mPreviewPopupTheme.setPreviewAnimationType(previewAnimationType); break; case R.attr.keyTextStyle: int textStyle = remoteTypedArray.getInt(remoteTypedArrayIndex, 0); switch (textStyle) { case 0: mKeyTextStyle = Typeface.DEFAULT; break; case 1: mKeyTextStyle = Typeface.DEFAULT_BOLD; break; case 2: mKeyTextStyle = Typeface.defaultFromStyle(Typeface.ITALIC); break; default: mKeyTextStyle = Typeface.defaultFromStyle(textStyle); break; } mPreviewPopupTheme.setKeyStyle(mKeyTextStyle); break; case R.attr.keyHorizontalGap: float themeHorizontalKeyGap = remoteTypedArray.getDimensionPixelOffset(remoteTypedArrayIndex, -1); if (themeHorizontalKeyGap == -1) return false; mKeyboardDimens.setHorizontalKeyGap(themeHorizontalKeyGap); break; case R.attr.keyVerticalGap: float themeVerticalRowGap = remoteTypedArray.getDimensionPixelOffset(remoteTypedArrayIndex, -1); if (themeVerticalRowGap == -1) return false; mKeyboardDimens.setVerticalRowGap(themeVerticalRowGap); break; case R.attr.keyNormalHeight: int themeNormalKeyHeight = remoteTypedArray.getDimensionPixelOffset(remoteTypedArrayIndex, -1); if (themeNormalKeyHeight == -1) return false; mKeyboardDimens.setNormalKeyHeight(themeNormalKeyHeight); break; case R.attr.keyLargeHeight: int themeLargeKeyHeight = remoteTypedArray.getDimensionPixelOffset(remoteTypedArrayIndex, -1); if (themeLargeKeyHeight == -1) return false; mKeyboardDimens.setLargeKeyHeight(themeLargeKeyHeight); break; case R.attr.keySmallHeight: int themeSmallKeyHeight = remoteTypedArray.getDimensionPixelOffset(remoteTypedArrayIndex, -1); if (themeSmallKeyHeight == -1) return false; mKeyboardDimens.setSmallKeyHeight(themeSmallKeyHeight); break; case R.attr.hintTextSize: mHintTextSize = remoteTypedArray.getDimensionPixelSize(remoteTypedArrayIndex, -1); if (mHintTextSize == -1) return false; if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) mHintTextSize = mHintTextSize * AnyApplication.getConfig().getKeysHeightFactorInLandscape(); else mHintTextSize = mHintTextSize * AnyApplication.getConfig().getKeysHeightFactorInPortrait(); break; case R.attr.hintTextColor: mHintTextColor = remoteTypedArray.getColorStateList(remoteTypedArrayIndex); if (mHintTextColor == null) { mHintTextColor = new ColorStateList(new int[][] { { 0 } }, new int[] { remoteTypedArray.getColor(remoteTypedArrayIndex, 0xFF000000) }); } break; case R.attr.hintLabelVAlign: mHintLabelVAlign = remoteTypedArray.getInt(remoteTypedArrayIndex, Gravity.BOTTOM); break; case R.attr.hintLabelAlign: mHintLabelAlign = remoteTypedArray.getInt(remoteTypedArrayIndex, Gravity.RIGHT); break; case R.attr.hintOverflowLabel: mHintOverflowLabel = remoteTypedArray.getString(remoteTypedArrayIndex); break; } return true; } catch (Exception e) { // on API changes, so the incompatible themes wont crash me.. e.printStackTrace(); return false; } }
From source file:com.cssweb.android.view.KlineView.java
public void drawQuoteWin(Canvas canvas, JSONObject quoteData, int idx) throws JSONException { Paint mPaint = new Paint(); mPaint.setTextAlign(Paint.Align.LEFT); mPaint.setStyle(Paint.Style.STROKE); mPaint.setTypeface(Typeface.DEFAULT_BOLD); mPaint.setAntiAlias(true);/*w w w.j ava 2 s . co m*/ mPaint.setColor(GlobalColor.colorKlinePopub); mPaint.setTextSize(sTextSize); canvas.drawText(":", 0, axisLabelHeight, mPaint); canvas.drawText(":", 0, axisLabelHeight * 3, mPaint); canvas.drawText(":", 0, axisLabelHeight * 5, mPaint); canvas.drawText(":", 0, axisLabelHeight * 7, mPaint); canvas.drawText(":", 0, axisLabelHeight * 9, mPaint); canvas.drawText(":", 0, axisLabelHeight * 11, mPaint); canvas.drawText("??:", 0, axisLabelHeight * 13, mPaint); canvas.drawText("??:", 0, axisLabelHeight * 15, mPaint); mPaint.setTextAlign(Paint.Align.RIGHT); String qt = quoteData.getJSONArray("K").getJSONArray(idx).getString(0); double jrkp = quoteData.getJSONArray("K").getJSONArray(idx).getDouble(1); double zg = quoteData.getJSONArray("K").getJSONArray(idx).getDouble(2); double zd = quoteData.getJSONArray("K").getJSONArray(idx).getDouble(3); double sp = quoteData.getJSONArray("K").getJSONArray(idx).getDouble(4); double preclose; if ("cf".equals(exchange) || "dc".equals(exchange) || "sf".equals(exchange) || "cz".equals(exchange)) { switch (idx) { case 0: preclose = quoteData.getJSONArray("K").getJSONArray(idx).getDouble(7); break; default: preclose = quoteData.getJSONArray("K").getJSONArray(idx - 1).getDouble(7); break; } if (quoteData.getJSONArray("K").length() == 1) { preclose = quoteData.getJSONArray("K").getJSONArray(0).getDouble(7); } } else { switch (idx) { case 0: preclose = quoteData.getJSONArray("K").getJSONArray(idx).getDouble(4); break; default: preclose = quoteData.getJSONArray("K").getJSONArray(idx - 1).getDouble(4); break; } if (quoteData.getJSONArray("K").length() == 1) { preclose = quoteData.getDouble("zrsp");//quoteData.getJSONArray("K").getJSONArray(0).getDouble(4); } } mPaint.setColor(getcolor(jrkp, preclose)); canvas.drawText(Utils.dataFormation(jrkp, stockdigit), klineX, axisLabelHeight * 2, mPaint); mPaint.setColor(getcolor(zg, preclose)); canvas.drawText(Utils.dataFormation(zg, stockdigit), klineX, axisLabelHeight * 4, mPaint); mPaint.setColor(getcolor(zd, preclose)); canvas.drawText(Utils.dataFormation(zd, stockdigit), klineX, axisLabelHeight * 6, mPaint); mPaint.setColor(getcolor(sp, preclose)); canvas.drawText(Utils.dataFormation(sp, stockdigit), klineX, axisLabelHeight * 8, mPaint); double zhangdie = sp - preclose; if (zhangdie > 0) mPaint.setColor(GlobalColor.colorpriceUp); else if (zhangdie < 0) mPaint.setColor(GlobalColor.colorPriceDown); else mPaint.setColor(GlobalColor.colorPriceEqual); canvas.drawText(Utils.dataFormation(zhangdie, stockdigit), klineX, axisLabelHeight * 10, mPaint); // if(quoteData.getString("period").equals("min5") || // quoteData.getString("period").equals("min15") || // quoteData.getString("period").equals("min30") || // quoteData.getString("period").equals("min60")){ // qt = qt.substring(4,6)+'/'+qt.substring(6,8)+' '+qt.substring(8); // }else{ // qt = qt.substring(2,4)+qt.substring(4,6)+qt.substring(6,8); // } qt = qt.substring(2, 4) + qt.substring(4, 6) + qt.substring(6, 8); mPaint.setColor(GlobalColor.colorLabelName); canvas.drawText(qt, klineX, axisLabelHeight * 12, mPaint); mPaint.setColor(GlobalColor.colorStockName); canvas.drawText(Utils.getAmountFormat(quoteData.getJSONArray("K").getJSONArray(idx).getDouble(5), false), klineX, axisLabelHeight * 14, mPaint); mPaint.setColor(GlobalColor.colorStockName); canvas.drawText(Utils.getAmountFormat(quoteData.getJSONArray("K").getJSONArray(idx).getDouble(6), false), klineX, axisLabelHeight * 16, mPaint); }
From source file:usbong.android.retrocc.UsbongDecisionTreeEngineActivity.java
public void initTreeLoader() { setContentView(R.layout.tree_list_interface); isInTreeLoader = true;/* w w w. j a va 2 s . co m*/ Button comicsButton = (Button) findViewById(R.id.comics_button); comicsButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { initTreeLoader(UsbongConstants.ITEMS_LIST_COMICS); } }); Button toysButton = (Button) findViewById(R.id.toys_button); toysButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { initTreeLoader(UsbongConstants.ITEMS_LIST_TOYS); } }); if (currCategory == UsbongConstants.ITEMS_LIST_COMICS) { comicsButton.setTypeface(Typeface.DEFAULT_BOLD); toysButton.setTypeface(Typeface.DEFAULT); } else { comicsButton.setTypeface(Typeface.DEFAULT); toysButton.setTypeface(Typeface.DEFAULT_BOLD); } resetContainers();//added by Mike, 20170213 // listOfTreesArrayList = UsbongUtils.getTreeArrayList(UsbongUtils.USBONG_TREES_FILE_PATH); listOfTreesArrayList = UsbongUtils .getItemArrayList(UsbongUtils.USBONG_TREES_FILE_PATH + currCategory + ".txt"); mCustomAdapter = new CustomDataAdapter(this, R.layout.tree_loader, listOfTreesArrayList); mCustomAdapter.sort(); //edited by Mike, 20170203 /* //Reference: http://stackoverflow.com/questions/8908549/sorting-of-listview-by-name-of-the-product-using-custom-adaptor; //last accessed: 2 Jan. 2014; answer by Alex Lockwood mCustomAdapter.sort(new Comparator<String>() { public int compare(String arg0, String arg1) { return arg0.compareTo(arg1); } }); */ treesListView = (ListView) findViewById(R.id.tree_list_view); treesListView.setLongClickable(true); treesListView.setAdapter(mCustomAdapter); String pleaseMakeSureThatXMLTreeExistsString = (String) getResources() .getText(R.string.pleaseMakeSureThatXMLTreeExistsString); String alertString = (String) getResources().getText(R.string.alertStringValueEnglish); if (listOfTreesArrayList.isEmpty()) { new AlertDialog.Builder(UsbongDecisionTreeEngineActivity.this).setTitle(alertString) .setMessage(pleaseMakeSureThatXMLTreeExistsString) .setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //UsbongDecisionTreeEngineActivity is already the Main Menu /* finish(); Intent toUsbongMainActivityIntent = new Intent(UsbongDecisionTreeEngineActivity.this, UsbongMainActivity.class); toUsbongMainActivityIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(toUsbongMainActivityIntent); */ } }).show(); } }