File tree Expand file tree Collapse file tree
lib/java/com/google/android/material/focus Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5454import com .google .android .material .shape .ShapeAppearance ;
5555import com .google .android .material .shape .ShapeAppearanceModel ;
5656import com .google .android .material .shape .ShapeAppearancePathProvider ;
57+ import com .google .android .material .shape .StateListShapeAppearanceModel ;
5758import com .google .errorprone .annotations .CanIgnoreReturnValue ;
5859import java .io .IOException ;
5960import java .lang .ref .WeakReference ;
@@ -910,9 +911,17 @@ private static final class FocusRingState extends ConstantState {
910911 this .ringInsetAttr = orig .ringInsetAttr ;
911912 this .ringInnerInset = orig .ringInnerInset ;
912913 this .ringInnerInsetAttr = orig .ringInnerInsetAttr ;
913- this .ringShapeAppearance = orig .ringShapeAppearance ;
914914 this .ringShapeAppearanceResId = orig .ringShapeAppearanceResId ;
915915 this .ringShapeAppearanceAttr = orig .ringShapeAppearanceAttr ;
916+ if (orig .ringShapeAppearance instanceof ShapeAppearanceModel ) {
917+ this .ringShapeAppearance =
918+ ((ShapeAppearanceModel ) orig .ringShapeAppearance ).toBuilder ().build ();
919+ } else if (orig .ringShapeAppearance instanceof StateListShapeAppearanceModel ) {
920+ this .ringShapeAppearance =
921+ ((StateListShapeAppearanceModel ) orig .ringShapeAppearance ).toBuilder ().build ();
922+ } else {
923+ this .ringShapeAppearance = orig .ringShapeAppearance ;
924+ }
916925 if (orig .ringCustomBounds != null ) {
917926 this .ringCustomBounds = new Rect (orig .ringCustomBounds );
918927 }
You can’t perform that action at this time.
0 commit comments