chats: fix stickers and emojis
This commit is contained in:
parent
23f714ff23
commit
600178df0d
|
@ -205,12 +205,17 @@ class ChatActivity: BottomSheetActivity(),
|
|||
|
||||
subscribeToUpdates()
|
||||
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(this)
|
||||
viewModel.tryFetchStickers = preferences.getBoolean("stickers", false)
|
||||
|
||||
setupHeader()
|
||||
setupChat()
|
||||
setupAttachment()
|
||||
setupComposeField(savedInstanceState?.getString(MESSAGE_KEY))
|
||||
setupButtons()
|
||||
|
||||
viewModel.setup()
|
||||
|
||||
photoUploadUri = savedInstanceState?.getParcelable(PHOTO_UPLOAD_URI_KEY)
|
||||
|
||||
eventHub.events
|
||||
|
@ -229,6 +234,7 @@ class ChatActivity: BottomSheetActivity(),
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
tryCache()
|
||||
}
|
||||
|
||||
|
@ -354,7 +360,7 @@ class ChatActivity: BottomSheetActivity(),
|
|||
stickerKeyboard.setupStickerKeyboard(this@ChatActivity, stickers)
|
||||
}
|
||||
}
|
||||
viewModel.emoji.observe { emoji -> setEmojiList(emoji) }
|
||||
viewModel.emoji.observe { setEmojiList(it) }
|
||||
viewModel.media.observe {
|
||||
if(it.isNotEmpty()) {
|
||||
val media = it[0]
|
||||
|
@ -467,9 +473,15 @@ class ChatActivity: BottomSheetActivity(),
|
|||
|
||||
attachmentButton.setOnClickListener { openPickDialog() }
|
||||
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)
|
||||
|
||||
|
|
|
@ -91,8 +91,8 @@ public final class ProgressImageView extends AppCompatImageView {
|
|||
super.onDraw(canvas);
|
||||
|
||||
float angle = (progress / 100f) * 360 - 90;
|
||||
float halfWidth = getWidth() / 2;
|
||||
float halfHeight = getHeight() / 2;
|
||||
float halfWidth = getWidth() / 2.0f;
|
||||
float halfHeight = getHeight() / 2.0f;
|
||||
progressRect.set(halfWidth * 0.75f, halfHeight * 0.75f, halfWidth * 1.25f, halfHeight * 1.25f);
|
||||
biggerRect.set(progressRect);
|
||||
int margin = 8;
|
||||
|
|
|
@ -90,8 +90,8 @@ public final class ProgressTextView extends TextView {
|
|||
canvas.translate(getScrollX(), 0);
|
||||
|
||||
float angle = (progress / 100f) * 360 - 90;
|
||||
float halfWidth = getWidth() / 2;
|
||||
float halfHeight = getHeight() / 2;
|
||||
float halfWidth = getWidth() / 2.0f;
|
||||
float halfHeight = getHeight() / 2.0f;
|
||||
progressRect.set(halfWidth * 0.75f, halfHeight * 0.75f, halfWidth * 1.25f, halfHeight * 1.25f);
|
||||
biggerRect.set(progressRect);
|
||||
int margin = 8;
|
||||
|
|
Loading…
Reference in New Issue