forked from upstream-mirrors/quik
removed audio state maintenance from audiobinder on the compose screen into messagesadapter class. fixed other ui issues also related to state loss in audiobinder and re-use of viewholders
This commit is contained in:
@@ -9,6 +9,7 @@ object QkMediaPlayer : MediaPlayer() {
|
||||
private var onCompletionListener: OnCompletionListener? = null
|
||||
|
||||
enum class PlayingState {
|
||||
None,
|
||||
Stopped,
|
||||
Playing,
|
||||
Paused
|
||||
|
||||
@@ -53,20 +53,29 @@ fun EditText.hideKeyboard() {
|
||||
imm.hideSoftInputFromWindow(windowToken, 0)
|
||||
}
|
||||
|
||||
fun ImageView.setTint(color: Int) {
|
||||
imageTintList = ColorStateList.valueOf(color)
|
||||
fun ImageView.setTint(color: Int?) {
|
||||
imageTintList =
|
||||
if (color == null) null
|
||||
else ColorStateList.valueOf(color)
|
||||
}
|
||||
|
||||
fun ProgressBar.setTint(color: Int) {
|
||||
indeterminateTintList = ColorStateList.valueOf(color)
|
||||
progressTintList = ColorStateList.valueOf(color)
|
||||
fun ProgressBar.setTint(color: Int?) {
|
||||
indeterminateTintList =
|
||||
if (color == null) null
|
||||
else ColorStateList.valueOf(color)
|
||||
progressTintList =
|
||||
if (color == null) null
|
||||
else ColorStateList.valueOf(color)
|
||||
|
||||
}
|
||||
|
||||
fun View.setBackgroundTint(color: Int) {
|
||||
fun View.setBackgroundTint(color: Int?) {
|
||||
|
||||
// API 21 doesn't support this
|
||||
|
||||
backgroundTintList = ColorStateList.valueOf(color)
|
||||
backgroundTintList =
|
||||
if (color == null) null
|
||||
else ColorStateList.valueOf(color)
|
||||
}
|
||||
|
||||
fun View.setPadding(left: Int? = null, top: Int? = null, right: Int? = null, bottom: Int? = null) {
|
||||
|
||||
Reference in New Issue
Block a user