mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Fix hijacking of navigation bar color when opening emoji keyboard.
This commit is contained in:
@@ -50,6 +50,7 @@ import androidx.appcompat.widget.Toolbar
|
||||
import androidx.core.app.ActivityOptionsCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.pm.ShortcutManagerCompat
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.doOnPreDraw
|
||||
import androidx.core.view.isInvisible
|
||||
@@ -336,6 +337,7 @@ import org.thoughtcrime.securesms.util.PlayStoreUtil
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig
|
||||
import org.thoughtcrime.securesms.util.SignalLocalMetrics
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
||||
import org.thoughtcrime.securesms.util.ThemeUtil
|
||||
import org.thoughtcrime.securesms.util.ViewUtil
|
||||
import org.thoughtcrime.securesms.util.WindowUtil
|
||||
import org.thoughtcrime.securesms.util.atMidnight
|
||||
@@ -1573,12 +1575,6 @@ class ConversationFragment :
|
||||
binding.conversationItemRecycler.invalidateItemDecorations()
|
||||
}
|
||||
|
||||
val navColor = if (wallpaperEnabled) {
|
||||
R.color.conversation_navigation_wallpaper
|
||||
} else {
|
||||
R.color.signal_colorBackground
|
||||
}
|
||||
|
||||
binding.scrollDateHeader.setBackgroundResource(
|
||||
if (wallpaperEnabled) R.drawable.sticky_date_header_background_wallpaper else R.drawable.sticky_date_header_background
|
||||
)
|
||||
@@ -1591,10 +1587,20 @@ class ConversationFragment :
|
||||
)
|
||||
|
||||
if (!inputPanel.isHidden) {
|
||||
binding.navBar.setBackgroundColor(ContextCompat.getColor(requireContext(), navColor))
|
||||
setNavBarBackgroundColor(chatWallpaper)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setNavBarBackgroundColor(chatWallpaper: ChatWallpaper?) {
|
||||
val navColor = if (chatWallpaper != null) {
|
||||
R.color.conversation_navigation_wallpaper
|
||||
} else {
|
||||
R.color.signal_colorBackground
|
||||
}
|
||||
|
||||
binding.navBar.setBackgroundColor(ContextCompat.getColor(requireContext(), navColor))
|
||||
}
|
||||
|
||||
private fun presentChatColors(chatColors: ChatColors) {
|
||||
recyclerViewColorizer.setChatColors(chatColors)
|
||||
binding.scrollToMention.setUnreadCountBackgroundTint(chatColors.asSingleColor())
|
||||
@@ -4496,7 +4502,9 @@ class ConversationFragment :
|
||||
|
||||
private object MediaKeyboardFragmentCreator : InputAwareConstraintLayout.FragmentCreator {
|
||||
override val id: Int = 2
|
||||
override fun create(): Fragment = KeyboardPagerFragment()
|
||||
override fun create(): Fragment = KeyboardPagerFragment().apply {
|
||||
arguments = bundleOf(KeyboardPagerFragment.ARG_SET_NAV_COLOR to false)
|
||||
}
|
||||
}
|
||||
|
||||
private inner class KeyboardEvents :
|
||||
@@ -4508,10 +4516,12 @@ class ConversationFragment :
|
||||
}
|
||||
|
||||
override fun onInputShown() {
|
||||
binding.navBar.setBackgroundColor(ThemeUtil.getThemedColor(requireContext(), R.attr.mediaKeyboardBottomBarBackgroundColor))
|
||||
isEnabled = true
|
||||
}
|
||||
|
||||
override fun onInputHidden() {
|
||||
setNavBarBackgroundColor(viewModel.wallpaperSnapshot)
|
||||
isEnabled = false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user