From 04dc16e915fb3d6ea517f3fc0f31bbad7f851e40 Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 29 Oct 2022 17:39:41 +0100 Subject: [PATCH 1/2] fix: close stream on navigation back if initial orientation is landscape --- .../perflyst/twire/activities/stream/StreamActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/perflyst/twire/activities/stream/StreamActivity.java b/app/src/main/java/com/perflyst/twire/activities/stream/StreamActivity.java index ba5b7482..6bd7af43 100644 --- a/app/src/main/java/com/perflyst/twire/activities/stream/StreamActivity.java +++ b/app/src/main/java/com/perflyst/twire/activities/stream/StreamActivity.java @@ -46,6 +46,7 @@ public abstract class StreamActivity extends ThemeActivity implements StreamFrag private Settings settings; private boolean mBackstackLost; private boolean onStopCalled; + private int initialOrientation; protected abstract int getLayoutResource(); @@ -63,6 +64,8 @@ protected void onCreate(Bundle savedInstanceState) { getWindow().setNavigationBarColor(ContextCompat.getColor(this, R.color.black)); getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.black)); + initialOrientation = getResources().getConfiguration().orientation; + if (savedInstanceState == null) { FragmentManager fm = getSupportFragmentManager(); @@ -111,7 +114,9 @@ public void onBackPressed() { // Eww >( if (mStreamFragment != null) { - if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { + boolean isCurrentlyLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; + boolean wasInitiallyLandscape = initialOrientation == Configuration.ORIENTATION_LANDSCAPE; + if (isCurrentlyLandscape && !wasInitiallyLandscape) { mStreamFragment.toggleFullscreen(); } else if (mStreamFragment.chatOnlyViewVisible) { this.finish(); From 43d155b6d4bc9a9df4ea910f64092ffe41655ca1 Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 29 Oct 2022 18:12:11 +0100 Subject: [PATCH 2/2] feat: reduce minimum chat size threshold for large tablets --- .../twire/activities/settings/SettingsTwitchChatActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/perflyst/twire/activities/settings/SettingsTwitchChatActivity.java b/app/src/main/java/com/perflyst/twire/activities/settings/SettingsTwitchChatActivity.java index 504cad65..fef8f07d 100644 --- a/app/src/main/java/com/perflyst/twire/activities/settings/SettingsTwitchChatActivity.java +++ b/app/src/main/java/com/perflyst/twire/activities/settings/SettingsTwitchChatActivity.java @@ -163,7 +163,7 @@ public void onClickChatLandScapeWidth(View _view) { updateSummaries(); }, landscapeWidth, - 25, + 10, 60, getString(R.string.chat_landscape_width_dialog) ).show();