Browse Source

Added SilentDragon animated gif splash screen

dev
jahway603 4 years ago
parent
commit
5bb293eb2a
  1. 1
      app/build.gradle
  2. 11
      app/src/main/AndroidManifest.xml
  3. 28
      app/src/main/java/org/myhush/silentdragon/SplashActivity.kt
  4. 0
      app/src/main/res/drawable/silentdragon_animated_startup_dark.gif
  5. 15
      app/src/main/res/layout/activity_splash.xml
  6. 1
      app/src/main/res/values/colors.xml
  7. 2
      build.gradle

1
app/build.gradle

@ -62,6 +62,7 @@ dependencies {
implementation 'com.google.android.gms:play-services-vision:17.0.2'
implementation 'androidx.vectordrawable:vectordrawable:1.0.0'
implementation 'com.github.joshjdevl.libsodiumjni:libsodium-jni-aar:2.0.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'

11
app/src/main/AndroidManifest.xml

@ -20,6 +20,15 @@
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:allowBackup">
<activity
android:name="org.myhush.silentdragon.SplashActivity"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="org.myhush.silentdragon.SettingsActivity"
android:label="@string/title_activity_settings"
@ -62,7 +71,7 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity

28
app/src/main/java/org/myhush/silentdragon/SplashActivity.kt

@ -0,0 +1,28 @@
// Copyright 2019-2020 The Hush developers
// Released under the GPLv3
package org.myhush.silentdragon
import androidx.appcompat.app.AppCompatActivity
import android.content.Intent
import android.os.Bundle
import android.os.Handler
class SplashActivity : AppCompatActivity() {
// This is the loading time of the splash screen
private val SPLASH_TIME_OUT: Long = 3000 // 3 seconds
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_splash)
Handler().postDelayed({
// This method will be executed once the timer is over
startActivity(Intent(this,MainActivity::class.java))
// close this activity
finish()
}, SPLASH_TIME_OUT)
}
}

0
app/src/main/res/drawable/silentdragon-animated-startup-dark.gif → app/src/main/res/drawable/silentdragon_animated_startup_dark.gif

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

15
app/src/main/res/layout/activity_splash.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/splashImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/silentdragon_animated_startup_dark"/>
</LinearLayout>

1
app/src/main/res/values/colors.xml

@ -5,6 +5,7 @@
<color name="colorAccent">#FF0033</color>
<color name="windowBackground">#2F3237</color>
<color name="light_grey">#E3E3E3</color>
<color name="black">#000000</color>
<color name="white_selected">#E0FFFFFF</color>
<color name="white_unselected">#66FFFFFF</color>

2
build.gradle

@ -5,6 +5,7 @@ buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.0'
@ -19,6 +20,7 @@ allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Loading…
Cancel
Save