Fix back button behavior on OnePlus phones.

Couple things happened:
- Core issue: The device always thought the keyboard was open, so it was
always trying to dismiss the keyboard when you pressed back (instead of
actually going back)
- Big fix: Increase the tolerance of our view height differentialt that
detects if the keyboard is open
- Other fix: the getViewInset() method is always missing on Q, so as a
temp fix we fall back to the status bar height. Gets the calculation to
be closer, even if not truly correct.
This commit is contained in:
Greyson Parrelli
2020-10-23 12:43:29 -04:00
parent f1d98f6c7b
commit 1363f55f77
3 changed files with 20 additions and 12 deletions

View File

@@ -979,9 +979,13 @@ public class ConversationActivity extends PassphraseRequiredActivity
@Override
public void onBackPressed() {
Log.d(TAG, "onBackPressed()");
if (reactionOverlay.isShowing()) reactionOverlay.hide();
else if (container.isInputOpen()) container.hideCurrentInput(composeText);
else super.onBackPressed();
if (reactionOverlay.isShowing()) {
reactionOverlay.hide();
} else if (container.isInputOpen()) {
container.hideCurrentInput(composeText);
} else {
super.onBackPressed();
}
}
@Override