Status bar height fix

This commit is contained in:
Dominik Schürmann 2015-02-21 20:01:19 +01:00
parent c6c8a09883
commit 5b75985f95
7 changed files with 17 additions and 8 deletions

View File

@ -26,7 +26,7 @@ dependencies {
compile 'com.journeyapps:zxing-android-integration:2.0.1@aar' compile 'com.journeyapps:zxing-android-integration:2.0.1@aar'
compile 'com.google.zxing:core:3.0.1' compile 'com.google.zxing:core:3.0.1'
compile 'com.jpardogo.materialtabstrip:library:1.0.8' compile 'com.jpardogo.materialtabstrip:library:1.0.8'
compile 'it.neokree:MaterialNavigationDrawer:1.3' compile 'it.neokree:MaterialNavigationDrawer:1.3.1'
compile 'com.nispok:snackbar:2.7.4' compile 'com.nispok:snackbar:2.7.4'
compile 'com.getbase:floatingactionbutton:1.7.0' compile 'com.getbase:floatingactionbutton:1.7.0'
} }

View File

@ -18,7 +18,7 @@
<ImageView <ImageView
android:id="@+id/status_bar" android:id="@+id/status_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/statusbar_margin" android:layout_height="@dimen/statusbar_height"
android:background="?attr/colorPrimary" /> android:background="?attr/colorPrimary" />
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar

View File

@ -7,7 +7,7 @@
<ImageView <ImageView
android:id="@+id/status_bar" android:id="@+id/status_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/statusbar_margin" /> android:layout_height="@dimen/statusbar_height" />
<LinearLayout <LinearLayout
android:id="@+id/first_time_buttons" android:id="@+id/first_time_buttons"

View File

@ -7,10 +7,14 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<!--
We always have windowTranslucentStatus=true to get under the status bar.
Thus this ImageView is the part under the status bar!
-->
<ImageView <ImageView
android:id="@+id/status_bar" android:id="@+id/status_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/statusbar_margin" android:layout_height="@dimen/statusbar_height"
android:background="?attr/colorPrimary" /> android:background="?attr/colorPrimary" />
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<dimen name="statusbar_margin">21dp</dimen> <!--
<!-- 120dp + statusbar_margin --> Status bar height according to
http://www.google.com/design/spec/layout/structure.html#structure-system-bars
-->
<dimen name="statusbar_height">24dp</dimen>
<!-- 120dp + statusbar_height -->
<dimen name="big_toolbar">141dp</dimen> <dimen name="big_toolbar">141dp</dimen>
</resources> </resources>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<dimen name="statusbar_margin">0dp</dimen> <!-- on Android < 5, we do not color the status bar, thus 0dp! -->
<dimen name="statusbar_height">0dp</dimen>
<dimen name="big_toolbar">120dp</dimen> <dimen name="big_toolbar">120dp</dimen>
</resources> </resources>

View File

@ -4,7 +4,7 @@
<style name="KeychainTheme" parent="KeychainTheme.Base" /> <style name="KeychainTheme" parent="KeychainTheme.Base" />
<!--<style name="KeychainTheme.Base" parent="HoloKeychainTheme">--> <!--<style name="KeychainTheme.Base" parent="HoloKeychainTheme">-->
<style name="KeychainTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> <style name="KeychainTheme.Base" parent="Theme.AppCompat.Light">
<item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/accent</item> <item name="colorAccent">@color/accent</item>