From b8af8a8aa438f717bdd7bd1b1620550f4932c69c Mon Sep 17 00:00:00 2001 From: A117870935 Date: Tue, 4 Apr 2023 17:18:40 +0530 Subject: [PATCH] Added splash screen. --- .../com/nmc/android/ui/LauncherActivityIT.kt | 28 +++++------------ .../drawable/ic_magentacloud_splash_logo.xml | 16 ++++++++++ app/src/main/res/layout/activity_splash.xml | 3 +- app/src/main/res/values/dimens.xml | 31 +++++++++++++++++++ app/src/main/res/values/dims.xml | 2 +- app/src/main/res/values/setup.xml | 4 +-- 6 files changed, 59 insertions(+), 25 deletions(-) create mode 100644 app/src/main/res/drawable/ic_magentacloud_splash_logo.xml create mode 100644 app/src/main/res/values/dimens.xml diff --git a/app/src/androidTest/java/com/nmc/android/ui/LauncherActivityIT.kt b/app/src/androidTest/java/com/nmc/android/ui/LauncherActivityIT.kt index 2aaf78d618e0..14701476389c 100644 --- a/app/src/androidTest/java/com/nmc/android/ui/LauncherActivityIT.kt +++ b/app/src/androidTest/java/com/nmc/android/ui/LauncherActivityIT.kt @@ -23,10 +23,9 @@ package com.nmc.android.ui import androidx.test.espresso.Espresso.onView import androidx.test.espresso.assertion.ViewAssertions.matches -import androidx.test.espresso.matcher.ViewMatchers import androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed -import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.ext.junit.rules.ActivityScenarioRule import androidx.test.ext.junit.runners.AndroidJUnit4 import com.owncloud.android.AbstractIT @@ -42,26 +41,13 @@ class LauncherActivityIT : AbstractIT() { val activityRule = ActivityScenarioRule(LauncherActivity::class.java) @Test - fun testSplashScreenWithEmptyTitlesShouldHideTitles() { - waitForIdleSync() - + fun verifyUIElements() { onView(withId(R.id.ivSplash)).check(matches(isCompletelyDisplayed())) + onView(withId(R.id.splashScreenBold)).check(matches(isCompletelyDisplayed())) + onView(withId(R.id.splashScreenNormal)).check(matches(isCompletelyDisplayed())) - onView(withId(R.id.splashScreenBold)).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE))) - onView(withId(R.id.splashScreenNormal)).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE))) - } - - @Test - fun testSplashScreenWithTitlesShouldShowTitles() { - waitForIdleSync() - onView(withId(R.id.ivSplash)).check(matches(isCompletelyDisplayed())) - - activityRule.scenario.onActivity { - it.setSplashTitles("Example", "Cloud") - } - - val onePercentArea = ViewMatchers.isDisplayingAtLeast(1) - onView(withId(R.id.splashScreenBold)).check(matches(onePercentArea)) - onView(withId(R.id.splashScreenNormal)).check(matches(onePercentArea)) + onView(withId(R.id.splashScreenBold)).check(matches(withText("Magenta"))) + onView(withId(R.id.splashScreenNormal)).check(matches(withText("CLOUD"))) + shortSleep() } } diff --git a/app/src/main/res/drawable/ic_magentacloud_splash_logo.xml b/app/src/main/res/drawable/ic_magentacloud_splash_logo.xml new file mode 100644 index 000000000000..0abbc5ab08cd --- /dev/null +++ b/app/src/main/res/drawable/ic_magentacloud_splash_logo.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_splash.xml b/app/src/main/res/layout/activity_splash.xml index 4b54d43435dc..e43943a15a25 100644 --- a/app/src/main/res/layout/activity_splash.xml +++ b/app/src/main/res/layout/activity_splash.xml @@ -30,11 +30,12 @@ app:layout_constraintBottom_toTopOf="@+id/guideline" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:srcCompat="@drawable/nextcloud_splash_logo" /> + app:srcCompat="@drawable/ic_magentacloud_splash_logo" /> + + 4dp + 16dp + 24dp + 6dp + 18sp + 15sp + 15dp + 56dp + 86dp + 80dp + 11sp + 30dp + 55dp + 258dp + 17sp + 20dp + 160dp + 50dp + 150dp + 55dp + 48dp + 48dp + 24dp + 26dp + 20sp + 145dp + 1dp + 13sp + \ No newline at end of file diff --git a/app/src/main/res/values/dims.xml b/app/src/main/res/values/dims.xml index 4e355bc10cde..21f86373c9f2 100644 --- a/app/src/main/res/values/dims.xml +++ b/app/src/main/res/values/dims.xml @@ -154,7 +154,7 @@ 400dp 24dp 24dp - 180dp + 116dp 20sp 5 0 diff --git a/app/src/main/res/values/setup.xml b/app/src/main/res/values/setup.xml index dc03a9fcabc6..853efda8f7f3 100644 --- a/app/src/main/res/values/setup.xml +++ b/app/src/main/res/values/setup.xml @@ -119,8 +119,8 @@ - - + Magenta + CLOUD https://nominatim.openstreetmap.org/