mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-28 10:22:38 +03:00
added splash screen config in android
This commit is contained in:
parent
a4d8edc311
commit
dfaa73286a
@ -28,16 +28,25 @@
|
|||||||
android:allowBackup="false"
|
android:allowBackup="false"
|
||||||
android:largeHeap="true"
|
android:largeHeap="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
|
|
||||||
|
<!-- Add this SplashActivity -->
|
||||||
|
<activity
|
||||||
|
android:name=".SplashActivity"
|
||||||
|
android:theme="@style/SplashTheme"
|
||||||
|
android:label="@string/app_name">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
||||||
android:windowSoftInputMode="adjustResize">
|
android:windowSoftInputMode="adjustResize"
|
||||||
<intent-filter>
|
android:exported="true">
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<intent-filter android:label="Ecency" android:autoVerify="true">
|
<intent-filter android:label="Ecency" android:autoVerify="true">
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
16
android/app/src/main/java/app/esteem/SplashActivity.java
Normal file
16
android/app/src/main/java/app/esteem/SplashActivity.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package app.esteem.mobile.android;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
public class SplashActivity extends AppCompatActivity {
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
Intent intent = new Intent(this, MainActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
@ -6,6 +6,8 @@ import com.facebook.react.ReactRootView;
|
|||||||
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
|
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
|
import org.devio.rn.splashscreen.SplashScreen;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
public class MainActivity extends ReactActivity {
|
public class MainActivity extends ReactActivity {
|
||||||
/**
|
/**
|
||||||
@ -33,6 +35,11 @@ public class MainActivity extends ReactActivity {
|
|||||||
setIntent(intent);
|
setIntent(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
SplashScreen.show(this);
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
//native side reference: https://github.com/facebook/react-native/issues/28823#issuecomment-642032481
|
//native side reference: https://github.com/facebook/react-native/issues/28823#issuecomment-642032481
|
||||||
@Override
|
@Override
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
|
13
android/app/src/main/res/drawable/background_splash.xml
Normal file
13
android/app/src/main/res/drawable/background_splash.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:drawable="@color/splashscreen_bg"/>
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:width="300dp"
|
||||||
|
android:height="300dp"
|
||||||
|
android:drawable="@mipmap/splash_icon"
|
||||||
|
android:gravity="center" />
|
||||||
|
|
||||||
|
</layer-list>
|
7
android/app/src/main/res/layout/launch_screen.xml
Normal file
7
android/app/src/main/res/layout/launch_screen.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/background_splash"
|
||||||
|
android:orientation="vertical">
|
||||||
|
</LinearLayout>
|
BIN
android/app/src/main/res/mipmap-hdpi/splash_icon.png
Normal file
BIN
android/app/src/main/res/mipmap-hdpi/splash_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
BIN
android/app/src/main/res/mipmap-mdpi/splash_icon.png
Normal file
BIN
android/app/src/main/res/mipmap-mdpi/splash_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.0 KiB |
BIN
android/app/src/main/res/mipmap-xhdpi/splash_icon.png
Normal file
BIN
android/app/src/main/res/mipmap-xhdpi/splash_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
BIN
android/app/src/main/res/mipmap-xxhdpi/splash_icon.png
Normal file
BIN
android/app/src/main/res/mipmap-xxhdpi/splash_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
BIN
android/app/src/main/res/mipmap-xxxhdpi/splash_icon.png
Normal file
BIN
android/app/src/main/res/mipmap-xxxhdpi/splash_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
@ -3,4 +3,6 @@
|
|||||||
<item name="splashBackground" type="color">#ffffff</item>
|
<item name="splashBackground" type="color">#ffffff</item>
|
||||||
<item name="notification_icon" type="color">#ffffff</item>
|
<item name="notification_icon" type="color">#ffffff</item>
|
||||||
<color name="primary_dark">#000000</color>
|
<color name="primary_dark">#000000</color>
|
||||||
|
<color name="splashscreen_bg">#ffffff</color>
|
||||||
|
<color name="app_bg">#ffffff</color>
|
||||||
</resources>
|
</resources>
|
@ -1,6 +1,23 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
|
<!-- Base application theme. -->
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<item name="android:windowExitAnimation">@android:anim/fade_out</item>
|
<!-- Customize your theme here. -->
|
||||||
<item name="android:editTextBackground">@android:color/transparent</item>
|
<item name="android:textColor">#000000</item>
|
||||||
|
|
||||||
|
<!-- Add the following line to set the default status bar color for all the app. -->
|
||||||
|
<item name="android:statusBarColor">@color/app_bg</item>
|
||||||
|
<!-- Add the following line to set the default status bar text color for all the app
|
||||||
|
to be a light color (false) or a dark color (true) -->
|
||||||
|
<item name="android:windowLightStatusBar">false</item>
|
||||||
|
<!-- Add the following line to set the default background color for all the app. -->
|
||||||
|
<item name="android:windowBackground">@color/app_bg</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
|
||||||
|
<!-- Adds the splash screen definition -->
|
||||||
|
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
|
<item name="android:statusBarColor">@color/splashscreen_bg</item>
|
||||||
|
<item name="android:background">@drawable/background_splash</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</resources>
|
@ -839,4 +839,4 @@ SPEC CHECKSUMS:
|
|||||||
|
|
||||||
PODFILE CHECKSUM: 0282022703ad578ab2d9afbf3147ba3b373b4311
|
PODFILE CHECKSUM: 0282022703ad578ab2d9afbf3147ba3b373b4311
|
||||||
|
|
||||||
COCOAPODS: 1.11.3
|
COCOAPODS: 1.11.2
|
||||||
|
Loading…
Reference in New Issue
Block a user