Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix navigation buttons barely visible on dark and light mode #4211

Open
wants to merge 6 commits into
base: release/4.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

package com.amaze.filemanager.ui.activities;

import static com.amaze.filemanager.ui.fragments.preferencefragments.PreferencesConstants.PREFERENCE_COLORED_NAVIGATION;
import static com.amaze.filemanager.utils.Utils.openURL;

import java.io.File;
Expand All @@ -35,7 +34,6 @@
import com.amaze.filemanager.ui.dialogs.share.ShareTask;
import com.amaze.filemanager.ui.theme.AppTheme;
import com.amaze.filemanager.utils.Billing;
import com.amaze.filemanager.utils.PreferenceUtils;
import com.amaze.filemanager.utils.Utils;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
Expand Down Expand Up @@ -148,19 +146,6 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
(v, hasFocus) -> {
mAppBarLayout.setExpanded(hasFocus, true);
});
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (getBoolean(PREFERENCE_COLORED_NAVIGATION)) {
getWindow().setNavigationBarColor(PreferenceUtils.getStatusColor(getPrimary()));
} else {
if (getAppTheme().equals(AppTheme.LIGHT)) {
getWindow().setNavigationBarColor(Utils.getColor(this, android.R.color.white));
} else if (getAppTheme().equals(AppTheme.BLACK)) {
getWindow().setNavigationBarColor(Utils.getColor(this, android.R.color.black));
} else {
getWindow().setNavigationBarColor(Utils.getColor(this, R.color.holo_dark_background));
}
}
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import static android.os.Build.VERSION.SDK_INT;
import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1;
import static android.os.Build.VERSION_CODES.KITKAT;
import static android.os.Build.VERSION_CODES.KITKAT_WATCH;
import static android.os.Build.VERSION_CODES.LOLLIPOP;
import static android.os.Build.VERSION_CODES.M;
import static android.os.Build.VERSION_CODES.N;
Expand Down Expand Up @@ -55,7 +54,6 @@
import static com.amaze.filemanager.ui.dialogs.SftpConnectDialog.ARG_USERNAME;
import static com.amaze.filemanager.ui.fragments.FtpServerFragment.REQUEST_CODE_SAF_FTP;
import static com.amaze.filemanager.ui.fragments.preferencefragments.PreferencesConstants.PREFERENCE_BOOKMARKS_ADDED;
import static com.amaze.filemanager.ui.fragments.preferencefragments.PreferencesConstants.PREFERENCE_COLORED_NAVIGATION;
import static com.amaze.filemanager.ui.fragments.preferencefragments.PreferencesConstants.PREFERENCE_NEED_TO_SET_HOME;
import static com.amaze.filemanager.ui.fragments.preferencefragments.PreferencesConstants.PREFERENCE_VIEW;

Expand Down Expand Up @@ -132,7 +130,6 @@
import com.amaze.filemanager.ui.fragments.data.MainFragmentViewModel;
import com.amaze.filemanager.ui.fragments.preferencefragments.PreferencesConstants;
import com.amaze.filemanager.ui.strings.StorageNamingHelper;
import com.amaze.filemanager.ui.theme.AppTheme;
import com.amaze.filemanager.ui.views.CustomZoomFocusChange;
import com.amaze.filemanager.ui.views.appbar.AppBar;
import com.amaze.filemanager.ui.views.drawer.Drawer;
Expand All @@ -154,7 +151,6 @@
import com.leinardi.android.speeddial.SpeedDialActionItem;
import com.leinardi.android.speeddial.SpeedDialOverlayLayout;
import com.leinardi.android.speeddial.SpeedDialView;
import com.readystatesoftware.systembartint.SystemBarTintManager;
import com.topjohnwu.superuser.Shell;

import android.annotation.SuppressLint;
Expand Down Expand Up @@ -1767,36 +1763,6 @@ public void updateViews(ColorDrawable colorDrawable) {
mainActivity.getSupportActionBar().setBackgroundDrawable(colorDrawable);

drawer.setBackgroundColor(colorDrawable.getColor());

if (SDK_INT >= LOLLIPOP) {
// for lollipop devices, the status bar color
mainActivity.getWindow().setStatusBarColor(colorDrawable.getColor());
if (getBoolean(PREFERENCE_COLORED_NAVIGATION)) {
mainActivity
.getWindow()
.setNavigationBarColor(PreferenceUtils.getStatusColor(colorDrawable.getColor()));
} else {
if (getAppTheme().equals(AppTheme.LIGHT)) {
mainActivity
.getWindow()
.setNavigationBarColor(Utils.getColor(this, android.R.color.white));
} else if (getAppTheme().equals(AppTheme.BLACK)) {
mainActivity
.getWindow()
.setNavigationBarColor(Utils.getColor(this, android.R.color.black));
} else {
mainActivity
.getWindow()
.setNavigationBarColor(Utils.getColor(this, R.color.holo_dark_background));
}
}
} else if (SDK_INT == KITKAT_WATCH || SDK_INT == KITKAT) {

// for kitkat devices, the status bar color
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setStatusBarTintColor(colorDrawable.getColor());
}
}

void initialiseFab() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import com.amaze.filemanager.ui.theme.AppTheme;
import com.amaze.filemanager.ui.theme.AppThemePreference;
import com.amaze.filemanager.utils.PreferenceUtils;
import com.amaze.filemanager.utils.Utils;
import com.readystatesoftware.systembartint.SystemBarTintManager;

import android.app.ActivityManager;
Expand Down Expand Up @@ -140,14 +139,6 @@ public void initStatusBarResources(View parentView) {
}
if (getBoolean(PREFERENCE_COLORED_NAVIGATION)) {
window.setNavigationBarColor(PreferenceUtils.getStatusColor(getPrimary()));
} else {
if (getAppTheme().equals(AppTheme.LIGHT)) {
window.setNavigationBarColor(Utils.getColor(this, android.R.color.white));
} else if (getAppTheme().equals(AppTheme.BLACK)) {
window.setNavigationBarColor(Utils.getColor(this, android.R.color.black));
} else {
window.setNavigationBarColor(Utils.getColor(this, R.color.holo_dark_background));
}
}
} else if (SDK_INT == Build.VERSION_CODES.KITKAT_WATCH
|| SDK_INT == Build.VERSION_CODES.KITKAT) {
Expand Down
Loading