Skip to content

Commit

Permalink
Implemented the splash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
WillWcchan committed Jul 20, 2020
1 parent 642fc2e commit 6ec3479
Show file tree
Hide file tree
Showing 24 changed files with 111 additions and 181 deletions.
19 changes: 12 additions & 7 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.DayNight.NoActionBar">
<activity
android:name=".splashscreens.SplashScreenActivity"
android:theme="@style/Theme.Design.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".activities.AboutActivity"
android:parentActivityName=".MainActivity">
Expand All @@ -18,13 +27,9 @@
android:name="android.support.PARENT_ACTIVITY"
android:value="com.willchan.simple_random_stock.MainActivity" />
</activity>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:theme="@style/AppTheme" />
</application>

</manifest>
Binary file added app/src/main/ic_launcher-playstore.png
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
@@ -0,0 +1,27 @@
package com.willchan.simple_random_stock.splashscreens;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import androidx.appcompat.app.AppCompatActivity;

import com.willchan.simple_random_stock.MainActivity;
import com.willchan.simple_random_stock.R;

public class SplashScreenActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);

new Handler().postDelayed(new Runnable() {
@Override
public void run() {
startActivity(new Intent(SplashScreenActivity.this, MainActivity.class));
finish(); // to prevent back button from going back to splash screen
}
}, 2000);
}
}
Binary file added app/src/main/res/drawable-v24/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
170 changes: 0 additions & 170 deletions app/src/main/res/drawable/ic_launcher_background.xml

This file was deleted.

25 changes: 25 additions & 0 deletions app/src/main/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group
android:scaleX="0.12228674"
android:scaleY="0.12228674"
android:translateX="22.694595"
android:translateY="22.694595">
<group>
<clip-path android:pathData="M81,81h350v350h-350z" />
<path
android:fillColor="#000000"
android:fillType="evenOdd"
android:pathData="M402.049,431H109.95V81H331.146L402.049,156.295V431H402.049ZM378.286,405.867V173.174H313.674V103.298H133.971V405.867H378.287H378.286Z" />
<group>
<clip-path android:pathData="M163,198h185v146h-185z" />
<path
android:fillColor="#000000"
android:pathData="M166.268,344C164.477,344 163,342.461 163,340.575C163,338.688 164.477,337.149 166.268,337.149H180.058V232.353C180.058,231.261 180.461,230.268 181.088,229.573C181.76,228.828 182.655,228.381 183.64,228.381H203.25C204.235,228.381 205.131,228.828 205.803,229.573C206.474,230.318 206.832,231.31 206.832,232.353V337.149H221.428V262.734C221.428,261.642 221.831,260.649 222.458,259.954C223.129,259.259 224.025,258.813 224.965,258.813H244.576C245.561,258.813 246.456,259.259 247.128,260.004C247.799,260.749 248.202,261.742 248.202,262.834V337.249H262.798V202.071C262.798,200.979 263.201,199.986 263.828,199.291C264.499,198.546 265.395,198.149 266.38,198.149H285.99C286.975,198.149 287.871,198.596 288.497,199.34C289.169,200.085 289.572,201.078 289.572,202.17V337.348H304.168V241.239C304.168,240.147 304.571,239.154 305.242,238.409C305.914,237.665 306.809,237.268 307.794,237.268H327.405C328.39,237.268 329.285,237.714 329.957,238.409C330.628,239.154 331.031,240.147 331.031,241.239V337.348H344.821C346.612,337.348 348.09,338.887 348.09,340.773C348.09,342.66 346.612,344.199 344.821,344.199H166.358L166.268,344ZM200.295,235.679H186.595V336.752H200.295V235.679ZM241.665,266.061H227.965V336.752H241.665V266.061ZM283.035,205.298H269.335V336.752H283.035V205.298ZM324.405,244.367H310.704V336.752H324.405V244.367Z" />
</group>
</group>
</group>
</vector>
30 changes: 30 additions & 0 deletions app/src/main/res/layout/activity_splash_screen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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/splashscreen"
tools:context=".splashscreens.SplashScreenActivity">

<ImageView
android:id="@+id/logo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:contentDescription="@string/app_logo"
android:foregroundGravity="center"
android:padding="40sp"
android:src="@drawable/logo" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/logo"
android:layout_marginLeft="10sp"
android:layout_marginTop="30sp"
android:layout_marginRight="10sp"
android:layout_marginBottom="10sp"
android:gravity="center"
android:text="@string/app_name"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline3" />
</RelativeLayout>
2 changes: 2 additions & 0 deletions app/src/main/res/layout/list_row_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
android:id="@+id/stock_ticker_history"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10sp"
android:layout_marginLeft="10sp"
android:text="@string/stock_ticker"
android:textAppearance="@style/Widget.MaterialComponents.CardView"
android:textSize="14sp" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<background android:drawable="@color/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
2 changes: 1 addition & 1 deletion app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<background android:drawable="@color/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.png
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 app/src/main/res/mipmap-hdpi/ic_launcher_round.png
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 app/src/main/res/mipmap-mdpi/ic_launcher.png
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 app/src/main/res/mipmap-mdpi/ic_launcher_round.png
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 app/src/main/res/mipmap-xhdpi/ic_launcher.png
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 app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
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 app/src/main/res/mipmap-xxhdpi/ic_launcher.png
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 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
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 app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
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 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
<color name="colorAccent">#03DAC5</color>
<color name="redMarket">#E11B1B</color>
<color name="greenMarket">#2EFF00</color>
<color name="white">#FFFFFF</color>
<color name="splashscreen">#77B1DC</color>
</resources>
4 changes: 4 additions & 0 deletions app/src/main/res/values/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#77B1DC</color>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Simple-Random-Stock</string>
<string name="app_name">Simple Random Stock</string>
<string name="email_address">willwcchan@gmail.com</string>
<string name="contact_information">Contact Information:</string>
<string name="author_name">Author: William Chan</string>
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>

<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>

<style name="Button1Style" parent="Theme.AppCompat.Light">
Expand All @@ -23,4 +24,8 @@
<item name="colorButtonNormal">#E91E63</item>
<item name="colorControlHighlight">#FCE4EC</item>
</style>

<!-- <style name="SplashScreen" parent="Theme.AppCompat.Light.NoActionBar">-->
<!-- <item name="android:windowBackground">@drawable/background_splashscreen</item>-->
<!-- </style>-->
</resources>

0 comments on commit 6ec3479

Please sign in to comment.