mirror of
https://github.com/moparisthebest/Yaaic
synced 2025-01-06 11:18:08 -05:00
Add Floating Action Button (FAB) resources.
This commit is contained in:
parent
0256c28391
commit
330239c093
49
app/src/main/res/anim/fab_state_list_animator.xml
Normal file
49
app/src/main/res/anim/fab_state_list_animator.xml
Normal file
@ -0,0 +1,49 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:state_pressed="true"
|
||||
android:state_enabled="true">
|
||||
<set>
|
||||
<objectAnimator
|
||||
android:propertyName="translationZ"
|
||||
android:duration="@integer/fab_duration"
|
||||
android:valueTo="@dimen/fab_rise"
|
||||
android:valueType="floatType" />
|
||||
<objectAnimator
|
||||
android:propertyName="elevation"
|
||||
android:duration="0"
|
||||
android:valueTo="@dimen/fab_elevation"
|
||||
android:valueType="floatType" />
|
||||
</set>
|
||||
</item>
|
||||
<!-- base state -->
|
||||
<item android:state_enabled="true">
|
||||
<set>
|
||||
<objectAnimator
|
||||
android:propertyName="translationZ"
|
||||
android:duration="@integer/fab_duration"
|
||||
android:valueTo="0"
|
||||
android:startDelay="@integer/fab_duration"
|
||||
android:valueType="floatType" />
|
||||
<objectAnimator
|
||||
android:propertyName="elevation"
|
||||
android:duration="0"
|
||||
android:valueTo="@dimen/fab_elevation"
|
||||
android:valueType="floatType" />
|
||||
</set>
|
||||
</item>
|
||||
<item>
|
||||
<set>
|
||||
<objectAnimator
|
||||
android:propertyName="translationZ"
|
||||
android:duration="0"
|
||||
android:valueTo="0"
|
||||
android:valueType="floatType" />
|
||||
<objectAnimator
|
||||
android:propertyName="elevation"
|
||||
android:duration="0"
|
||||
android:valueTo="0"
|
||||
android:valueType="floatType" />
|
||||
</set>
|
||||
</item>
|
||||
</selector>
|
||||
|
9
app/src/main/res/drawable/fab_background.xml
Normal file
9
app/src/main/res/drawable/fab_background.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?android:colorControlHighlight">
|
||||
<item>
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="?android:colorAccent" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
17
app/src/main/res/drawable/plus.xml
Normal file
17
app/src/main/res/drawable/plus.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24"
|
||||
android:width="24dp"
|
||||
android:height="24dp">
|
||||
<group
|
||||
android:name="plus_group"
|
||||
android:pivotX="12"
|
||||
android:pivotY="12">
|
||||
<path
|
||||
android:name="plus_path"
|
||||
android:strokeColor="@android:color/white"
|
||||
android:strokeWidth="3"
|
||||
android:pathData="M12,0L12,24M0,12,L24,12" />
|
||||
</group>
|
||||
</vector>
|
@ -7,5 +7,6 @@
|
||||
<color name="accent">#FF5722</color>
|
||||
<color name="secondary_text">#727272</color>
|
||||
<color name="divider">#B6B6B6</color>
|
||||
<color name="highlight">#FFC107</color>
|
||||
<color name="window_background">#EEEEEE</color>
|
||||
</resources>
|
9
app/src/main/res/values/dimens.xml
Normal file
9
app/src/main/res/values/dimens.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
|
||||
<dimen name="fab_elevation">5dp</dimen>
|
||||
<dimen name="fab_rise">3dp</dimen>
|
||||
<integer name="fab_duration">100</integer>
|
||||
</resources>
|
@ -5,5 +5,13 @@
|
||||
<item name="android:colorPrimaryDark">@color/primary_dark</item>
|
||||
<item name="android:colorAccent">@color/accent</item>
|
||||
<item name="android:windowBackground">@color/window_background</item>
|
||||
<item name="android:colorControlHighlight">#FFC107</item>
|
||||
</style>
|
||||
|
||||
<style name="FloatingActionButton" parent="android:Widget.Material.Button">
|
||||
<item name="android:background">@drawable/fab_background</item>
|
||||
<item name="android:stateListAnimator">@anim/fab_state_list_animator</item>
|
||||
<item name="android:layout_width">56dp</item>
|
||||
<item name="android:layout_height">56dp</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user