Show toolbar shadow on pre-Lollipop

This commit is contained in:
2016-04-19 08:27:45 -04:00
parent 8938b0c9a6
commit d05d404c55
7 changed files with 76 additions and 8 deletions

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com>
~
~ This file is part of Loop Habit Tracker.
~
~ Loop Habit Tracker is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by the
~ Free Software Foundation, either version 3 of the License, or (at your
~ option) any later version.
~
~ Loop Habit Tracker is distributed in the hope that it will be useful, but
~ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along
~ with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="@android:color/transparent"
android:endColor="@color/black"
android:angle="90"/>
</shape>

View File

@@ -191,4 +191,8 @@
</LinearLayout>
</ScrollView>
<View
android:id="@+id/toolbarShadow"
style="@style/ToolbarShadow"/>
</RelativeLayout>

View File

@@ -17,10 +17,10 @@
~ with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<RelativeLayout android:id="@+id/container"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.isoron.uhabits.MainActivity"
@@ -28,15 +28,19 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
app:popupTheme="?toolbarPopupTheme"
style="@style/Toolbar"/>
style="@style/Toolbar"
app:popupTheme="?toolbarPopupTheme"/>
<fragment
android:id="@+id/fragment1"
android:name="org.isoron.uhabits.fragments.ListHabitsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/list_habits_fragment"
android:layout_below="@id/toolbar"/>
android:layout_below="@id/toolbar"
tools:layout="@layout/list_habits_fragment"/>
<View
android:id="@+id/toolbarShadow"
style="@style/ToolbarShadow"/>
</RelativeLayout>

View File

@@ -39,4 +39,8 @@
android:layout_gravity="center"
android:layout_below="@id/toolbar"/>
<View
android:id="@+id/toolbarShadow"
style="@style/ToolbarShadow"/>
</RelativeLayout>

View File

@@ -42,4 +42,8 @@
android:layout_gravity="center"
android:layout_below="@id/toolbar"/>
<View
android:id="@+id/toolbarShadow"
style="@style/ToolbarShadow"/>
</RelativeLayout>

View File

@@ -222,4 +222,12 @@
<style name="Preference.Category.Material">
<item name="android:layout">@layout/preference_category_custom</item>
</style>
<style name="ToolbarShadow">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">3dp</item>
<item name="android:background">@drawable/toolbar_shadow</item>
<item name="android:alpha">0.25</item>
<item name="android:layout_below">@id/toolbar</item>
</style>
</resources>