public void initialize(Context context, TimePickerController controller, int amOrPm) {
if (this.mIsInitialized) {
Log.e(TAG, "AmPmCirclesView may only be initialized once.");
return;
}
Resources res = context.getResources();
if (controller.isThemeDark()) {
this.mUnselectedColor = res.getColor(R.color.mdtp_circle_background_dark_theme);
this.mAmPmTextColor = res.getColor(R.color.mdtp_white);
this.mSelectedAlpha = 255;
} else {
this.mUnselectedColor = res.getColor(R.color.mdtp_white);
this.mAmPmTextColor = res.getColor(R.color.mdtp_ampm_text_color);
this.mSelectedAlpha = 255;
}
this.mSelectedColor = controller.getAccentColor();
this.mTouchedColor = Utils.darkenColor(this.mSelectedColor);
this.mAmPmSelectedTextColor = res.getColor(R.color.mdtp_white);
this.mPaint.setTypeface(Typeface.create(res.getString(R.string.mdtp_sans_serif), 0));
this.mPaint.setAntiAlias(true);
this.mPaint.setTextAlign(Align.CENTER);
this.mCircleRadiusMultiplier = Float.parseFloat(res.getString(R.string
.mdtp_circle_radius_multiplier));
this.mAmPmCircleRadiusMultiplier = Float.parseFloat(res.getString(R.string
.mdtp_ampm_circle_radius_multiplier));
String[] amPmTexts = new DateFormatSymbols().getAmPmStrings();
this.mAmText = amPmTexts[0];
this.mPmText = amPmTexts[1];
setAmOrPm(amOrPm);
this.mAmOrPmPressed = -1;
this.mIsInitialized = true;
}
AmPmCirclesView.java 文件源码
java
阅读 55
收藏 0
点赞 0
评论 0
项目:boohee_v5.6
作者:
评论列表
文章目录