Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-3.28] Splash #143

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 7 additions & 21 deletions app/src/androidTest/java/com/nmc/android/ui/LauncherActivityIT.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
}
}
16 changes: 16 additions & 0 deletions app/src/main/res/drawable/ic_magentacloud_splash_logo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="300"
android:viewportHeight="300">
<group>
<path
android:fillColor="#fff"
android:pathData="M132.225,229.086a74.15,74.15 0,0 1,-51.084 -20.293,40.579 40.579,0 0,1 -8.912,0.987 39.97,39.97 0,0 1,-15.658 -3.161,40.09 40.09,0 0,1 -12.787,-8.621 40.115,40.115 0,0 1,-8.621 -12.785,39.961 39.961,0 0,1 -3.162,-15.658 40.1,40.1 0,0 1,2.387 -13.68,40.106 40.106,0 0,1 6.6,-11.664 40.32,40.32 0,0 1,9.977 -8.812,39.926 39.926,0 0,1 12.516,-5.121 39.934,39.934 0,0 1,39.859 -37.62,39.943 39.943,0 0,1 11.367,1.643 67.41,67.41 0,0 1,10.424 -10.856,67.1 67.1,0 0,1 12.627,-8.292 66.608,66.608 0,0 1,14.4 -5.293,67.237 67.237,0 0,1 15.738,-1.861 66.685,66.685 0,0 1,23.594 4.277,66.635 66.635,0 0,1 19.91,11.789 66.96,66.96 0,0 1,14.668 17.739,66.3 66.3,0 0,1 7.859,22.125 42.649,42.649 0,0 1,13.533 5.4,43.075 43.075,0 0,1 10.8,9.421 42.77,42.77 0,0 1,7.15 12.529,42.849 42.849,0 0,1 2.588,14.725 42.727,42.727 0,0 1,-3.381 16.736,42.812 42.812,0 0,1 -9.215,13.667 42.849,42.849 0,0 1,-13.668 9.215,42.725 42.725,0 0,1 -16.736,3.379 43.219,43.219 0,0 1,-4.557 -0.237,39.822 39.822,0 0,1 -13.168,9.656 39.628,39.628 0,0 1,-16.52 3.567,39.58 39.58,0 0,1 -17.539,-4.044v-50.322h33.172l-50.49,-51.667 -50.787,51.667h33.465v61.2C136.477,228.994 134.34,229.086 132.225,229.086Z" />
<path
android:strokeAlpha="0.2"
android:fillColor="#E20074"
android:fillAlpha="0.2"
android:pathData="M206.388,179.173L173.216,179.173L173.216,167.62L195.098,167.62l11.288,11.551ZM138.577,179.173L104.816,179.173L116.237,167.62h22.34L138.577,179.172Z" />
</group>
</vector>
3 changes: 2 additions & 1 deletion app/src/main/res/layout/activity_splash.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-10dp"
android:gravity="center_horizontal"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
31 changes: 31 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="grid_recyclerview_padding">4dp</dimen>
<dimen name="list_item_icons_size">16dp</dimen>
<dimen name="grid_item_icons_size">24dp</dimen>
<dimen name="media_grid_item_rv_spacing">6dp</dimen>
<dimen name="txt_size_18sp">18sp</dimen>
<dimen name="txt_size_15sp">15sp</dimen>
<dimen name="crop_corner_size">15dp</dimen>
<dimen name="edit_scan_bottom_bar_height">56dp</dimen>
<dimen name="standard_folders_grid_item_size">86dp</dimen>
<dimen name="standard_files_grid_item_size">80dp</dimen>
<dimen name="txt_size_11sp">11sp</dimen>
<dimen name="share_row_icon_size">30dp</dimen>
<dimen name="create_link_button_height">55dp</dimen>
<dimen name="note_et_height">258dp</dimen>
<dimen name="txt_size_17sp">17sp</dimen>
<dimen name="share_exp_date_divider_margin">20dp</dimen>
<dimen name="privacy_btn_width">160dp</dimen>
<dimen name="privacy_icon_size">50dp</dimen>
<dimen name="login_btn_width">150dp</dimen>
<dimen name="login_btn_height">55dp</dimen>
<dimen name="login_btn_bottom_margin">48dp</dimen>
<dimen name="login_btn_bottom_margin_land">48dp</dimen>
<dimen name="login_btn_bottom_margin_small_screen">24dp</dimen>
<dimen name="shared_with_me_icon_size">26dp</dimen>
<dimen name="txt_size_20sp">20sp</dimen>
<dimen name="notification_row_item_height">145dp</dimen>
<dimen name="button_stroke_width">1dp</dimen>
<dimen name="txt_size_13sp">13sp</dimen>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/dims.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<dimen name="default_login_width">400dp</dimen>
<dimen name="dialogBorderRadius">24dp</dimen>
<dimen name="dialog_padding">24dp</dimen>
<dimen name="splash_image_size">180dp</dimen>
<dimen name="splash_image_size">116dp</dimen>
<dimen name="splash_text_size">20sp</dimen>
<integer name="small_margin">5</integer>
<integer name="zero">0</integer>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@
<string name="push_server_url" translatable="false"></string>

<!-- if contains values, will be used to show branding title below app icon in splash screen -->
<string name="splashScreenBold"></string>
<string name="splashScreenNormal"></string>
<string name="splashScreenBold">Magenta</string>
<string name="splashScreenNormal">CLOUD</string>

<!-- Geocoding -->
<string name="osm_geocoder_url" translatable="false">https://nominatim.openstreetmap.org/</string>
Expand Down