Loading src/com/android/customization/picker/quickaffordance/ui/binder/KeyguardQuickAffordancePickerBinder.kt +8 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import com.android.wallpaper.picker.common.icon.ui.viewbinder.IconViewBinder import com.android.wallpaper.picker.common.icon.ui.viewmodel.Icon import com.android.wallpaper.picker.option.ui.adapter.OptionItemAdapter import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.collectIndexed import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flatMapLatest Loading Loading @@ -99,17 +100,22 @@ object KeyguardQuickAffordancePickerBinder { selectedFlags.indexOfFirst { it } } } .collect { selectedPosition -> .collectIndexed { index, selectedPosition -> // Scroll the view to show the first selected affordance. if (selectedPosition != -1) { // We use "post" because we need to give the adapter item a pass to // update the view. affordancesView.post { if (index == 0) { // don't animate on initial collection affordancesView.scrollToPosition(selectedPosition) } else { affordancesView.smoothScrollToPosition(selectedPosition) } } } } } launch { viewModel.dialog.distinctUntilChanged().collect { dialogRequest -> Loading src/com/android/customization/picker/quickaffordance/ui/binder/KeyguardQuickAffordanceSectionViewBinder.kt +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ object KeyguardQuickAffordanceSectionViewBinder { lifecycleOwner.lifecycleScope.launch { viewModel.summary .flowWithLifecycle(lifecycleOwner.lifecycle, Lifecycle.State.RESUMED) .flowWithLifecycle(lifecycleOwner.lifecycle, Lifecycle.State.STARTED) .collectLatest { summary -> TextViewBinder.bind( view = descriptionView, Loading src/com/android/customization/picker/quickaffordance/ui/fragment/KeyguardQuickAffordancePickerFragment.kt +2 −2 Original line number Diff line number Diff line Loading @@ -33,9 +33,7 @@ import com.android.customization.picker.quickaffordance.ui.viewmodel.KeyguardQui import com.android.wallpaper.R import com.android.wallpaper.module.InjectorProvider import com.android.wallpaper.picker.AppbarFragment import kotlinx.coroutines.ExperimentalCoroutinesApi @OptIn(ExperimentalCoroutinesApi::class) class KeyguardQuickAffordancePickerFragment : AppbarFragment() { companion object { const val DESTINATION_ID = "quick_affordances" Loading Loading @@ -80,6 +78,8 @@ class KeyguardQuickAffordancePickerFragment : AppbarFragment() { viewModel = viewModel, lifecycleOwner = this, ) postponeEnterTransition() view.post { startPostponedEnterTransition() } (returnTransition as? Transition)?.doOnStart { // Hide preview during exit transition animation view?.findViewById<View>(R.id.preview)?.isVisible = false Loading Loading
src/com/android/customization/picker/quickaffordance/ui/binder/KeyguardQuickAffordancePickerBinder.kt +8 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import com.android.wallpaper.picker.common.icon.ui.viewbinder.IconViewBinder import com.android.wallpaper.picker.common.icon.ui.viewmodel.Icon import com.android.wallpaper.picker.option.ui.adapter.OptionItemAdapter import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.collectIndexed import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flatMapLatest Loading Loading @@ -99,17 +100,22 @@ object KeyguardQuickAffordancePickerBinder { selectedFlags.indexOfFirst { it } } } .collect { selectedPosition -> .collectIndexed { index, selectedPosition -> // Scroll the view to show the first selected affordance. if (selectedPosition != -1) { // We use "post" because we need to give the adapter item a pass to // update the view. affordancesView.post { if (index == 0) { // don't animate on initial collection affordancesView.scrollToPosition(selectedPosition) } else { affordancesView.smoothScrollToPosition(selectedPosition) } } } } } launch { viewModel.dialog.distinctUntilChanged().collect { dialogRequest -> Loading
src/com/android/customization/picker/quickaffordance/ui/binder/KeyguardQuickAffordanceSectionViewBinder.kt +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ object KeyguardQuickAffordanceSectionViewBinder { lifecycleOwner.lifecycleScope.launch { viewModel.summary .flowWithLifecycle(lifecycleOwner.lifecycle, Lifecycle.State.RESUMED) .flowWithLifecycle(lifecycleOwner.lifecycle, Lifecycle.State.STARTED) .collectLatest { summary -> TextViewBinder.bind( view = descriptionView, Loading
src/com/android/customization/picker/quickaffordance/ui/fragment/KeyguardQuickAffordancePickerFragment.kt +2 −2 Original line number Diff line number Diff line Loading @@ -33,9 +33,7 @@ import com.android.customization.picker.quickaffordance.ui.viewmodel.KeyguardQui import com.android.wallpaper.R import com.android.wallpaper.module.InjectorProvider import com.android.wallpaper.picker.AppbarFragment import kotlinx.coroutines.ExperimentalCoroutinesApi @OptIn(ExperimentalCoroutinesApi::class) class KeyguardQuickAffordancePickerFragment : AppbarFragment() { companion object { const val DESTINATION_ID = "quick_affordances" Loading Loading @@ -80,6 +78,8 @@ class KeyguardQuickAffordancePickerFragment : AppbarFragment() { viewModel = viewModel, lifecycleOwner = this, ) postponeEnterTransition() view.post { startPostponedEnterTransition() } (returnTransition as? Transition)?.doOnStart { // Hide preview during exit transition animation view?.findViewById<View>(R.id.preview)?.isVisible = false Loading