fix close button behavior in ComposeActivity (#1056)

This commit is contained in:
Konrad Pozniak 2019-02-17 20:50:06 +01:00 committed by GitHub
parent fd3226d244
commit 8201f2539d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -1490,11 +1490,6 @@ public final class ComposeActivity
@Override @Override
public void onBackPressed() { public void onBackPressed() {
// Acting like a teen: deliberately ignoring parent. // Acting like a teen: deliberately ignoring parent.
handleCloseButton();
}
private void handleCloseButton() {
if(composeOptionsBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED || if(composeOptionsBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED ||
addMediaBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED || addMediaBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED ||
emojiBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED ) { emojiBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED ) {
@ -1504,6 +1499,11 @@ public final class ComposeActivity
return; return;
} }
handleCloseButton();
}
private void handleCloseButton() {
CharSequence contentText = textEditor.getText(); CharSequence contentText = textEditor.getText();
CharSequence contentWarning = contentWarningEditor.getText(); CharSequence contentWarning = contentWarningEditor.getText();