From f51886bd5cec9b78e52d380ad45204bd63e191bd Mon Sep 17 00:00:00 2001 From: Femi Ogundipe Date: Mon, 14 Oct 2024 14:43:05 +0100 Subject: [PATCH] Implement SplashScreen for Tables --- tables_app/build.gradle | 1 + tables_app/src/main/AndroidManifest.xml | 2 +- .../tables/activities/MainActivity.java | 3 + .../main/res/drawable-night/odkx_splash.xml | 212 ++++++++++++++++++ .../src/main/res/drawable/odkx_splash.xml | 212 ++++++++++++++++++ tables_app/src/main/res/values/styles.xml | 8 + 6 files changed, 437 insertions(+), 1 deletion(-) create mode 100644 tables_app/src/main/res/drawable-night/odkx_splash.xml create mode 100644 tables_app/src/main/res/drawable/odkx_splash.xml create mode 100644 tables_app/src/main/res/values/styles.xml diff --git a/tables_app/build.gradle b/tables_app/build.gradle index ac9ca8d8..02fab3d2 100644 --- a/tables_app/build.gradle +++ b/tables_app/build.gradle @@ -113,6 +113,7 @@ allprojects { dependencies { implementation 'org.opendatakit:odkx-rest-interface:2.2.0-SNAPSHOT' + implementation 'androidx.core:core-splashscreen:1.0.1' implementation 'androidx.annotation:annotation:1.7.1' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.fragment:fragment:1.5.7' diff --git a/tables_app/src/main/AndroidManifest.xml b/tables_app/src/main/AndroidManifest.xml index 821d8fb9..878160aa 100644 --- a/tables_app/src/main/AndroidManifest.xml +++ b/tables_app/src/main/AndroidManifest.xml @@ -32,7 +32,7 @@ android:icon="@drawable/odk_tables_ab_icon" android:label="@string/app_name" android:logo="@drawable/odk_tables_ab_icon" - android:theme="@style/ODKX" + android:theme="@style/SplashTheme" android:allowBackup="false" android:largeHeap="true" android:installLocation="auto" diff --git a/tables_app/src/main/java/org/opendatakit/tables/activities/MainActivity.java b/tables_app/src/main/java/org/opendatakit/tables/activities/MainActivity.java index de4b81d1..c2d2564a 100644 --- a/tables_app/src/main/java/org/opendatakit/tables/activities/MainActivity.java +++ b/tables_app/src/main/java/org/opendatakit/tables/activities/MainActivity.java @@ -17,6 +17,8 @@ import android.app.ActionBar; import android.app.Activity; + +import androidx.core.splashscreen.SplashScreen; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager.BackStackEntry; @@ -168,6 +170,7 @@ public Integer getIndexOfSelectedItem() { */ @Override protected void onCreate(Bundle savedInstanceState) { + SplashScreen.installSplashScreen(this); super.onCreate(savedInstanceState); this.setContentView(R.layout.activity_main_activity); diff --git a/tables_app/src/main/res/drawable-night/odkx_splash.xml b/tables_app/src/main/res/drawable-night/odkx_splash.xml new file mode 100644 index 00000000..8235f7ee --- /dev/null +++ b/tables_app/src/main/res/drawable-night/odkx_splash.xml @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tables_app/src/main/res/drawable/odkx_splash.xml b/tables_app/src/main/res/drawable/odkx_splash.xml new file mode 100644 index 00000000..4a2134ac --- /dev/null +++ b/tables_app/src/main/res/drawable/odkx_splash.xml @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tables_app/src/main/res/values/styles.xml b/tables_app/src/main/res/values/styles.xml new file mode 100644 index 00000000..9538bd14 --- /dev/null +++ b/tables_app/src/main/res/values/styles.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file