/** ** View.OnClickListener Implementation *** */ @Override public void onClick(final View v) { final TaskView tv = this; final boolean delayViewClick = (v != this) && (v != mActionButtonView); if (delayViewClick) { // We purposely post the handler delayed to allow for the touch feedback to draw postDelayed( new Runnable() { @Override public void run() { if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) { if (mCb != null) { mCb.onTaskViewAppIconClicked(tv); } } else if (v == mHeaderView.mDismissButton) { dismissTask(); } } }, 125); } else { if (v == mActionButtonView) { // Reset the translation of the action button before we animate it out mActionButtonView.setTranslationZ(0f); } if (mCb != null) { mCb.onTaskViewClicked(tv, tv.getTask(), (v == mActionButtonView)); } } }
/** Resets this view's properties */ void resetViewProperties() { setDim(0); setLayerType(View.LAYER_TYPE_NONE, null); TaskViewTransform.reset(this); if (mActionButtonView != null) { mActionButtonView.setScaleX(1f); mActionButtonView.setScaleY(1f); mActionButtonView.setAlpha(1f); mActionButtonView.setTranslationZ(mActionButtonTranslationZ); } }