kopia lustrzana https://github.com/rt-bishop/Look4Sat
Added a basic default fragment transition animation
rodzic
930e05cc58
commit
20306ec83e
|
@ -84,11 +84,9 @@ class EntriesFragment : Fragment(R.layout.fragment_entries) {
|
|||
is DataState.Success -> {
|
||||
entriesAdapter.submitList(dataState.data)
|
||||
binding.entriesProgress.visibility = View.INVISIBLE
|
||||
binding.entriesRecycler.visibility = View.VISIBLE
|
||||
}
|
||||
is DataState.Loading -> {
|
||||
binding.entriesProgress.visibility = View.VISIBLE
|
||||
binding.entriesRecycler.visibility = View.INVISIBLE
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import com.rtbishop.look4sat.domain.ISettings
|
|||
import com.rtbishop.look4sat.domain.model.DataState
|
||||
import com.rtbishop.look4sat.domain.model.SatItem
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.delay
|
||||
import java.util.*
|
||||
import javax.inject.Inject
|
||||
|
||||
|
@ -34,7 +35,10 @@ class EntriesViewModel @Inject constructor(
|
|||
|
||||
private val transModes = MutableLiveData(settings.loadModesSelection())
|
||||
private val currentQuery = MutableLiveData(String())
|
||||
private val itemsFromRepo = liveData { emit(loadEntriesWithSelection()) } as MutableLiveData
|
||||
private val itemsFromRepo = liveData {
|
||||
delay(125)
|
||||
emit(loadEntriesWithSelection())
|
||||
} as MutableLiveData
|
||||
private val itemsWithModes = transModes.switchMap { modes ->
|
||||
itemsFromRepo.map { items -> filterByModes(items, modes) }
|
||||
}
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:transitionGroup="true">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/entries_toolbar"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:transitionGroup="true"
|
||||
android:keepScreenOn="true">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
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">
|
||||
android:layout_height="match_parent"
|
||||
android:transitionGroup="true">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/passes_toolbar"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:transitionGroup="true"
|
||||
android:keepScreenOn="true">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:transitionGroup="true">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/settings_toolbar"
|
||||
|
|
|
@ -10,7 +10,11 @@
|
|||
tools:layout="@layout/fragment_entries">
|
||||
<action
|
||||
android:id="@+id/entries_to_modes"
|
||||
app:destination="@id/nav_modes" />
|
||||
app:destination="@id/nav_modes"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/nav_passes"
|
||||
|
@ -18,7 +22,11 @@
|
|||
tools:layout="@layout/fragment_passes">
|
||||
<action
|
||||
android:id="@+id/passes_to_filter"
|
||||
app:destination="@id/nav_filter" />
|
||||
app:destination="@id/nav_filter"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/nav_radar"
|
||||
|
@ -48,7 +56,11 @@
|
|||
tools:layout="@layout/fragment_settings">
|
||||
<action
|
||||
android:id="@+id/settings_to_sources"
|
||||
app:destination="@id/nav_sources" />
|
||||
app:destination="@id/nav_sources"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
||||
</fragment>
|
||||
<dialog
|
||||
android:id="@+id/nav_modes"
|
||||
|
@ -72,23 +84,51 @@
|
|||
tools:layout="@layout/dialog_locator" />
|
||||
<action
|
||||
android:id="@+id/global_to_entries"
|
||||
app:destination="@id/nav_entries" />
|
||||
app:destination="@id/nav_entries"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
||||
<action
|
||||
android:id="@+id/global_to_passes"
|
||||
app:destination="@id/nav_passes" />
|
||||
app:destination="@id/nav_passes"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
||||
<action
|
||||
android:id="@+id/global_to_radar"
|
||||
app:destination="@id/nav_radar" />
|
||||
app:destination="@id/nav_radar"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
||||
<action
|
||||
android:id="@+id/global_to_map"
|
||||
app:destination="@id/nav_map" />
|
||||
app:destination="@id/nav_map"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
||||
<action
|
||||
android:id="@+id/global_to_settings"
|
||||
app:destination="@id/nav_settings" />
|
||||
app:destination="@id/nav_settings"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
||||
<action
|
||||
android:id="@+id/global_to_position"
|
||||
app:destination="@id/nav_position" />
|
||||
app:destination="@id/nav_position"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
||||
<action
|
||||
android:id="@+id/global_to_locator"
|
||||
app:destination="@id/nav_locator" />
|
||||
app:destination="@id/nav_locator"
|
||||
app:enterAnim="@anim/nav_default_enter_anim"
|
||||
app:exitAnim="@anim/nav_default_exit_anim"
|
||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
||||
</navigation>
|
||||
|
|
Ładowanie…
Reference in New Issue