Browse Source

enable "logo-only" splashscreen

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 1 year ago
parent
commit
25b61a38ac

+ 12 - 14
app/src/main/java/com/nmc/android/ui/LauncherActivity.kt

@@ -36,43 +36,37 @@ import javax.inject.Inject
 
 class LauncherActivity : BaseActivity() {
 
-    companion object {
-        const val SPLASH_DURATION = 1500L
-    }
-
-    private lateinit var binding : ActivitySplashBinding
+    private lateinit var binding: ActivitySplashBinding
 
     @Inject
     lateinit var appPreferences: AppPreferences
 
     override fun onCreate(savedInstanceState: Bundle?) {
-        //Mandatory to call this before super method to show system launch screen for api level 31+
+        // Mandatory to call this before super method to show system launch screen for api level 31+
         installSplashScreen()
 
-        //flag to avoid redirection to AuthenticatorActivity
-        //as we need this activity to be shown
-        //Note: Should be kept before super() method
-        enableAccountHandling = false
         super.onCreate(savedInstanceState)
 
         binding = ActivitySplashBinding.inflate(layoutInflater)
 
         setContentView(binding.root)
-        updateBoldTitleVisibility()
+        updateTitleVisibility()
         scheduleSplashScreen()
     }
 
-    private fun updateBoldTitleVisibility() {
-        //For NC this will be empty so to handle that case we have added this check
+    private fun updateTitleVisibility() {
         if (TextUtils.isEmpty(resources.getString(R.string.splashScreenBold))) {
             binding.splashScreenBold.visibility = View.GONE
         }
+        if (TextUtils.isEmpty(resources.getString(R.string.splashScreenNormal))) {
+            binding.splashScreenNormal.visibility = View.GONE
+        }
     }
 
     private fun scheduleSplashScreen() {
         Handler().postDelayed(
             {
-                //if user is null then go to authenticator activity
+                // if user is null then go to authenticator activity
                 if (!user.isPresent) {
                     startActivity(Intent(this, AuthenticatorActivity::class.java))
                 } else {
@@ -83,4 +77,8 @@ class LauncherActivity : BaseActivity() {
             SPLASH_DURATION
         )
     }
+
+    companion object {
+        const val SPLASH_DURATION = 1500L
+    }
 }

File diff suppressed because it is too large
+ 10 - 0
app/src/main/res/drawable/nextcloud_splash_logo.xml


+ 2 - 2
app/src/main/res/layout/activity_splash.xml

@@ -30,7 +30,7 @@
         app:layout_constraintBottom_toTopOf="@+id/guideline"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:srcCompat="@drawable/logo" />
+        app:srcCompat="@drawable/nextcloud_splash_logo" />
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -64,6 +64,6 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:orientation="horizontal"
-        app:layout_constraintGuide_percent="0.45" />
+        app:layout_constraintGuide_percent="0.5" />
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 1 - 1
app/src/main/res/values/setup.xml

@@ -7,7 +7,7 @@
     <!-- App name  and other strings-->
     <string name="app_name">Nextcloud</string>
     <string name="splashScreenBold"></string>
-    <string name="splashScreenNormal">Nextcloud</string>
+    <string name="splashScreenNormal"></string>
     <string name="account_type">nextcloud</string>     <!-- better if was a domain name; but changing it now would require migrate accounts when the app is updated -->
     <string name="authority">org.nextcloud</string>    <!-- better if was the app package with ".provider" appended ; it identifies the provider -->
     <string name="users_and_groups_search_authority">com.nextcloud.android.providers.UsersAndGroupsSearchProvider</string>

+ 7 - 0
drawable_resources/nextcloud-logo.svg

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="100%" height="100%" viewBox="0 0 116 116" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
+    <g transform="matrix(0.934491,0,0,0.934491,-16.6897,-5.00788)">
+        <path id="logo" d="M80.093,39.773C67.5,39.773 56.827,48.31 53.519,59.876C50.644,53.741 44.414,49.443 37.238,49.443C27.37,49.443 19.257,57.556 19.257,67.424C19.257,77.293 27.37,85.409 37.238,85.409C44.414,85.409 50.644,81.108 53.519,74.972C56.827,86.539 67.5,95.079 80.093,95.079C92.592,95.079 103.21,86.668 106.603,75.231C109.531,81.228 115.684,85.409 122.758,85.409C132.627,85.409 140.742,77.293 140.742,67.424C140.742,57.556 132.627,49.443 122.758,49.443C115.684,49.443 109.531,53.622 106.603,59.617C103.21,48.181 92.592,39.773 80.093,39.773ZM80.093,50.329C89.598,50.329 97.192,57.919 97.192,67.424C97.192,76.93 89.598,84.524 80.093,84.524C70.587,84.524 62.997,76.93 62.997,67.424C62.997,57.919 70.587,50.329 80.093,50.329ZM37.238,59.999C41.403,59.999 44.668,63.26 44.668,67.424C44.668,71.589 41.403,74.854 37.238,74.854C33.074,74.854 29.813,71.589 29.813,67.424C29.813,63.26 33.074,59.999 37.238,59.999ZM122.758,59.999C126.923,59.999 130.187,63.26 130.187,67.424C130.187,71.589 126.923,74.854 122.758,74.854C118.593,74.854 115.332,71.589 115.332,67.424C115.332,63.26 118.593,59.999 122.758,59.999Z" style="fill:white;fill-rule:nonzero;"/>
+    </g>
+</svg>

File diff suppressed because it is too large
+ 5 - 3
drawable_resources/nextcloud-splash-logo.svg


Some files were not shown because too many files changed in this diff