content: package com.google.android.material.floatingactionbutton;
  
  import android.animation.Animator;
  import android.animation.AnimatorSet;
  import android.animation.ObjectAnimator;
  import android.animation.StateListAnimator;
  import android.content.Context;
  import android.content.res.ColorStateList;
  import android.graphics.PorterDuff;
  import android.graphics.Rect;
  import android.graphics.drawable.Drawable;
  import android.graphics.drawable.LayerDrawable;
  import android.graphics.drawable.RippleDrawable;
  import android.os.Build;
  import android.view.View;
  import androidx.core.content.ContextCompat;
  import androidx.core.util.Preconditions;
  import com.google.android.material.R;
  import com.google.android.material.ripple.RippleUtils;
  import com.google.android.material.shadow.ShadowViewDelegate;
  import com.google.android.material.shape.MaterialShapeDrawable;
  import com.google.android.material.shape.ShapeAppearanceModel;
  import java.util.ArrayList;
  
  class FloatingActionButtonImplLollipop extends FloatingActionButtonImpl {
  
      static class AlwaysStatefulMaterialShapeDrawable extends MaterialShapeDrawable {
          AlwaysStatefulMaterialShapeDrawable(ShapeAppearanceModel shapeAppearanceModel) {
              super(shapeAppearanceModel);
          }
  
          public boolean isStateful() {
              return true;
          }
      }
  
      FloatingActionButtonImplLollipop(FloatingActionButton view, ShadowViewDelegate shadowViewDelegate) {
          super(view, shadowViewDelegate);
      }
  
      private Animator createElevationAnimator(float elevation, float translationZ) {
          AnimatorSet animatorSet = new AnimatorSet();
          animatorSet.play(ObjectAnimator.ofFloat(this.view, "elevation", new float[]{elevation}).setDuration(0)).with(ObjectAnimator.ofFloat(this.view, View.TRANSLATION_Z, new float[]{translationZ}).setDuration(100));
          animatorSet.setInterpolator(ELEVATION_ANIM_INTERPOLATOR);
          return animatorSet;
      }
  
      /* access modifiers changed from: package-private */
      public BorderDrawable createBorderDrawable(int borderWidth, ColorStateList backgroundTint) {
          Context context = this.view.getContext();
          BorderDrawable borderDrawable = new BorderDrawable((ShapeAppearanceModel) Preconditions.checkNotNull(this.shapeAppearance));
          borderDrawable.setGradientColors(ContextCompat.getColor(context, R.color.design_fab_stroke_top_outer_color), ContextCompat.getColor(context, R.color.design_fab_stroke_top_inner_color), ContextCompat.getColor(context, R.color.design_fab_stroke_end_inner_color), ContextCompat.getColor(context, R.color.design_fab_stroke_end_outer_color));
          borderDrawable.setBorderWidth((float) borderWidth);
          borderDrawable.setBorderTint(backgroundTint);
          return borderDrawable;
      }
  
      /* access modifiers changed from: package-private */
      public MaterialShapeDrawable createShapeDrawable() {
          return new AlwaysStatefulMaterialShapeDrawable((ShapeAppearanceModel) Preconditions.checkNotNull(this.shapeAppearance));
      }
  
      public float getElevation() {
          return this.view.getElevation();
      }
  
      /* access modifiers changed from: package-private */
      public void getPadding(Rect rect) {
          if (this.shadowViewDelegate.isCompatPaddingEnabled()) {
              super.getPadding(rect);
          } else if (!shouldExpandBoundsForA11y()) {
              int sizeDimension = (this.minTouchTargetSize - this.view.getSizeDimension()) / 2;
              rect.set(sizeDimension, sizeDimension, sizeDimension, sizeDimension);
          } else {
              rect.set(0, 0, 0, 0);
          }
      }
  
      /* access modifiers changed from: package-private */
      public void initializeBackgroundDrawable(ColorStateList backgroundTint, PorterDuff.Mode backgroundTintMode, ColorStateList rippleColor, int borderWidth) {
          Drawable drawable;
          this.shapeDrawable = createShapeDrawable();
          this.shapeDrawable.setTintList(backgroundTint);
          if (backgroundTintMode != null) {
              this.shapeDrawable.setTintMode(backgroundTintMode);
          }
          this.shapeDrawable.initializeElevationOverlay(this.view.getContext());
          if (borderWidth > 0) {
              this.borderDrawable = createBorderDrawable(borderWidth, backgroundTint);
              drawable = new LayerDrawable(new Drawable[]{(Drawable) Preconditions.checkNotNull(this.borderDrawable), (Drawable) Preconditions.checkNotNull(this.shapeDrawable)});
          } else {
              this.borderDrawable = null;
              drawable = this.shapeDrawable;
          }
          this.rippleDrawable = new RippleDrawable(RippleUtils.sanitizeRippleDrawableColor(rippleColor), drawable, (Drawable) null);
          this.contentBackground = this.rippleDrawable;
      }
  
      /* access modifiers changed from: package-private */
      public void jumpDrawableToCurrentState() {
      }
  
      /* access modifiers changed from: package-private */
      public void onCompatShadowChanged() {
          updatePadding();
      }
  
      /* access modifiers changed from: package-private */
      public void onDrawableStateChanged(int[] state) {
          if (Build.VERSION.SDK_INT != 21) {
              return;
          }
          if (this.view.isEnabled()) {
              this.view.setElevation(this.elevation);
              if (this.view.isPressed()) {
                  this.view.setTranslationZ(this.pressedTranslationZ);
              } else if (this.view.isFocused() || this.view.isHovered()) {
                  this.view.setTranslationZ(this.hoveredFocusedTranslationZ);
              } else {
                  this.view.setTranslationZ(0.0f);
              }
          } else {
              this.view.setElevation(0.0f);
              this.view.setTranslationZ(0.0f);
          }
      }
  
      /* access modifiers changed from: package-private */
      public void onElevationsChanged(float elevation, float hoveredFocusedTranslationZ, float pressedTranslationZ) {
          if (Build.VERSION.SDK_INT == 21) {
              this.view.refreshDrawableState();
          } else {
              StateListAnimator stateListAnimator = new StateListAnimator();
              stateListAnimator.addState(PRESSED_ENABLED_STATE_SET, createElevationAnimator(elevation, pressedTranslationZ));
              stateListAnimator.addState(HOVERED_FOCUSED_ENABLED_STATE_SET, createElevationAnimator(elevation, hoveredFocusedTranslationZ));
              stateListAnimator.addState(FOCUSED_ENABLED_STATE_SET, createElevationAnimator(elevation, hoveredFocusedTranslationZ));
              stateListAnimator.addState(HOVERED_ENABLED_STATE_SET, createElevationAnimator(elevation, hoveredFocusedTranslationZ));
              AnimatorSet animatorSet = new AnimatorSet();
              ArrayList arrayList = new ArrayList();
              arrayList.add(ObjectAnimator.ofFloat(this.view, "elevation", new float[]{elevation}).setDuration(0));
              if (Build.VERSION.SDK_INT >= 22 && Build.VERSION.SDK_INT <= 24) {
                  arrayList.add(ObjectAnimator.ofFloat(this.view, View.TRANSLATION_Z, new float[]{this.view.getTranslationZ()}).setDuration(100));
              }
              arrayList.add(ObjectAnimator.ofFloat(this.view, View.TRANSLATION_Z, new float[]{0.0f}).setDuration(100));
              animatorSet.playSequentially((Animator[]) arrayList.toArray(new Animator[0]));
              animatorSet.setInterpolator(ELEVATION_ANIM_INTERPOLATOR);
              stateListAnimator.addState(ENABLED_STATE_SET, animatorSet);
              stateListAnimator.addState(EMPTY_STATE_SET, createElevationAnimator(0.0f, 0.0f));
              this.view.setStateListAnimator(stateListAnimator);
          }
          if (shouldAddPadding()) {
              updatePadding();
          }
      }
  
      /* access modifiers changed from: package-private */
      public boolean requirePreDrawListener() {
          return false;
      }
  
      /* access modifiers changed from: package-private */
      public void setRippleColor(ColorStateList rippleColor) {
          if (this.rippleDrawable instanceof RippleDrawable) {
              ((RippleDrawable) this.rippleDrawable).setColor(RippleUtils.sanitizeRippleDrawableColor(rippleColor));
          } else {
              super.setRippleColor(rippleColor);
          }
      }
  
      /* access modifiers changed from: package-private */
      public boolean shouldAddPadding() {
          return this.shadowViewDelegate.isCompatPaddingEnabled() || !shouldExpandBoundsForA11y();
      }
  
      /* access modifiers changed from: package-private */
      public void updateFromViewRotation() {
      }
  }
  