Преглед изворни кода

Merge pull request #1132 from nextcloud/splashScreen

Add splash screen to Talk App
Marcel Hibbe пре 4 година
родитељ
комит
332403f9b6

+ 1 - 1
app/src/gplay/AndroidManifest.xml

@@ -30,7 +30,7 @@
         android:label="@string/nc_app_name"
         android:networkSecurityConfig="@xml/network_security_config"
         android:supportsRtl="true"
-        android:theme="@style/AppTheme"
+        android:theme="@style/AppTheme.Launcher"
         tools:replace="label, icon, theme, name, allowBackup"
         tools:ignore="UnusedAttribute, ExportedService">
 

+ 1 - 1
app/src/main/AndroidManifest.xml

@@ -78,7 +78,7 @@
         android:largeHeap="true"
         android:networkSecurityConfig="@xml/network_security_config"
         android:supportsRtl="true"
-        android:theme="@style/AppTheme"
+        android:theme="@style/AppTheme.Launcher"
         android:requestLegacyExternalStorage="true"
         tools:ignore="UnusedAttribute"
         tools:replace="label, icon, theme, name, allowBackup">

+ 2 - 1
app/src/main/java/com/nextcloud/talk/activities/MainActivity.kt

@@ -103,7 +103,8 @@ class MainActivity : BaseActivity(), ActionBarProvider {
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
-
+        // Set the default theme to replace the launch screen theme.
+        setTheme(R.style.AppTheme)
         setContentView(R.layout.activity_main)
 
         NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this)

+ 26 - 0
app/src/main/res/drawable/launch_screen.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+  ~ Nextcloud Talk 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 General Public License as published by
+  ~ the Free Software Foundation, either version 3 of the License, or
+  ~ at your option) 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 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/>.
+-->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:drawable="@color/colorPrimary" />
+    <item
+        android:drawable="@drawable/ic_logo"
+        android:gravity="center" />
+
+</layer-list>

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

@@ -124,4 +124,11 @@
     <style name="HintTextLogin" parent="TextAppearance.AppCompat">
         <item name="android:textColor">@color/white</item>
     </style>
+
+    <!-- Launch screen -->
+    <style name="AppTheme.Launcher">
+        <item name="android:windowBackground">@drawable/launch_screen</item>
+        <item name="android:statusBarColor">@color/colorPrimary</item>
+        <item name="android:navigationBarColor">@color/colorPrimary</item>
+    </style>
 </resources>