Attempt to fix the Preview behavior
This fix should fix the behavior where the Preview view does not close properly when the button is pressed again. Fixes: https://todo.sr.ht/~captainepoch/husky/29
This commit is contained in:
parent
da32a9f66b
commit
2959f2aa9c
1 changed files with 8 additions and 2 deletions
|
@ -1100,8 +1100,12 @@ class ComposeActivity : BaseActivity(),
|
|||
}
|
||||
|
||||
private fun onSendClicked(preview: Boolean) {
|
||||
if(preview && previewBehavior.state != BottomSheetBehavior.STATE_HIDDEN) {
|
||||
if(preview && previewBehavior.state != BottomSheetBehavior.STATE_HIDDEN
|
||||
&& previewBehavior.state != BottomSheetBehavior.STATE_COLLAPSED
|
||||
) {
|
||||
previewBehavior.state = BottomSheetBehavior.STATE_HIDDEN
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if(verifyScheduledTime()) {
|
||||
|
@ -1113,7 +1117,9 @@ class ComposeActivity : BaseActivity(),
|
|||
|
||||
private fun onStatusPreviewReady(status: Status) {
|
||||
enableButtons(true)
|
||||
if(previewBehavior.state != BottomSheetBehavior.STATE_HIDDEN) {
|
||||
if(previewBehavior.state != BottomSheetBehavior.STATE_HIDDEN
|
||||
&& previewBehavior.state != BottomSheetBehavior.STATE_COLLAPSED
|
||||
) {
|
||||
previewBehavior.state = BottomSheetBehavior.STATE_HIDDEN
|
||||
} else {
|
||||
binding.previewView.setupWithStatus(status)
|
||||
|
|
Loading…
Reference in a new issue