Don't drop content warning when replying (#1631)
This commit is contained in:
parent
7cb76aad97
commit
6a2c9bdbe4
|
@ -166,8 +166,7 @@ class ComposeActivity : BaseActivity(),
|
||||||
setupContentWarningField(composeOptions?.contentWarning)
|
setupContentWarningField(composeOptions?.contentWarning)
|
||||||
setupPollView()
|
setupPollView()
|
||||||
applyShareIntent(intent, savedInstanceState)
|
applyShareIntent(intent, savedInstanceState)
|
||||||
|
viewModel.setupComplete.value = true
|
||||||
composeEditField.requestFocus()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun applyShareIntent(intent: Intent?, savedInstanceState: Bundle?) {
|
private fun applyShareIntent(intent: Intent?, savedInstanceState: Bundle?) {
|
||||||
|
@ -331,6 +330,10 @@ class ComposeActivity : BaseActivity(),
|
||||||
viewModel.uploadError.observe {
|
viewModel.uploadError.observe {
|
||||||
displayTransientError(R.string.error_media_upload_sending)
|
displayTransientError(R.string.error_media_upload_sending)
|
||||||
}
|
}
|
||||||
|
viewModel.setupComplete.observe {
|
||||||
|
// Focus may have changed during view model setup, ensure initial focus is on the edit field
|
||||||
|
composeEditField.requestFocus()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,7 @@ class ComposeViewModel
|
||||||
|
|
||||||
val statusVisibility = mutableLiveData(Status.Visibility.UNKNOWN)
|
val statusVisibility = mutableLiveData(Status.Visibility.UNKNOWN)
|
||||||
val showContentWarning = mutableLiveData(false)
|
val showContentWarning = mutableLiveData(false)
|
||||||
|
val setupComplete = mutableLiveData(false)
|
||||||
val poll: MutableLiveData<NewPoll?> = mutableLiveData(null)
|
val poll: MutableLiveData<NewPoll?> = mutableLiveData(null)
|
||||||
val scheduledAt: MutableLiveData<String?> = mutableLiveData(null)
|
val scheduledAt: MutableLiveData<String?> = mutableLiveData(null)
|
||||||
|
|
||||||
|
@ -367,6 +368,7 @@ class ComposeViewModel
|
||||||
if (contentWarning != null) {
|
if (contentWarning != null) {
|
||||||
startingContentWarning = contentWarning
|
startingContentWarning = contentWarning
|
||||||
}
|
}
|
||||||
|
showContentWarning.value = !contentWarning.isNullOrBlank()
|
||||||
|
|
||||||
// recreate media list
|
// recreate media list
|
||||||
// when coming from SavedTootActivity
|
// when coming from SavedTootActivity
|
||||||
|
|
Loading…
Reference in New Issue