Skip to content

Commit 67e2304

Browse files
committed
🚀 added splash screen as the home in navigation graph.
1 parent 4a93415 commit 67e2304

File tree

68 files changed

+174
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+174
-131
lines changed
32.1 KB

app/src/main/java/com/matrix/studyjournal/HostActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ import dagger.hilt.android.AndroidEntryPoint
1414
@AndroidEntryPoint
1515
class HostActivity : AppCompatActivity(R.layout.activity_host) {
1616

17+
1718
override fun onCreate(savedInstanceState: Bundle?) {
19+
// setTheme(R.style.Theme_StudyJournal)
1820
setupFragmentFactory()
1921
super.onCreate(savedInstanceState)
2022
setSupportActionBar(findViewById(R.id.toolbar))
@@ -24,7 +26,7 @@ class HostActivity : AppCompatActivity(R.layout.activity_host) {
2426
private fun setupNavController() {
2527
findViewById<Toolbar>(R.id.toolbar).setupWithNavController(
2628
findNavController(),
27-
AppBarConfiguration.Builder(R.id.mainFragment, R.id.timerFragment).build()
29+
AppBarConfiguration.Builder(R.id.splashFragment, R.id.mainFragment, R.id.timerFragment).build()
2830
)
2931
}
3032

app/src/main/java/com/matrix/studyjournal/di/InjectFactoryModule.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.matrix.studyNote.ui.details.DetailsFragment
1010
import com.matrix.studyNote.ui.note.NoteFragment
1111
import com.matrix.studyNote.ui.sessionDialog.SessionDialogFragment
1212
import com.matrix.core.di.FragmentKey
13+
import com.matrix.main.ui.splashscreen.SplashFragment
1314
import dagger.Binds
1415
import dagger.Module
1516
import dagger.hilt.InstallIn
@@ -20,6 +21,11 @@ import dagger.multibindings.IntoMap
2021
@InstallIn(SingletonComponent::class)
2122
interface InjectFactoryModule {
2223

24+
@Binds
25+
@IntoMap
26+
@FragmentKey(SplashFragment::class)
27+
fun bindSplashFragment(fragment: SplashFragment): Fragment
28+
2329
@Binds
2430
@IntoMap
2531
@FragmentKey(MainFragment::class)

app/src/main/java/com/matrix/studyjournal/navigation/AppDirections.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11

22
package com.matrix.studyjournal.navigation
33

4+
import androidx.navigation.NavDirections
45
import com.matrix.core.utils.navigation.GlobalDirections
56
import com.matrix.core.utils.navigation.models.Properties
67
import com.matrix.main.ui.MainFragmentDirections
8+
import com.matrix.main.ui.splashscreen.SplashFragmentDirections
79
import com.matrix.timer.ui.TimerFragmentDirections
810
import com.matrix.studyNote.ui.sessionDialog.SessionDialogFragmentDirections
911
import javax.inject.Inject
@@ -12,6 +14,10 @@ import javax.inject.Inject
1214
* Default implementation of [GlobalDirections] interface.
1315
*/
1416
class AppDirections @Inject constructor() : GlobalDirections {
17+
18+
override fun fromSplashToMain() =
19+
SplashFragmentDirections.actionSplashFragmentToMainFragment()
20+
1521
override fun fromSessionDialogToTimer(properties: Properties) =
1622
SessionDialogFragmentDirections.actionSessionFragmentToTimerFragment(properties)
1723

app/src/main/res/drawable-v24/ic_launcher_foreground.xml

Lines changed: 0 additions & 31 deletions
This file was deleted.

app/src/main/res/drawable/ic_launcher_background.xml

Lines changed: 0 additions & 74 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<item
5+
android:drawable="@color/blue_500"/>
6+
7+
<item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/ic_launcher"/>
11+
</item>
12+
13+
</layer-list>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3-
<background android:drawable="@drawable/ic_launcher_background"/>
4-
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
3+
<background android:drawable="@color/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
55
</adaptive-icon>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3-
<background android:drawable="@drawable/ic_launcher_background"/>
4-
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
3+
<background android:drawable="@color/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
55
</adaptive-icon>
-3.65 KB
Binary file not shown.

0 commit comments

Comments
 (0)