From 739ca4635d80b1e298fa4dee7ba91771c6492ea8 Mon Sep 17 00:00:00 2001 From: Braden Farmer Date: Wed, 11 Sep 2024 10:14:22 -0600 Subject: [PATCH] Properly close DummyActivity on Android 10+ --- .../com/farmerbb/taskbar/activity/DashboardActivity.java | 2 +- .../com/farmerbb/taskbar/activity/DimScreenActivity.java | 2 +- .../java/com/farmerbb/taskbar/activity/DummyActivity.java | 7 +++++++ .../farmerbb/taskbar/activity/HomeActivityDelegate.java | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/farmerbb/taskbar/activity/DashboardActivity.java b/app/src/main/java/com/farmerbb/taskbar/activity/DashboardActivity.java index 652afcb5..2476bb5d 100644 --- a/app/src/main/java/com/farmerbb/taskbar/activity/DashboardActivity.java +++ b/app/src/main/java/com/farmerbb/taskbar/activity/DashboardActivity.java @@ -170,7 +170,7 @@ public boolean dispatchKeyShortcutEvent(KeyEvent event) { return super.dispatchKeyShortcutEvent(event); } - // @Override + @Override public void onTopResumedActivityChanged(boolean isTopResumedActivity) { if(!isTopResumedActivity) performOnPauseLogic(); diff --git a/app/src/main/java/com/farmerbb/taskbar/activity/DimScreenActivity.java b/app/src/main/java/com/farmerbb/taskbar/activity/DimScreenActivity.java index 777a632d..6807424d 100644 --- a/app/src/main/java/com/farmerbb/taskbar/activity/DimScreenActivity.java +++ b/app/src/main/java/com/farmerbb/taskbar/activity/DimScreenActivity.java @@ -142,7 +142,7 @@ public boolean onOptionsItemSelected(MenuItem item) { @Override public void onBackPressed() {} - // @Override + @Override public void onTopResumedActivityChanged(boolean isTopResumedActivity) { isTopResumed = isTopResumedActivity; dimScreen(true); diff --git a/app/src/main/java/com/farmerbb/taskbar/activity/DummyActivity.java b/app/src/main/java/com/farmerbb/taskbar/activity/DummyActivity.java index 3a2b0d5d..ef63ba6f 100644 --- a/app/src/main/java/com/farmerbb/taskbar/activity/DummyActivity.java +++ b/app/src/main/java/com/farmerbb/taskbar/activity/DummyActivity.java @@ -124,4 +124,11 @@ protected void onPause() { if(finishOnPause) finish(); } + + @Override + public void onTopResumedActivityChanged(boolean isTopResumedActivity) { + if(isTopResumedActivity && finishOnPause) { + finish(); + } + } } \ No newline at end of file diff --git a/app/src/main/java/com/farmerbb/taskbar/activity/HomeActivityDelegate.java b/app/src/main/java/com/farmerbb/taskbar/activity/HomeActivityDelegate.java index 706b3e9f..827d7f12 100644 --- a/app/src/main/java/com/farmerbb/taskbar/activity/HomeActivityDelegate.java +++ b/app/src/main/java/com/farmerbb/taskbar/activity/HomeActivityDelegate.java @@ -1110,7 +1110,7 @@ private void setOnHomeScreen(boolean value) { helper.setOnPrimaryHomeScreen(value); } - // @Override + @Override public void onTopResumedActivityChanged(boolean isTopResumedActivity) { if(isTopResumedActivity) performOnResumeLogic();