Fix toolbar height and fade in.

This commit is contained in:
Alex Hart 2023-02-15 14:10:18 -04:00 committed by Greyson Parrelli
parent e36844fe78
commit 6759b59507
2 changed files with 4 additions and 3 deletions

View file

@ -185,13 +185,12 @@ class MediaPreviewV2Fragment : LoggingFragment(R.layout.fragment_media_preview_v
private fun initializeFullScreenUi() {
fullscreenHelper.configureToolbarLayout(binding.toolbarCutoutSpacer, binding.toolbar)
fullscreenHelper.showAndHideWithSystemUI(requireActivity().window, binding.toolbarLayout, binding.mediaPreviewDetailsContainer)
fullscreenHelper.hideSystemUI()
lifecycleDisposable += viewModel.state.map {
it.isInSharedAnimation to it.loadState
}.distinctUntilChanged().subscribe { (isInSharedAnimation, loadState) ->
if (!isInSharedAnimation && loadState == MediaPreviewV2State.LoadState.MEDIA_READY) {
fullscreenHelper.showSystemUI()
binding.toolbarLayout.animate().alpha(1f)
}
}
}

View file

@ -54,6 +54,7 @@
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:alpha="0"
android:background="@color/signal_dark_colorSurface_87"
app:elevation="0dp">
@ -66,8 +67,9 @@
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="@dimen/signal_m3_toolbar_height"
android:background="@android:color/transparent"
android:minHeight="@dimen/signal_m3_toolbar_height"
android:theme="?actionBarStyle"
app:navigationIcon="@drawable/ic_arrow_left_white_24" />