瀏覽代碼

Added window background as splash screen

sirekanyan 8 年之前
父節點
當前提交
4b93583d15

+ 10 - 8
app/src/main/res/layout/activity_main.xml

@@ -1,10 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/container"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:background="@color/white"
     android:orientation="vertical"
     tools:context="me.vadik.knigopis.MainActivity">
 
@@ -17,7 +19,7 @@
             android:id="@+id/toolbar"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            app:title="@string/app_name" />
+            app:title="@string/app_name"/>
 
     </android.support.design.widget.AppBarLayout>
 
@@ -30,7 +32,7 @@
             android:id="@+id/booksRecyclerView"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            tools:listitem="@layout/book" />
+            tools:listitem="@layout/book"/>
 
         <ProgressBar
             android:id="@+id/booksProgressBar"
@@ -38,7 +40,7 @@
             android:layout_height="wrap_content"
             android:layout_gravity="center"
             android:alpha="0"
-            tools:alpha="1" />
+            tools:alpha="1"/>
 
         <TextView
             android:id="@+id/booksPlaceholder"
@@ -52,7 +54,7 @@
             android:visibility="gone"
             tools:alpha="1"
             tools:text="@string/error_loading_books"
-            tools:visibility="visible" />
+            tools:visibility="visible"/>
 
         <android.support.design.widget.FloatingActionButton
             android:id="@+id/addBookButton"
@@ -61,7 +63,7 @@
             android:layout_gravity="end|bottom"
             android:layout_margin="16dp"
             android:tint="@color/white"
-            app:srcCompat="@drawable/ic_add" />
+            app:srcCompat="@drawable/ic_add"/>
 
     </FrameLayout>
 
@@ -70,7 +72,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_gravity="bottom"
-        android:background="?android:attr/windowBackground"
-        app:menu="@menu/navigation" />
+        android:background="@color/white"
+        app:menu="@menu/navigation"/>
 
 </LinearLayout>

+ 1 - 0
app/src/main/res/layout/book_edit.xml

@@ -5,6 +5,7 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:background="@color/white"
     android:orientation="vertical">
 
     <android.support.design.widget.AppBarLayout

+ 1 - 0
app/src/main/res/values/styles.xml

@@ -4,6 +4,7 @@
         <item name="colorPrimary">@color/colorPrimary</item>
         <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
         <item name="colorAccent">@color/colorAccent</item>
+        <item name="android:windowBackground">@color/colorPrimary</item>
     </style>
 
     <style name="DevTheme" parent="AppTheme">