fix status bar colour

Signed-off-by: Harry Bond <me@hbond.xyz>
This commit is contained in:
Harry Bond 2025-03-04 17:29:56 +00:00
parent d731773c21
commit 6074f4bfd1
4 changed files with 7 additions and 10 deletions

View file

@ -566,8 +566,9 @@ public class MwmActivity extends BaseMwmFragmentActivity
private void refreshLightStatusBar()
{
int darkModeFlags = this.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
UiUtils.setLightStatusBar(this, !(
ThemeUtils.isNightTheme(this)
(darkModeFlags == Configuration.UI_MODE_NIGHT_YES)
|| RoutingController.get().isPlanning()
|| Framework.nativeGetChoosePositionMode() != Framework.ChoosePositionMode.NONE
));

View file

@ -89,7 +89,8 @@ public class TransitStepView extends View implements MultilineLayoutManager.Sque
{
mDrawable = null;
mText = info.getDistance() + " " + info.getDistanceUnits();
mTextPaint.setColor(ThemeUtils.isDefaultTheme(getContext()) ? Color.BLACK : Color.WHITE);
//TODO @RedAuburn: set this with themed resource defs
//mTextPaint.setColor(ThemeUtils.isDefaultTheme(getContext()) ? Color.BLACK : Color.WHITE);
}
else
{

View file

@ -59,9 +59,9 @@ public enum ThemeSwitcher
*/
private void setAndroidTheme(@NonNull String theme)
{
// if (ThemeUtils.isSystemTheme(mContext, theme))
// AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
if (ThemeUtils.isNightTheme(mContext, theme))
if (ThemeUtils.isSystemTheme(mContext, theme))
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
else if (ThemeUtils.isNightTheme(mContext, theme))
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
else if (ThemeUtils.isDefaultTheme(mContext, theme))
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);

View file

@ -44,11 +44,6 @@ public final class ThemeUtils
return VALUE_BUFFER.resourceId;
}
public static boolean isDefaultTheme(@NonNull Context context)
{
return isDefaultTheme(context, Config.getThemeSettings(context));
}
public static boolean isDefaultTheme(@NonNull Context context, String theme)
{
String defaultTheme = context.getString(R.string.theme_default);