mirror of
https://github.com/nextcloud/android.git
synced 2024-11-24 06:05:42 +03:00
enable "logo-only" splashscreen
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
5e4e5a7e85
commit
25b61a38ac
6 changed files with 42 additions and 20 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
14
app/src/main/res/drawable/nextcloud_splash_logo.xml
Normal file
14
app/src/main/res/drawable/nextcloud_splash_logo.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="160dp"
|
||||
android:height="160dp"
|
||||
android:viewportWidth="160"
|
||||
android:viewportHeight="160">
|
||||
<path
|
||||
android:pathData="M79.87,28.3C63.7,28.3 50,39.27 45.75,54.12C42.06,46.24 34.06,40.72 24.84,40.72C12.17,40.72 1.75,51.14 1.75,63.81C1.75,76.48 12.17,86.9 24.84,86.9C34.06,86.9 42.06,81.38 45.75,73.5C50,88.36 63.7,99.32 79.87,99.32C95.92,99.32 109.56,88.52 113.91,73.84C117.67,81.54 125.58,86.9 134.66,86.9C147.33,86.9 157.75,76.48 157.75,63.81C157.75,51.14 147.33,40.72 134.66,40.72C125.58,40.72 117.67,46.09 113.91,53.78C109.56,39.1 95.92,28.3 79.87,28.3ZM79.87,41.86C92.08,41.86 101.83,51.6 101.83,63.81C101.83,76.02 92.08,85.77 79.87,85.77C67.67,85.77 57.92,76.02 57.92,63.81C57.92,51.6 67.67,41.86 79.87,41.86ZM24.84,54.28C30.19,54.28 34.38,58.46 34.38,63.81C34.38,69.16 30.19,73.35 24.84,73.35C19.49,73.35 15.31,69.16 15.31,63.81C15.31,58.46 19.49,54.28 24.84,54.28ZM134.66,54.28C140.01,54.28 144.2,58.46 144.2,63.81C144.2,69.16 140.01,73.35 134.66,73.35C129.31,73.35 125.12,69.16 125.12,63.81C125.12,58.46 129.31,54.28 134.66,54.28Z"
|
||||
android:fillColor="#ffffff"
|
||||
android:fillType="nonZero"/>
|
||||
<path
|
||||
android:pathData="M18,110.03C17.55,110.03 17.35,110.29 17.35,110.74L17.35,129.43C17.35,129.88 17.55,130.13 18,130.13L18.52,130.13C18.97,130.13 19.22,129.88 19.22,129.43L19.22,113.91L29.42,129.74C29.47,129.81 29.51,129.86 29.56,129.91C29.58,129.93 29.59,129.94 29.6,129.96C29.65,130 29.69,130.02 29.74,130.04C29.77,130.06 29.79,130.08 29.82,130.09C29.84,130.09 29.86,130.09 29.88,130.09C29.95,130.11 30.03,130.13 30.11,130.13L30.63,130.13C31.08,130.13 31.27,129.88 31.27,129.43L31.27,110.74C31.27,110.29 31.08,110.03 30.63,110.03L30.11,110.03C29.66,110.03 29.4,110.29 29.4,110.74L29.4,126.26L19.2,110.43C19.17,110.37 19.13,110.34 19.09,110.3C18.97,110.13 18.78,110.03 18.52,110.03L18,110.03ZM140.48,110.29C140.03,110.29 140.22,110.55 140.22,111L140.22,117.38C140.22,118.02 140.28,118.47 140.28,118.47L140.22,118.47C140.22,118.47 139,115.64 135.58,115.64C131.85,115.64 129.2,118.6 129.33,122.98C129.33,127.36 131.72,130.39 135.52,130.39C139.19,130.39 140.41,127.43 140.41,127.43L140.48,127.43C140.48,127.43 140.35,127.82 140.35,128.33L140.35,129.42C140.35,129.88 140.61,130.07 141.06,130.07L141.51,130.07C141.96,130.07 142.15,129.81 142.15,129.36L142.15,111C142.15,110.55 141.44,110.29 140.99,110.29L140.48,110.29ZM90.42,110.36C89.97,110.36 90.22,110.61 90.22,111.06L90.22,126.85C90.22,129.94 92.28,130.33 93.44,130.33C93.96,130.33 94.15,130.07 94.15,129.62L94.15,129.17C94.15,128.72 93.89,128.53 93.57,128.53C92.93,128.46 92.09,128.27 92.09,126.46L92.09,111.06C92.09,110.61 91.38,110.36 90.93,110.36L90.42,110.36ZM67.29,112.03C66.84,112.03 66.58,112.29 66.58,112.74L66.58,124.98C66.58,128.33 68.45,130.2 71.54,130.2C72.12,130.2 72.31,130.01 72.31,129.56L72.31,129.17C72.31,128.65 72.12,128.52 71.54,128.46C70.45,128.4 68.45,128.01 68.45,124.72L68.45,117.63L71.35,117.63C71.8,117.63 72.06,117.44 72.06,116.99L72.06,116.8C72.06,116.35 71.8,116.09 71.35,116.09L68.45,116.09L68.45,112.74C68.45,112.29 68.26,112.03 67.8,112.03L67.29,112.03ZM41.63,115.64C37.76,115.64 34.67,118.41 34.6,123.05C34.6,127.43 37.82,130.46 42.01,130.46C44.27,130.46 45.94,129.49 46.71,128.91C47.04,128.65 47.1,128.33 46.91,128.01L46.71,127.69C46.52,127.3 46.2,127.24 45.81,127.49C45.17,128.01 43.88,128.78 42.07,128.78C39.18,128.78 36.66,126.72 36.6,123.11L46.84,123.11C47.23,123.11 47.55,122.79 47.55,122.4C47.55,118.34 45.43,115.64 41.63,115.64ZM81.65,115.64C77.47,115.64 74.25,118.73 74.18,123.11C74.18,127.49 77.4,130.52 81.59,130.52C84.17,130.52 85.91,129.3 86.62,128.72C86.94,128.39 87,128.14 86.81,127.75L86.62,127.49C86.36,127.11 86.1,127.04 85.71,127.3C85.07,127.88 83.72,128.78 81.72,128.78C78.63,128.78 76.18,126.46 76.18,123.11C76.18,119.7 78.63,117.38 81.72,117.38C83.39,117.38 84.62,118.22 85.26,118.67C85.65,118.92 85.97,118.92 86.23,118.54L86.42,118.22C86.74,117.83 86.68,117.51 86.36,117.25C85.65,116.67 84.1,115.64 81.65,115.64L81.65,115.64ZM103.43,115.64C99.31,115.64 95.96,118.8 95.96,122.98C95.96,127.23 99.31,130.46 103.43,130.46C107.56,130.46 110.91,127.23 110.91,122.98C110.91,118.8 107.56,115.64 103.43,115.64ZM61.75,115.85C61.59,115.88 61.44,115.99 61.3,116.16L58.69,119.27L56.74,121.59L53.78,118.07L52.18,116.16C52.04,115.99 51.87,115.89 51.7,115.88C51.53,115.86 51.35,115.93 51.18,116.07L50.79,116.4C50.44,116.69 50.46,117.01 50.75,117.36L53.36,120.47L55.52,123.05L52.35,126.82C52.35,126.82 52.35,126.82 52.35,126.83L50.75,128.73C50.46,129.07 50.49,129.44 50.84,129.73L51.23,130.06C51.58,130.35 51.89,130.27 52.18,129.93L54.79,126.82L56.74,124.5L59.7,128.02C59.7,128.02 59.7,128.02 59.7,128.03L61.3,129.93C61.59,130.28 61.95,130.31 62.3,130.02L62.69,129.69C63.04,129.4 63.02,129.08 62.73,128.73L60.12,125.62L57.96,123.04L61.12,119.27C61.13,119.27 61.13,119.26 61.13,119.26L62.73,117.36C63.02,117.01 62.99,116.65 62.64,116.36L62.25,116.03C62.07,115.89 61.91,115.83 61.75,115.86L61.75,115.85ZM114.71,115.96C114.26,115.96 114.06,116.22 114.06,116.67L114.06,124.98C114.06,128.65 116.77,130.46 120.12,130.46C123.47,130.46 126.17,128.65 126.17,124.98L126.17,116.67C126.24,116.22 125.98,115.96 125.53,115.96L125.02,115.96C124.56,115.96 124.31,116.22 124.31,116.67L124.31,124.47C124.31,126.66 122.89,128.65 120.12,128.65C117.41,128.65 115.93,126.66 115.93,124.47L115.93,116.67C115.93,116.22 115.67,115.96 115.22,115.96L114.71,115.96ZM41.56,117.25C43.62,117.25 45.42,118.73 45.55,121.7L36.66,121.7C37.11,118.8 39.18,117.25 41.56,117.25ZM103.43,117.38C106.46,117.38 108.91,119.76 108.91,122.98C108.91,126.33 106.46,128.78 103.43,128.78C100.4,128.78 97.95,126.27 97.89,122.98C97.89,119.83 100.4,117.38 103.43,117.38ZM135.71,117.38C138.74,117.38 140.22,120.15 140.22,123.05C140.22,127.11 138.03,128.78 135.65,128.78C133,128.78 131.2,126.53 131.14,123.05C131.14,119.44 133.2,117.38 135.71,117.38Z"
|
||||
android:fillColor="#ffffff"
|
||||
android:fillType="nonZero"/>
|
||||
</vector>
|
|
@ -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>
|
||||
|
|
|
@ -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
drawable_resources/nextcloud-logo.svg
Normal file
7
drawable_resources/nextcloud-logo.svg
Normal file
|
@ -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>
|
After Width: | Height: | Size: 1.6 KiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 7 KiB |
Loading…
Reference in a new issue