Skip to content

Commit 5c0003c

Browse files
hunterstichpekingme
authored andcommittedJun 8, 2022
[ExtendedFloatingActionButton] Updated show and hide motion specs to use motion tokens.
Resolves #2086 PiperOrigin-RevId: 453457969
1 parent 57a3c98 commit 5c0003c

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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="opacity"
21+
android:startOffset="0"
22+
android:duration="?attr/motionDurationShort3"
23+
android:valueFrom="1.0"
24+
android:valueTo="0.0"
25+
android:valueType="floatType"
26+
android:interpolator="?attr/motionEasingEmphasizedAccelerateInterpolator"/>
27+
<objectAnimator
28+
android:propertyName="scale"
29+
android:startOffset="0"
30+
android:duration="?attr/motionDurationMedium1"
31+
android:valueFrom="1.0"
32+
android:valueTo="0.4"
33+
android:valueType="floatType"
34+
android:interpolator="?attr/motionEasingEmphasizedAccelerateInterpolator"/>
35+
</set>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
>
20+
<objectAnimator
21+
android:propertyName="opacity"
22+
android:startOffset="0"
23+
android:duration="?attr/motionDurationLong2"
24+
android:valueFrom="0.0"
25+
android:valueTo="1.0"
26+
android:valueType="floatType"
27+
android:interpolator="?attr/motionEasingEmphasizedInterpolator"/>
28+
<objectAnimator
29+
android:propertyName="scale"
30+
android:startOffset="0"
31+
android:duration="?attr/motionDurationLong2"
32+
android:valueFrom="0.4"
33+
android:valueTo="1.0"
34+
android:valueType="floatType"
35+
android:interpolator="?attr/motionEasingEmphasizedInterpolator"/>
36+
</set>

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

+2
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@
146146
<item name="rippleColor">@color/m3_button_ripple_color_selector</item>
147147
<item name="shapeAppearance">?attr/shapeAppearanceCornerLarge</item>
148148
<item name="shapeAppearanceOverlay">@null</item>
149+
<item name="showMotionSpec">@animator/m3_extended_fab_show_motion_spec</item>
150+
<item name="hideMotionSpec">@animator/m3_extended_fab_hide_motion_spec</item>
149151
</style>
150152

151153
<style name="Base.Widget.Material3.ExtendedFloatingActionButton.Icon" parent="Base.Widget.Material3.ExtendedFloatingActionButton">

0 commit comments

Comments
 (0)
Please sign in to comment.