|
|
@ -205,12 +205,17 @@ class ChatActivity: BottomSheetActivity(), |
|
|
|
|
|
|
|
|
|
|
|
subscribeToUpdates() |
|
|
|
subscribeToUpdates() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val preferences = PreferenceManager.getDefaultSharedPreferences(this) |
|
|
|
|
|
|
|
viewModel.tryFetchStickers = preferences.getBoolean("stickers", false) |
|
|
|
|
|
|
|
|
|
|
|
setupHeader() |
|
|
|
setupHeader() |
|
|
|
setupChat() |
|
|
|
setupChat() |
|
|
|
setupAttachment() |
|
|
|
setupAttachment() |
|
|
|
setupComposeField(savedInstanceState?.getString(MESSAGE_KEY)) |
|
|
|
setupComposeField(savedInstanceState?.getString(MESSAGE_KEY)) |
|
|
|
setupButtons() |
|
|
|
setupButtons() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
viewModel.setup() |
|
|
|
|
|
|
|
|
|
|
|
photoUploadUri = savedInstanceState?.getParcelable(PHOTO_UPLOAD_URI_KEY) |
|
|
|
photoUploadUri = savedInstanceState?.getParcelable(PHOTO_UPLOAD_URI_KEY) |
|
|
|
|
|
|
|
|
|
|
|
eventHub.events |
|
|
|
eventHub.events |
|
|
@ -229,6 +234,7 @@ class ChatActivity: BottomSheetActivity(), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tryCache() |
|
|
|
tryCache() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -354,7 +360,7 @@ class ChatActivity: BottomSheetActivity(), |
|
|
|
stickerKeyboard.setupStickerKeyboard(this@ChatActivity, stickers) |
|
|
|
stickerKeyboard.setupStickerKeyboard(this@ChatActivity, stickers) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
viewModel.emoji.observe { emoji -> setEmojiList(emoji) } |
|
|
|
viewModel.emoji.observe { setEmojiList(it) } |
|
|
|
viewModel.media.observe { |
|
|
|
viewModel.media.observe { |
|
|
|
if(it.isNotEmpty()) { |
|
|
|
if(it.isNotEmpty()) { |
|
|
|
val media = it[0] |
|
|
|
val media = it[0] |
|
|
@ -467,9 +473,15 @@ class ChatActivity: BottomSheetActivity(), |
|
|
|
|
|
|
|
|
|
|
|
attachmentButton.setOnClickListener { openPickDialog() } |
|
|
|
attachmentButton.setOnClickListener { openPickDialog() } |
|
|
|
emojiButton.setOnClickListener { showEmojis() } |
|
|
|
emojiButton.setOnClickListener { showEmojis() } |
|
|
|
stickerButton.setOnClickListener { showStickers() } |
|
|
|
if(viewModel.tryFetchStickers) { |
|
|
|
|
|
|
|
stickerButton.setOnClickListener { showStickers() } |
|
|
|
|
|
|
|
stickerButton.visibility = View.VISIBLE |
|
|
|
|
|
|
|
enableButton(stickerButton, false, false) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
stickerButton.visibility = View.GONE |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
enableButton(stickerButton, false, false) |
|
|
|
emojiView.layoutManager = GridLayoutManager(this, 3, GridLayoutManager.HORIZONTAL, false) |
|
|
|
|
|
|
|
|
|
|
|
val textColor = ThemeUtils.getColor(this, android.R.attr.textColorTertiary) |
|
|
|
val textColor = ThemeUtils.getColor(this, android.R.attr.textColorTertiary) |
|
|
|
|
|
|
|
|
|
|
|