Skip to content

Commit

Permalink
Merge pull request #97 from KhalisFoundation/fix-splashScreen
Browse files Browse the repository at this point in the history
feat: added splash screen for android
  • Loading branch information
amitojsingh authored Apr 28, 2022
2 parents b657491 + d5c41e0 commit 7b3f782
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 16 deletions.
25 changes: 9 additions & 16 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.WahegurooNetwork.SundarGutka">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.WahegurooNetwork.SundarGutka">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme">
<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 android:name=".MainActivity" android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask" android:windowSoftInputMode="adjustResize">
</activity>
</application>
</manifest>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.WahegurooNetwork.SundarGutka;

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();
}
}
13 changes: 13 additions & 0 deletions android/app/src/main/res/drawable/backgroud_splash.xml
Original file line number Diff line number Diff line change
@@ -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/primary_dark"/>

<item
android:width="600dp"
android:height="600dp"
android:drawable="@mipmap/ic_launcher_foreground"
android:gravity="center" />

</layer-list>
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@
<item name="colorAccent">@color/primary_accent</item>
</style>

<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:statusBarColor">@color/primary_dark</item>
<item name="android:background">@drawable/backgroud_splash</item>
</style>
</resources>

0 comments on commit 7b3f782

Please sign in to comment.