Skip to content

Commit

Permalink
Launch Screen
Browse files Browse the repository at this point in the history
Added a branded launch screen
  • Loading branch information
Suleiman19 committed Jul 31, 2015
1 parent c8ae316 commit d591c5d
Show file tree
Hide file tree
Showing 13 changed files with 167 additions and 35 deletions.
26 changes: 13 additions & 13 deletions MaterialSample/app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/cardview-v7/22.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/22.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/palette-v7/22.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/22.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/cardview-v7/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/palette-v7/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.github.ozodrukh/CircularReveal/1.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
Expand All @@ -96,13 +96,13 @@
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="library-2.4.0" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-22.2.0" level="project" />
<orderEntry type="library" exported="" name="palette-v7-22.2.0" level="project" />
<orderEntry type="library" exported="" name="palette-v7-22.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.2.1" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-22.2.1" level="project" />
<orderEntry type="library" exported="" name="CircularReveal-1.1.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.2.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.2.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
<orderEntry type="library" exported="" name="design-22.2.0" level="project" />
<orderEntry type="library" exported="" name="cardview-v7-22.2.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.2.1" level="project" />
<orderEntry type="library" exported="" name="design-22.2.1" level="project" />
<orderEntry type="library" exported="" name="cardview-v7-22.2.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-22.2.1" level="project" />
</component>
</module>
10 changes: 5 additions & 5 deletions MaterialSample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ repositories {

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'com.android.support:palette-v7:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.android.support:cardview-v7:22.2.1'
compile 'com.android.support:palette-v7:22.2.1'
compile 'com.github.ozodrukh:CircularReveal:1.1.0'
}
23 changes: 10 additions & 13 deletions MaterialSample/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.suleiman.material" >
package="com.suleiman.material">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/MyTheme" >
android:theme="@style/MyTheme">
<activity
android:name=".activities.MainActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name" >
android:name=".activities.LaunchScreenActivity"
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=".activities.MainActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name" />
<activity
android:name=".activities.FabHideActivity"
android:configChanges="orientation|screenSize"
Expand All @@ -42,16 +45,10 @@
<activity
android:name=".activities.QuickReturnActivity"
android:configChanges="orientation|screenSize"
android:label="@string/title_quick_return"
android:uiOptions="splitActionBarWhenNarrow" >
<meta-data
android:name="android.support.UI_OPTIONS"
android:value="splitActionBarWhenNarrow" />
</activity>
android:label="@string/title_quick_return"></activity>
<activity
android:name=".activities.RevealAnimation"
android:label="@string/title_activity_reveal_animation" >
</activity>
android:label="@string/title_activity_reveal_animation"></activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package com.suleiman.material.activities;

import android.content.Intent;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.suleiman.material.R;

public class LaunchScreenActivity extends AppCompatActivity {

private static final int SPLASH_TIME = 3000;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);


// Transparent Status Bar
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}

setContentView(R.layout.activity_launch_screen);

new BackgroundTask().execute();
}


private class BackgroundTask extends AsyncTask {
Intent intent;

@Override
protected void onPreExecute() {
super.onPreExecute();

intent = new Intent(LaunchScreenActivity.this, MainActivity.class);
}

@Override
protected Object doInBackground(Object[] params) {

/* Use this method to load background
* data that your app needs. */

try {
Thread.sleep(SPLASH_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}

return null;
}

@Override
protected void onPostExecute(Object o) {
super.onPostExecute(o);
// Pass your loaded data here using Intent

// intent.putExtra("data_key", "");
startActivity(intent);
finish();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar = (Toolbar) findViewById(R.id.toolbar_elevated);
if (toolbar != null) {
setSupportActionBar(toolbar);
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed">
app:layout_scrollFlags="scroll|exitUntilCollapsed">

<ImageView
android:id="@+id/header"
Expand Down
39 changes: 39 additions & 0 deletions MaterialSample/app/src/main/res/layout/activity_launch_screen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/blue_grey"
tools:context="com.suleiman.material.activities.LaunchScreenActivity">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/splash_img" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">

<TextView
style="@style/TextAppearance.AppCompat.Display1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Material Design"
android:textColor="@android:color/primary_text_dark"
android:textStyle="bold" />

<TextView
style="@style/TextAppearance.AppCompat.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center"
android:text="Sample App"
android:textColor="@android:color/secondary_text_dark" />
</LinearLayout>


</FrameLayout>
2 changes: 1 addition & 1 deletion MaterialSample/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:fitsSystemWindows="true"
tools:context="com.suleiman.material.activities.MainActivity">

<include layout="@layout/toolbar" />
<include layout="@layout/toolbar_w_shadow" />

<FrameLayout
android:layout_width="match_parent"
Expand Down
22 changes: 22 additions & 0 deletions MaterialSample/app/src/main/res/layout/toolbar_w_shadow.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_elevated"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

<View
android:layout_width="match_parent"
android:layout_height="4dp"
android:background="@drawable/shadow" />


</LinearLayout>
2 changes: 1 addition & 1 deletion MaterialSample/app/src/main/res/menu/menu_main.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.suleiman.material.activities.RevealAnimation">
tools:context="com.suleiman.material.activities.LaunchScreenActivity">
<item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" app:showAsAction="never" />
</menu>
2 changes: 2 additions & 0 deletions MaterialSample/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<color name="accent_700">#C2185B</color>
<color name="black_trans80">#33000000</color>

<color name="blue_grey">#455A64</color>




Expand Down
1 change: 1 addition & 0 deletions MaterialSample/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
<string name="title_quick_return">Quick Return</string>
<string name="title_activity_reveal">Reveal Animation</string>
<string name="title_activity_reveal_animation">Reveal Animation</string>
<string name="title_activity_launch_screen">LaunchScreenActivity</string>
</resources>

0 comments on commit d591c5d

Please sign in to comment.