Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0316f65 authored by Diogo Ferreira's avatar Diogo Ferreira Committed by Steve Kondik
Browse files

profiles: Make the floating action button more material-y

This makes the FAB look consistent with other fabs across the system,
it adds animated elevation, changes the icon color to white but mainly
fixes the size which was completly wrong.

Change-Id: Ib8b2d54869a6a10958c24bcc0fab1224fd07fadd
parent 5451b1c4
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true">
        <objectAnimator
            android:propertyName="translationZ"
            android:duration="@android:integer/config_shortAnimTime"
            android:valueTo="@dimen/fab_elevation_pressed"
            android:valueType="floatType"/>
    </item>
    <item>
        <objectAnimator
            android:propertyName="translationZ"
            android:duration="@android:integer/config_shortAnimTime"
            android:valueTo="0dp"
            android:valueType="floatType"/>
    </item>
</selector>
+2 −1
Original line number Diff line number Diff line
@@ -22,4 +22,5 @@
            <solid android:color="@android:color/white" />
        </shape>
    </item>
    <item android:drawable="@drawable/fab_accent"/>
</ripple>

res/layout/fab.xml

0 → 100644
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2014 The CyanogenMod Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:id="@+id/floating_action_button"
             style="@style/floating_action_button">
    <ImageView
            style="@style/floating_action_button_image"
            android:src="@drawable/ic_menu_add_white"/>
</FrameLayout>
 No newline at end of file
+3 −17
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 The CyanogenMod Project
<!--
     Copyright (C) 2014 The CyanogenMod Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -27,22 +28,7 @@

    </android.support.v4.view.ViewPager>

    <FrameLayout
        android:id="@+id/floating_action_button_container"
        android:background="@drawable/fab_accent"
        android:layout_alignParentRight="true"
        android:layout_alignParentBottom="true"
        android:layout_margin="16dp"
        android:elevation="4dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content">
        <ImageButton
            android:id="@+id/floating_action_button"
            android:layout_width="56dp"
            android:layout_height="56dp"
            android:background="@drawable/floating_action_button"
            android:src="@drawable/ic_menu_add"/>
    </FrameLayout>
    <include layout="@layout/fab" />

    <TextView
        android:id="@+id/empty"
+7 −0
Original line number Diff line number Diff line
@@ -231,4 +231,11 @@
    <dimen name="color_swatch_size">16dp</dimen>
    <dimen name="color_swatch_stroke_width">4dp</dimen>

    <!-- FAB Dimensions -->
    <dimen name="fab_size">56dp</dimen>
    <dimen name="fab_margin">16dp</dimen>
    <dimen name="fab_icon_size">24dp</dimen>
    <dimen name="fab_elevation_normal">8dp</dimen>
    <dimen name="fab_elevation_pressed">6dp</dimen>

</resources>
Loading