mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 16:19:33 +01:00
Fix gif and stickers buttons disappearing after exiting edit.
This commit is contained in:
committed by
Michelle Tang
parent
58d2c92102
commit
38e8f24c20
@@ -2104,6 +2104,7 @@ class ConversationFragment :
|
||||
val keyboardMode: TextSecurePreferences.MediaKeyboardMode = TextSecurePreferences.getMediaKeyboardMode(requireContext())
|
||||
val stickerIntro: Boolean = !TextSecurePreferences.hasSeenStickerIntroTooltip(requireContext())
|
||||
|
||||
keyboardPagerViewModel.resetPages()
|
||||
inputPanel.showMediaKeyboardToggle(true)
|
||||
|
||||
val keyboardPage = when (keyboardMode) {
|
||||
|
||||
@@ -23,6 +23,22 @@ class KeyboardPagerViewModel : ViewModel() {
|
||||
pages = DefaultValueLiveData(startingPages)
|
||||
page = DefaultValueLiveData(startingPages.first())
|
||||
|
||||
checkStickerAvailability()
|
||||
}
|
||||
|
||||
fun resetPages() {
|
||||
val defaultPages: MutableSet<KeyboardPage> = KeyboardPage.entries.toMutableSet()
|
||||
|
||||
if (!RemoteConfig.gifSearchAvailable) {
|
||||
defaultPages.remove(KeyboardPage.GIF)
|
||||
}
|
||||
|
||||
pages.value = defaultPages
|
||||
|
||||
checkStickerAvailability()
|
||||
}
|
||||
|
||||
private fun checkStickerAvailability() {
|
||||
StickerSearchRepository().getStickerFeatureAvailability { available ->
|
||||
if (!available) {
|
||||
val updatedPages = pages.value.toMutableSet().apply { remove(KeyboardPage.STICKER) }
|
||||
|
||||
Reference in New Issue
Block a user