This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.wajahatkarim.splashscreen | |
import android.content.Intent | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import kotlinx.coroutines.cancel | |
import java.util.* | |
import kotlin.concurrent.schedule | |
class TimerSplashActivity : AppCompatActivity() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.wajahatkarim.splashscreen | |
import android.content.Intent | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import kotlinx.coroutines.* | |
class CoroutinesSplashActivity : AppCompatActivity() { | |
val activityScope = CoroutineScope(Dispatchers.Main) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def nav_version = "2.1.0" | |
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" | |
implementation "androidx.navigation:navigation-ui-ktx:$nav_version" | |
// For BottomNavigationView from Material Components | |
implementation 'com.google.android.material:material:1.0.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout 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" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<FrameLayout | |
android:layout_width="match_parent" | |
android:layout_height="0dp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<fragment | |
android:id="@+id/fragNavHost" | |
android:name="androidx.navigation.fragment.NavHostFragment" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
app:defaultNavHost="true" | |
app:navGraph="@navigation/bottom_nav_graph" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun setupViews() | |
{ | |
// Finding the Navigation Controller | |
var navController = findNavController(R.id.fragNavHost) | |
// Setting Navigation Controller with the BottomNavigationView | |
bottomNavView.setupWithNavController(navController) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun setupViews() | |
{ | |
// Finding the Navigation Controller | |
var navController = findNavController(R.id.fragNavHost) | |
// Setting Navigation Controller with the BottomNavigationView | |
bottomNavView.setupWithNavController(navController) | |
// Setting Up ActionBar with Navigation Controller | |
setupActionBarWithNavController(navController) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun setupViews() | |
{ | |
// Finding the Navigation Controller | |
var navController = findNavController(R.id.fragNavHost) | |
// Setting Navigation Controller with the BottomNavigationView | |
bottomNavView.setupWithNavController(navController) | |
// Setting Up ActionBar with Navigation Controller | |
// Pass the IDs of top-level destinations in AppBarConfiguration |