Skip to content

Commit

Permalink
Fix toolbar height and fade in.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-signal authored and greyson-signal committed Feb 15, 2023
1 parent e36844f commit 6759b59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_media_preview_v2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">

Expand All @@ -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" />

Expand Down

0 comments on commit 6759b59

Please sign in to comment.