Commit 56b6d2b5 authored by Varun Patil's avatar Varun Patil

Add splash screen (WIP)

parent 65911895
......@@ -76,20 +76,20 @@
android:scheme="https" />
</intent-filter>
</activity>
<activity
android:name=".activity.LoginActivity"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".activity.SplashActivity"
android:screenOrientation="portrait"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="HANDLE_AUTHORIZATION_RESPONSE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<service android:name=".InstiAppFirebaseMessagingService">
......
package app.insti.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import app.insti.SessionManager;
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SessionManager session = new SessionManager(this);
Intent intent;
/* Skip inflating login activity if logged in */
if (session.isLoggedIn()) {
intent = new Intent(this, MainActivity.class);
} else {
intent = new Intent(this, LoginActivity.class);
}
startActivity(intent);
finish();
}
}
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorPrimary" />
<item>
<bitmap android:src="@drawable/lotus_sq"
android:gravity="center" />
</item>
</layer-list>
\ No newline at end of file
......@@ -18,6 +18,10 @@
<item name="windowNoTitle">true</item>
</style>
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/background</item>
</style>
<style name="AppThemeDark" parent="Theme.AppCompat">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment