Skip to content

Commit 9db041c

Browse files
imhappileticiarossi
authored andcommitted
[ExtendedFloatingActionButton] Update extend/shrink motion spec
PiperOrigin-RevId: 468201647
1 parent 16edbb9 commit 9db041c

File tree

3 files changed

+90
-0
lines changed

3 files changed

+90
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2022 The Android Open Source Project
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<set xmlns:android="http://schemas.android.com/apk/res/android">
19+
<objectAnimator
20+
android:propertyName="width"
21+
android:startOffset="0"
22+
android:duration="?attr/motionDurationLong2"
23+
android:interpolator="@interpolator/mtrl_fast_out_slow_in"/>
24+
<objectAnimator
25+
android:propertyName="height"
26+
android:startOffset="0"
27+
android:duration="?attr/motionDurationLong2"
28+
android:interpolator="?attr/motionEasingEmphasizedAccelerateInterpolator"/>
29+
<objectAnimator
30+
android:propertyName="paddingStart"
31+
android:startOffset="0"
32+
android:duration="?attr/motionDurationLong2"
33+
android:interpolator="?attr/motionEasingEmphasizedAccelerateInterpolator"/>
34+
<objectAnimator
35+
android:propertyName="paddingEnd"
36+
android:startOffset="0"
37+
android:duration="?attr/motionDurationLong2"
38+
android:interpolator="?attr/motionEasingEmphasizedAccelerateInterpolator"/>
39+
<objectAnimator
40+
android:propertyName="labelOpacity"
41+
android:startOffset="?attr/motionDurationShort1"
42+
android:duration="?attr/motionDurationShort2"
43+
android:interpolator="?attr/motionEasingEmphasizedAccelerateInterpolator"/>
44+
</set>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2022 The Android Open Source Project
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<set xmlns:android="http://schemas.android.com/apk/res/android">
19+
<objectAnimator
20+
android:propertyName="width"
21+
android:startOffset="0"
22+
android:duration="?attr/motionDurationLong2"
23+
android:interpolator="?attr/motionEasingEmphasizedInterpolator"/>
24+
<objectAnimator
25+
android:propertyName="height"
26+
android:startOffset="0"
27+
android:duration="?attr/motionDurationLong2"
28+
android:interpolator="?attr/motionEasingEmphasizedInterpolator"/>
29+
<objectAnimator
30+
android:propertyName="paddingStart"
31+
android:startOffset="0"
32+
android:duration="?attr/motionDurationLong2"
33+
android:interpolator="?attr/motionEasingEmphasizedInterpolator"/>
34+
<objectAnimator
35+
android:propertyName="paddingEnd"
36+
android:startOffset="0"
37+
android:duration="?attr/motionDurationLong2"
38+
android:interpolator="?attr/motionEasingEmphasizedInterpolator"/>
39+
<objectAnimator
40+
android:propertyName="labelOpacity"
41+
android:startOffset="?attr/motionDurationShort2"
42+
android:duration="?attr/motionDurationShort4"
43+
android:interpolator="?attr/motionEasingEmphasizedDecelerateInterpolator"/>
44+
</set>

lib/java/com/google/android/material/floatingactionbutton/res/values/styles.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@
238238
<item name="enforceMaterialTheme">true</item>
239239
<item name="showMotionSpec">@animator/m3_extended_fab_show_motion_spec</item>
240240
<item name="hideMotionSpec">@animator/m3_extended_fab_hide_motion_spec</item>
241+
<item name="extendMotionSpec">@animator/m3_extended_fab_change_size_expand_motion_spec</item>
242+
<item name="shrinkMotionSpec">@animator/m3_extended_fab_change_size_collapse_motion_spec</item>
241243
</style>
242244

243245
<style name="Widget.Material3.ExtendedFloatingActionButton.Primary" parent="Base.Widget.Material3.ExtendedFloatingActionButton">

0 commit comments

Comments
 (0)