From 8201f2539dea1a4df1446cb2aed4b390384ffede Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sun, 17 Feb 2019 20:50:06 +0100 Subject: [PATCH] fix close button behavior in ComposeActivity (#1056) --- .../java/com/keylesspalace/tusky/ComposeActivity.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java index 193eb7997..8e0b88370 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java @@ -1490,11 +1490,6 @@ public final class ComposeActivity @Override public void onBackPressed() { // Acting like a teen: deliberately ignoring parent. - handleCloseButton(); - } - - private void handleCloseButton() { - if(composeOptionsBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED || addMediaBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED || emojiBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED ) { @@ -1504,6 +1499,11 @@ public final class ComposeActivity return; } + handleCloseButton(); + } + + private void handleCloseButton() { + CharSequence contentText = textEditor.getText(); CharSequence contentWarning = contentWarningEditor.getText();