public AnimatedHoldButton(Context context, AttributeSet attrs) { super(context, attrs); CLICK_HOLD_TIME = ViewUtils.getLongClickTimeout(context); mPrimaryText = ""; mNormalDrawable = getBackground(); TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.AnimatedHoldButton, 0, 0); try { mPrimaryText = ta.getString(R.styleable.AnimatedHoldButton_primary_text); mPressedColor = ta.getColor(R.styleable.AnimatedHoldButton_pressed_color, ContextCompat.getColor(context, R.color.op_button_pressed)); } finally { ta.recycle(); } //this is needed for so paint knows what to measure in layoutText setText(mPrimaryText); }
private final int BACKSPACE_REPEAT = ViewUtils.getLongClickTimeout(mAppContext); private Handler mColorHoldHandler; private View mView;