kopia lustrzana https://github.com/rt-bishop/Look4Sat
Altered bottom navigation view back stack saving
rodzic
a0c6ceef15
commit
80ba3644f7
|
@ -56,10 +56,11 @@ android {
|
|||
|
||||
dependencies {
|
||||
implementation project(":core")
|
||||
implementation "com.google.android.material:material:1.5.0"
|
||||
implementation "androidx.appcompat:appcompat:1.4.1"
|
||||
implementation "androidx.fragment:fragment-ktx:1.4.1"
|
||||
implementation "androidx.core:core-ktx:1.7.0"
|
||||
implementation "androidx.core:core-splashscreen:1.0.0-beta01"
|
||||
implementation "androidx.appcompat:appcompat:1.4.1"
|
||||
implementation "com.google.android.material:material:1.5.0"
|
||||
implementation "androidx.constraintlayout:constraintlayout:2.1.3"
|
||||
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
||||
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.1"
|
||||
|
|
|
@ -24,6 +24,7 @@ import androidx.activity.viewModels
|
|||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||
import androidx.navigation.fragment.NavHostFragment
|
||||
import androidx.navigation.ui.NavigationUI
|
||||
import androidx.navigation.ui.setupWithNavController
|
||||
import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.databinding.ActivityMainBinding
|
||||
|
@ -42,7 +43,14 @@ class MainActivity : AppCompatActivity() {
|
|||
val binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
val host = supportFragmentManager.findFragmentById(R.id.navigation_host) as NavHostFragment
|
||||
setContentView(binding.root)
|
||||
binding.navigationBar.setupWithNavController(host.navController)
|
||||
binding.navigationBar.apply {
|
||||
setupWithNavController(host.navController)
|
||||
setOnItemSelectedListener { item ->
|
||||
NavigationUI.onNavDestinationSelected(item, host.navController)
|
||||
host.navController.popBackStack(item.itemId, inclusive = false)
|
||||
true
|
||||
}
|
||||
}
|
||||
mainViewModel.calculatePasses()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
<TextView
|
||||
android:id="@+id/radar_name"
|
||||
android:layout_width="0dp"
|
||||
android:visibility="gone"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="2dp"
|
||||
|
@ -54,7 +55,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -111,7 +112,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
@ -130,6 +131,7 @@
|
|||
<TextView
|
||||
android:id="@+id/radar_recycler_msg"
|
||||
android:layout_width="0dp"
|
||||
android:visibility="gone"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="2dp"
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
android:id="@+id/nav_passes"
|
||||
android:icon="@drawable/ic_list"
|
||||
android:title="@string/menu_passes" />
|
||||
<!-- <item-->
|
||||
<!-- android:id="@+id/nav_radar"-->
|
||||
<!-- android:icon="@drawable/ic_support"-->
|
||||
<!-- android:title="@string/menu_radar" />-->
|
||||
<item
|
||||
android:id="@+id/nav_radar"
|
||||
android:icon="@drawable/ic_support"
|
||||
android:title="@string/menu_radar" />
|
||||
<item
|
||||
android:id="@+id/nav_map"
|
||||
android:icon="@drawable/ic_world"
|
||||
|
|
Ładowanie…
Reference in New Issue