@@ -217,26 +217,28 @@ public void onAnimationUpdate(ValueAnimator animation) {
217217 }
218218
219219 private void startFwdAnim () {
220- TranslateAnimation animation = new TranslateAnimation (0 , getMeasuredWidth (), 0 , 0 );
221- animation .setInterpolator (new AccelerateDecelerateInterpolator ());
222- animation .setDuration (1000 );
223- animation .setAnimationListener (new Animation .AnimationListener () {
224- @ Override
225- public void onAnimationStart (Animation animation ) {
220+ if (isEnabled ()) {
221+ TranslateAnimation animation = new TranslateAnimation (0 , getMeasuredWidth (), 0 , 0 );
222+ animation .setInterpolator (new AccelerateDecelerateInterpolator ());
223+ animation .setDuration (1000 );
224+ animation .setAnimationListener (new Animation .AnimationListener () {
225+ @ Override
226+ public void onAnimationStart (Animation animation ) {
226227
227- }
228+ }
228229
229- @ Override
230- public void onAnimationEnd (Animation animation ) {
231- startHintInitAnim ();
232- }
230+ @ Override
231+ public void onAnimationEnd (Animation animation ) {
232+ startHintInitAnim ();
233+ }
233234
234- @ Override
235- public void onAnimationRepeat (Animation animation ) {
235+ @ Override
236+ public void onAnimationRepeat (Animation animation ) {
236237
237- }
238- });
239- arrowHintContainer .startAnimation (animation );
238+ }
239+ });
240+ arrowHintContainer .startAnimation (animation );
241+ }
240242 }
241243
242244 /**
@@ -336,6 +338,19 @@ public void updateBackground() {
336338 }
337339 }
338340
341+ @ Override
342+ public void setEnabled (boolean enabled ) {
343+ super .setEnabled (enabled );
344+ if (!enabled ) {
345+ gradientDrawable .setColor (ContextCompat .getColor (context , R .color .proswipebtn_disabled_grey ));
346+ updateBackground ();
347+ this .setAlpha (0.5f );
348+ } else {
349+ setBackgroundColor (getBackgroundColor ());
350+ this .setAlpha (1f );
351+ }
352+ }
353+
339354 private void showProgressBar () {
340355 progressBar = new ProgressBar (context );
341356 progressBar .getIndeterminateDrawable ().setColorFilter (ContextCompat .getColor (context , android .R .color .white ), android .graphics .PorterDuff .Mode .SRC_IN );
0 commit comments