Просмотр исходного кода

Merge pull request #2448 from ardevd/2444-feature_splash

Added a splash screen
Tobias Kaminsky 7 лет назад
Родитель
Сommit
9b1fa62675

+ 1 - 1
src/main/AndroidManifest.xml

@@ -80,7 +80,7 @@
             android:name=".ui.activity.FileDisplayActivity"
             android:label="@string/app_name"
             android:configChanges="orientation|screenSize"
-            android:theme="@style/Theme.ownCloud.Toolbar.Drawer">
+            android:theme="@style/Theme.ownCloud.Launcher">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 

+ 2 - 1
src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -182,7 +182,8 @@ public class FileDisplayActivity extends HookActivity
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         Log_OC.v(TAG, "onCreate() start");
-
+        // Set the default theme to replace the launch screen theme.
+        setTheme(R.style.Theme_ownCloud_Toolbar_Drawer);
         super.onCreate(savedInstanceState); // this calls onAccountChanged() when ownCloud Account
         // is valid
 

+ 31 - 0
src/main/res/drawable/launch_screen.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Nextcloud Android client application
+
+  Copyright (C) 2018 Edvard Holst
+
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+  License as published by the Free Software Foundation; either
+  version 3 of the License, or any later version.
+
+  This program 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 AFFERO GENERAL PUBLIC LICENSE for more details.
+
+  You should have received a copy of the GNU Affero General Public
+  License along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item
+        android:drawable="@color/primary"/>
+
+    <item>
+        <bitmap
+            android:gravity="center"
+            android:src="@drawable/logo" />
+    </item>
+
+</layer-list>

+ 6 - 0
src/main/res/values/styles.xml

@@ -144,6 +144,12 @@
 		<item name="windowActionBarOverlay">true</item>
 	</style>
 
+	<!-- Launch screen -->
+	<style name="Theme.ownCloud.Launcher">
+		<item name="android:windowBackground">@drawable/launch_screen</item>
+	</style>
+
+
 	<!-- Progress bar -->
 	<style name="Widget.ownCloud.TopProgressBar" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
 		<item name="android:progressDrawable">@drawable/actionbar_progress_horizontal</item>