Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splashcreen #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'

//Splashscreen api dependency
def splashScreen_version = "1.0.0-beta02"
implementation "androidx.core:core-splashscreen:$splashScreen_version"
}
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">


<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
Expand All @@ -16,7 +17,7 @@
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.GADSHealthTeam8.NoActionBar">
android:theme="@style/Theme.App.SplashScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
12 changes: 12 additions & 0 deletions app/src/main/java/com/example/gadshealthteam8/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.example.gadshealthteam8

import android.os.Bundle
import android.view.Menu
import android.window.SplashScreen
import com.google.android.material.snackbar.Snackbar
import com.google.android.material.navigation.NavigationView
import androidx.navigation.findNavController
Expand All @@ -11,7 +12,10 @@ import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import androidx.drawerlayout.widget.DrawerLayout
import androidx.appcompat.app.AppCompatActivity
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.example.gadshealthteam8.databinding.ActivityMainBinding
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking

class MainActivity : AppCompatActivity() {

Expand All @@ -20,6 +24,14 @@ class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//Delay splashscreen
runBlocking {
delay(3000)
}

//Splashscreen instance
installSplashScreen()


binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_logo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="160dp" android:viewportHeight="130"
android:viewportWidth="130" android:width="160dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#00639C" android:pathData="M0,0h129.6v129.6h-129.6z"/>
<path android:fillColor="#ffffff" android:pathData="M58.5,58.58C58.41,57.04 58.04,55.58 57.4,54.21C56.76,52.83 55.83,51.71 54.62,50.85C53.4,49.98 51.85,49.55 49.96,49.55C47.98,49.55 46.46,50.11 45.4,51.23C44.34,52.35 43.82,53.66 43.82,55.17C43.82,56.51 44.2,57.65 44.97,58.58C45.74,59.47 46.73,60.27 47.94,60.98C49.19,61.65 50.5,62.3 51.88,62.94C53.1,63.49 54.31,64.08 55.53,64.72C56.74,65.33 57.85,66.03 58.84,66.83C59.83,67.63 60.62,68.59 61.19,69.71C61.8,70.8 62.1,72.11 62.1,73.65C62.1,75.41 61.66,76.98 60.76,78.35C59.9,79.73 58.63,80.82 56.97,81.62C55.3,82.38 53.27,82.77 50.87,82.77C49.43,82.77 47.94,82.56 46.41,82.14C44.87,81.73 43.51,81.12 42.33,80.32L42.57,82.38H40.07L39.78,72.16H41.66C41.82,74.98 42.79,77.12 44.58,78.59C46.38,80.03 48.54,80.75 51.06,80.75C52.31,80.75 53.46,80.53 54.52,80.08C55.58,79.6 56.41,78.91 57.02,78.02C57.66,77.12 57.98,76.03 57.98,74.75C57.98,73.31 57.59,72.11 56.82,71.15C56.06,70.19 55.06,69.36 53.85,68.66C52.63,67.95 51.34,67.28 49.96,66.64C48.74,66.1 47.54,65.52 46.36,64.91C45.18,64.3 44.09,63.62 43.1,62.85C42.14,62.05 41.35,61.1 40.74,60.02C40.17,58.93 39.88,57.62 39.88,56.08C39.88,55.25 40.02,54.35 40.31,53.39C40.6,52.43 41.1,51.52 41.8,50.66C42.54,49.76 43.53,49.04 44.78,48.5C46.06,47.92 47.67,47.63 49.62,47.63C50.84,47.63 52.2,47.81 53.7,48.16C55.24,48.48 56.66,49.12 57.98,50.08L57.78,48.02H60.23V58.58H58.5ZM81.75,80.56C82.75,80.56 83.43,80.32 83.82,79.84C84.2,79.33 84.43,78.64 84.49,77.78C84.55,76.88 84.59,75.86 84.59,74.7V67.98C84.59,65.23 84.14,63.17 83.24,61.79C82.38,60.42 81,59.74 79.11,59.78C77.93,59.81 76.76,60.1 75.61,60.64C74.49,61.18 73.58,61.89 72.87,62.75V76.91C72.87,77.55 72.86,78.13 72.83,78.64C72.79,79.12 72.73,79.63 72.63,80.18C73.15,80.14 73.64,80.13 74.12,80.13C74.63,80.1 75.15,80.06 75.66,80.03V82H65.87V80.56C66.86,80.56 67.55,80.32 67.93,79.84C68.31,79.33 68.54,78.64 68.6,77.78C68.7,76.88 68.75,75.86 68.75,74.7V52C68.75,51.49 68.75,51.01 68.75,50.56C68.78,50.08 68.83,49.52 68.89,48.88C68.31,48.91 67.74,48.94 67.16,48.98C66.62,49.01 66.06,49.04 65.48,49.07V47.06C66.89,47.06 67.98,46.99 68.75,46.86C69.55,46.74 70.14,46.58 70.52,46.38C70.94,46.19 71.26,45.98 71.48,45.76H72.87V60.4C73.58,59.79 74.36,59.26 75.23,58.82C76.12,58.34 77.03,57.95 77.96,57.66C78.92,57.38 79.85,57.23 80.75,57.23C83.53,57.23 85.53,58.11 86.75,59.87C87.99,61.6 88.63,64.3 88.67,67.98L88.71,76.91C88.71,77.55 88.7,78.13 88.67,78.64C88.67,79.12 88.62,79.63 88.52,80.18C89.03,80.14 89.53,80.13 90.01,80.13C90.52,80.1 91.03,80.06 91.55,80.03V82H81.75V80.56Z"/>
</vector>
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="blue_1">#CFE5FF</color>
</resources>
14 changes: 14 additions & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,18 @@
<style name="Theme.GADSHealthTeam8.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="Theme.GADSHealthTeam8.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />


<!--Splash Screen theme goes Here-->
<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
<!--Splashscreen Background colour-->
<item name="windowSplashScreenBackground">@color/blue_1</item>
<!--Splashscreen icon -->
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_logo</item>
<!--Theme for Activity after splash-->
<item name="postSplashScreenTheme">@style/Theme.GADSHealthTeam8.NoActionBar</item>

</style>


</resources>