public void initialize(Context context, int amOrPm) { if (mIsInitialized) { Log.e(TAG, "AmPmCirclesView may only be initialized once."); return; } Resources res = context.getResources(); mUnselectedColor = res.getColor(R.color.white); mSelectedColor = res.getColor(R.color.blue); mAmPmTextColor = res.getColor(R.color.ampm_text_color); mSelectedAlpha = SELECTED_ALPHA; String typefaceFamily = res.getString(R.string.sans_serif); Typeface tf = Typeface.create(typefaceFamily, Typeface.NORMAL); mPaint.setTypeface(tf); mPaint.setAntiAlias(true); mPaint.setTextAlign(Align.CENTER); mCircleRadiusMultiplier = Float.parseFloat(res.getString(R.string.circle_radius_multiplier)); mAmPmCircleRadiusMultiplier = Float.parseFloat(res.getString(R.string.ampm_circle_radius_multiplier)); String[] amPmTexts = new DateFormatSymbols().getAmPmStrings(); mAmText = amPmTexts[0]; mPmText = amPmTexts[1]; setAmOrPm(amOrPm); mAmOrPmPressed = -1; mIsInitialized = true; }
mAmPmCirclesView.setAmOrPm(isTouchingAmOrPm); if (getIsCurrentlyAmOrPm() != isTouchingAmOrPm) { mListener.onValueSelected(AMPM_INDEX, mIsTouchingAmOrPm, false);
mAmPmCirclesView.setAmOrPm(isTouchingAmOrPm); if (getIsCurrentlyAmOrPm() != isTouchingAmOrPm) { mListener.onValueSelected(AMPM_INDEX, mIsTouchingAmOrPm, false);
/** * Set the internal value as either AM or PM, and update the AM/PM circle displays. * @param amOrPm */ public void setAmOrPm(int amOrPm) { mAmPmCirclesView.setAmOrPm(amOrPm); mAmPmCirclesView.invalidate(); setValueForItem(AMPM_INDEX, amOrPm); }
public void initialize(Context context, int amOrPm) { if (mIsInitialized) { Log.e(TAG, "AmPmCirclesView may only be initialized once."); return; } Resources res = context.getResources(); mUnselectedColor = res.getColor(android.R.color.white); mSelectedColor = res.getColor(R.color.blue); mAmPmTextColor = res.getColor(R.color.ampm_text_color); mSelectedAlpha = SELECTED_ALPHA; String typefaceFamily = res.getString(R.string.sans_serif); Typeface tf = Typeface.create(typefaceFamily, Typeface.NORMAL); mPaint.setTypeface(tf); mPaint.setAntiAlias(true); mPaint.setTextAlign(Align.CENTER); mCircleRadiusMultiplier = Float.parseFloat(res.getString(R.string.circle_radius_multiplier)); mAmPmCircleRadiusMultiplier = Float.parseFloat(res.getString(R.string.ampm_circle_radius_multiplier)); String[] amPmTexts = new DateFormatSymbols().getAmPmStrings(); mAmText = amPmTexts[0]; mPmText = amPmTexts[1]; setAmOrPm(amOrPm); mAmOrPmPressed = -1; mIsInitialized = true; }
/** * Set the internal value as either AM or PM, and update the AM/PM circle displays. * @param amOrPm */ public void setAmOrPm(int amOrPm) { mAmPmCirclesView.setAmOrPm(amOrPm); mAmPmCirclesView.invalidate(); setValueForItem(AMPM_INDEX, amOrPm); }