@Override public void run() { mAmPmCirclesView.setAmOrPmPressed(mIsTouchingAmOrPm); mAmPmCirclesView.invalidate(); } }, TAP_TIMEOUT);
/** * 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); }
mIsTouchingAmOrPm = mAmPmCirclesView.getIsTouchingAmOrPm(eventX, eventY); } else { mIsTouchingAmOrPm = -1; int isTouchingAmOrPm = mAmPmCirclesView.getIsTouchingAmOrPm(eventX, eventY); if (isTouchingAmOrPm != mIsTouchingAmOrPm) { mAmPmCirclesView.setAmOrPmPressed(-1); mAmPmCirclesView.invalidate(); mIsTouchingAmOrPm = -1; int isTouchingAmOrPm = mAmPmCirclesView.getIsTouchingAmOrPm(eventX, eventY); mAmPmCirclesView.setAmOrPmPressed(-1); mAmPmCirclesView.invalidate(); mAmPmCirclesView.setAmOrPm(isTouchingAmOrPm); if (getIsCurrentlyAmOrPm() != isTouchingAmOrPm) { mListener.onValueSelected(AMPM_INDEX, mIsTouchingAmOrPm, false);
mCircleView.invalidate(); if (!mHideAmPm) { mAmPmCirclesView.initialize(context, initialHoursOfDay < 12? AM : PM); mAmPmCirclesView.invalidate();
/* package */ void setTheme(Context context, boolean themeDark) { mCircleView.setTheme(context, themeDark); mAmPmCirclesView.setTheme(context, themeDark); mHourRadialTextsView.setTheme(context, themeDark); mMinuteRadialTextsView.setTheme(context, themeDark); mHourRadialSelectorView.setTheme(context, themeDark); mMinuteRadialSelectorView.setTheme(context, themeDark); }
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; }
addView(mCircleView); mAmPmCirclesView = new AmPmCirclesView(context); addView(mAmPmCirclesView);
mIsTouchingAmOrPm = mAmPmCirclesView.getIsTouchingAmOrPm(eventX, eventY); } else { mIsTouchingAmOrPm = -1; int isTouchingAmOrPm = mAmPmCirclesView.getIsTouchingAmOrPm(eventX, eventY); if (isTouchingAmOrPm != mIsTouchingAmOrPm) { mAmPmCirclesView.setAmOrPmPressed(-1); mAmPmCirclesView.invalidate(); mIsTouchingAmOrPm = -1; int isTouchingAmOrPm = mAmPmCirclesView.getIsTouchingAmOrPm(eventX, eventY); mAmPmCirclesView.setAmOrPmPressed(-1); mAmPmCirclesView.invalidate(); mAmPmCirclesView.setAmOrPm(isTouchingAmOrPm); if (getIsCurrentlyAmOrPm() != isTouchingAmOrPm) { mListener.onValueSelected(AMPM_INDEX, mIsTouchingAmOrPm, false);
mCircleView.invalidate(); if (!mHideAmPm) { mAmPmCirclesView.initialize(context, initialHoursOfDay < 12? AM : PM); mAmPmCirclesView.invalidate();
/* package */ void setTheme(Context context, boolean themeDark) { mCircleView.setTheme(context, themeDark); mAmPmCirclesView.setTheme(context, themeDark); mHourRadialTextsView.setTheme(context, themeDark); mMinuteRadialTextsView.setTheme(context, themeDark); mHourRadialSelectorView.setTheme(context, themeDark); mMinuteRadialSelectorView.setTheme(context, themeDark); }
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; }
addView(mCircleView); mAmPmCirclesView = new AmPmCirclesView(context); addView(mAmPmCirclesView);
@Override public void run() { mAmPmCirclesView.setAmOrPmPressed(mIsTouchingAmOrPm); mAmPmCirclesView.invalidate(); } }, TAP_TIMEOUT);
/** * 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); }