add activityOverridesNavBarColor to not set colour twice

This commit is contained in:
FC (Fay) Stegerman
2023-10-15 22:18:48 +02:00
committed by Sylvia van Os
parent 7fa8ae8697
commit bd1376e6bf
2 changed files with 6 additions and 1 deletions

View File

@@ -14,6 +14,8 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.core.view.WindowInsetsControllerCompat;
public class CatimaAppCompatActivity extends AppCompatActivity {
protected boolean activityOverridesNavBarColor = false;
@Override
protected void attachBaseContext(Context base) {
// Apply chosen language
@@ -51,7 +53,9 @@ public class CatimaAppCompatActivity extends AppCompatActivity {
@Override
protected void onResume() {
super.onResume();
Utils.setNavigationBarColor(this, null, Utils.resolveBackgroundColor(this), !Utils.isDarkModeEnabled(this));
if (!activityOverridesNavBarColor) {
Utils.setNavigationBarColor(this, null, Utils.resolveBackgroundColor(this), !Utils.isDarkModeEnabled(this));
}
}
protected void enableToolbarBackButton() {

View File

@@ -555,6 +555,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
@Override
protected void onResume() {
activityOverridesNavBarColor = true;
super.onResume();
Log.i(TAG, "To view card: " + loyaltyCardId);