diff --git a/app/build.gradle b/app/build.gradle index 64ea16800a2..22479f62151 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -79,6 +79,7 @@ dependencies { 'androidx.test.ext:junit:1.1.1', 'androidx.test:runner:1.2.0', 'com.google.truth:truth:0.43', + 'androidx.test.espresso:espresso-intents:3.1.0', ) androidTestUtil( 'androidx.test:orchestrator:1.2.0', diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e6248d90d9f..d7c9ef442f5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -23,5 +23,8 @@ + + diff --git a/app/src/main/java/org/oppia/app/splash/SplashActivity.kt b/app/src/main/java/org/oppia/app/splash/SplashActivity.kt new file mode 100644 index 00000000000..cdd6be10f7e --- /dev/null +++ b/app/src/main/java/org/oppia/app/splash/SplashActivity.kt @@ -0,0 +1,22 @@ +package org.oppia.app.splash + +import android.content.Intent +import android.os.Bundle +import android.view.WindowManager +import androidx.appcompat.app.AppCompatActivity +import org.oppia.app.R +import org.oppia.app.home.HomeActivity + +/** An activity that shows a temporary loading page until the app is fully loaded then navigates to [HomeActivity]. */ +class SplashActivity : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.splash_activity) + + getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + val intent = Intent(this@SplashActivity, HomeActivity::class.java) + startActivity(intent) + finish() + } +} diff --git a/app/src/main/res/anim/fade_in.xml b/app/src/main/res/anim/fade_in.xml new file mode 100644 index 00000000000..37b4726f315 --- /dev/null +++ b/app/src/main/res/anim/fade_in.xml @@ -0,0 +1,5 @@ + + diff --git a/app/src/main/res/anim/fade_out.xml b/app/src/main/res/anim/fade_out.xml new file mode 100644 index 00000000000..9dd0951cc63 --- /dev/null +++ b/app/src/main/res/anim/fade_out.xml @@ -0,0 +1,6 @@ + + diff --git a/app/src/main/res/drawable/splash_page.xml b/app/src/main/res/drawable/splash_page.xml new file mode 100644 index 00000000000..96790799d5d --- /dev/null +++ b/app/src/main/res/drawable/splash_page.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/layout/splash_activity.xml b/app/src/main/res/layout/splash_activity.xml new file mode 100644 index 00000000000..a6df0fd332b --- /dev/null +++ b/app/src/main/res/layout/splash_activity.xml @@ -0,0 +1,10 @@ + + + + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 83e6f4fa98a..d9c61be15b7 100755 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,5 +1,8 @@ + 1000 + 1000 + 8dp 32dp 24dp diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 56954dc831d..f5695ca647d 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -7,6 +7,26 @@ @color/colorPrimary + + + + + + +