Add floating action button to GameGridActivity.

This commit is contained in:
Eder Bastos 2015-05-08 19:57:44 -04:00
parent a4395ecd75
commit 700225f8c8
6 changed files with 43 additions and 15 deletions

View File

@ -1,9 +1,8 @@
<!-- res/drawable/oval_ripple.xml -->
<ripple xmlns:android="http://schemas.android.com/apk/res/android" <ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:colorControlHighlight"> android:color="?android:colorControlHighlight">
<item> <item>
<shape android:shape="oval"> <shape android:shape="oval">
<solid android:color="@color/dolphin_wii"/> <solid android:color="@color/dolphin_gamecube_accent"/>
</shape> </shape>
</item> </item>
</ripple> </ripple>

View File

@ -0,0 +1,8 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:colorControlHighlight">
<item>
<shape android:shape="oval">
<solid android:color="@color/dolphin_wii_accent"/>
</shape>
</item>
</ripple>

View File

@ -13,12 +13,31 @@
android:minHeight="?android:attr/actionBarSize" android:minHeight="?android:attr/actionBarSize"
android:theme="@android:style/ThemeOverlay.Material.Dark.ActionBar"/> android:theme="@android:style/ThemeOverlay.Material.Dark.ActionBar"/>
<android.support.v7.widget.RecyclerView <FrameLayout
android:id="@+id/grid_games"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
tools:listitem="@layout/grid_card_game"
android:layout_marginLeft="@dimen/activity_horizontal_margin" <android.support.v7.widget.RecyclerView
android:layout_marginRight="@dimen/activity_horizontal_margin"/> android:id="@+id/grid_games"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/grid_card_game"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"/>
<ImageButton
android:id="@+id/button_add_directory"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_alignBottom="@+id/image_game_screen"
android:layout_alignEnd="@+id/text_game_title"
android:layout_marginBottom="28dp"
android:background="@drawable/oval_ripple_wii"
android:src="@drawable/ic_play"
android:stateListAnimator="@anim/button_elevation"
android:elevation="4dp"
android:layout_gravity="bottom|right"
android:layout_marginRight="@dimen/activity_horizontal_margin"/>
</FrameLayout>
</LinearLayout> </LinearLayout>

View File

@ -124,7 +124,7 @@
android:layout_alignBottom="@+id/image_game_screen" android:layout_alignBottom="@+id/image_game_screen"
android:layout_alignEnd="@+id/text_game_title" android:layout_alignEnd="@+id/text_game_title"
android:layout_marginBottom="-28dp" android:layout_marginBottom="-28dp"
android:background="@drawable/oval_ripple" android:background="@drawable/oval_ripple_wii"
android:src="@drawable/ic_play" android:src="@drawable/ic_play"
android:stateListAnimator="@anim/button_elevation" android:stateListAnimator="@anim/button_elevation"
android:elevation="4dp"/> android:elevation="4dp"/>

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="dolphin_wii">#5bc0de</color> <color name="dolphin_wii">#2196f3</color>
<color name="dolphin_wii_dark">#428bca</color> <color name="dolphin_wii_dark">#1976d2</color>
<color name="dolphin_wii_accent">#651fff</color>
<color name="dolphin_gamecube">#663399</color> <color name="dolphin_gamecube">#673ab7</color>
<color name="dolphin_gamecube_dark">#311b92</color> <color name="dolphin_gamecube_dark">#512da8</color>
<color name="dolphin_gamecube_accent">#2979ff</color>
</resources> </resources>

View File

@ -8,13 +8,13 @@
<!-- darker variant for the status bar and contextual app bars --> <!-- darker variant for the status bar and contextual app bars -->
<item name="android:colorPrimaryDark">@color/dolphin_wii_dark</item> <item name="android:colorPrimaryDark">@color/dolphin_wii_dark</item>
<!-- theme UI controls like checkboxes and text fields --> <!-- theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">@color/dolphin_gamecube</item> <item name="android:colorAccent">@color/dolphin_wii_accent</item>
</style> </style>
<style name="DolphinGamecube" parent="android:Theme.Material.Light.NoActionBar"> <style name="DolphinGamecube" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:colorPrimary">@color/dolphin_gamecube</item> <item name="android:colorPrimary">@color/dolphin_gamecube</item>
<item name="android:colorPrimaryDark">@color/dolphin_gamecube_dark</item> <item name="android:colorPrimaryDark">@color/dolphin_gamecube_dark</item>
<item name="android:colorAccent">@color/dolphin_wii</item> <item name="android:colorAccent">@color/dolphin_gamecube_accent</item>
<item name="android:windowNoTitle">true</item> <item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item> <item name="android:windowActionBar">false</item>