Compare commits

...
Sign in to create a new pull request.

49 commits

Author SHA1 Message Date
ba08806f15 fix nav bars i think??
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-10 17:50:50 +00:00
e4967be588 let android handle follow-system for UI, resolve manually in mapstyle
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-07 16:04:01 +00:00
0f5f90322a clean up calcAutoTheme
don't reuse variables, declare in scope
2025-03-06 18:20:09 +00:00
4da1ac38c4 fix theme subtitle not updating
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 18:47:25 +00:00
b65e4cfa30 banish is{theme} checkers
nav-auto not working, RoutingController.get().isVehicleNavigation() doesn't work??? maybe called too early before it's set?
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 18:06:58 +00:00
6074f4bfd1 fix status bar colour
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 18:06:10 +00:00
d731773c21 themeswitcher cleanup
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 18:06:10 +00:00
83801d3e85 note
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:44 +00:00
18a4f6eb0e remove unused thing
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
36b136bed5 minor rename
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
2ab8eb336f fix settings background colour not being set
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
c953ffd70a remove unused thememode code
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
2e66ac4182 replace drawables using theme query to use light/dark variants
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
766014752e use night drawable variants instead of getting category icons programatically
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
d5bb82c5de don't set settings card background programatically
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
ab0633ca26 trafficbutton - comment out isNightTheme usages
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
3f4721bbd9 set routing buttons colour with xml, not programatically
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
881e86dd93 set help icon tint with xml, not programatically
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
8a4468ac1d remove manual theme setting in timepicker
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
a577a24911 cleanup comments
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
48916d6e06 remove commented out stuff
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
a85b84c720 clean up manifest
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
8c32a35806 throw error if bad theme passed to setAndroidTheme
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
685c77df2a comment cleanup
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
50cbcd0171 add time-based fallback for auto
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
557121f55a auto and navauto working
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
a035bb3d9a fix system theme more
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
8305cd42b2 handle system-theme in resolveMapStyle
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:43 +00:00
db3c88f62f split autotheme into new function
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:42 +00:00
7ecf0ba840 fix flow
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:42 +00:00
a352d870bf add notes, re-name and reorder stuff
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:42 +00:00
4b420f8c5b rename get/setThemeSettings - no longer just UI theme
Signed-off-by: Harry Bond <me@hbond.xyz>
2025-03-04 14:56:42 +00:00
637a051033 return getcustomtheme
still needed
2025-03-04 14:56:42 +00:00
c65fb53062 these need to be duplicated to night theme
getResource in themeutils doesn't fall back (but i don't think it should)
2025-03-04 14:56:42 +00:00
c037e951a0 remove uimode configchanges in manifest 2025-03-04 14:56:42 +00:00
6135c19079 remove superfluous theme setting code 2025-03-04 14:56:42 +00:00
e6670730d9 split night themes into values-night 2025-03-04 14:56:42 +00:00
9d6a1fb1ba fix splash light/dark implementation 2025-03-04 14:56:42 +00:00
ebbe713f8f more change needed 2025-03-04 14:56:42 +00:00
0edbc5c421 change this 2025-03-04 14:56:42 +00:00
5762449986 eggdfgdgf 2025-03-04 14:56:42 +00:00
d005ee6149 sfdsdfsd 2025-03-04 14:56:42 +00:00
bfad3195ad dfdfg 2025-03-04 14:56:42 +00:00
ce9822f950 srfdtghjhfgh 2025-03-04 14:56:42 +00:00
6b0c05bdc8 fgdgfg 2025-03-04 14:56:42 +00:00
54c8a4c8ed cvbg 2025-03-04 14:56:42 +00:00
2383c021b9 check 2025-03-04 14:56:42 +00:00
7cf9de5d05 dfrg 2025-03-04 14:56:41 +00:00
d1b918c263 [android] rework Light, Dark, and System modes
(rebased from PR, some additional minor cleanup/fixes)
TODO: debug commands like ?light don't work.
Signed-off-by: Harry Bond <me@hbond.xyz>
Signed-off-by: Sebastiao Sousa <sebastiao.sousa@tecnico.ulisboa.pt>
Co-authored-by: Francisco Nael Salgado <francisco.nael.salgado@tecnico.ulisboa.pt>
2025-03-04 14:56:41 +00:00
99 changed files with 567 additions and 738 deletions

View file

@ -346,7 +346,7 @@
<activity
android:name="app.organicmaps.DownloadResourcesLegacyActivity"
android:configChanges="orientation|screenLayout|screenSize"
android:configChanges="uiMode|orientation|screenLayout|screenSize" />
android:screenOrientation="fullUser"/>
<activity-alias
@ -374,7 +374,7 @@
<activity
android:name="app.organicmaps.downloader.DownloaderActivity"
android:configChanges="orientation|screenLayout|screenSize"
android:configChanges="uiMode|orientation|screenLayout|screenSize"
android:screenOrientation="fullUser"
android:label="@string/download_maps"
android:parentActivityName="app.organicmaps.MwmActivity"
@ -382,7 +382,7 @@
<activity
android:name="app.organicmaps.search.SearchActivity"
android:configChanges="orientation|screenLayout|screenSize"
android:configChanges="uiMode|orientation|screenLayout|screenSize"
android:screenOrientation="fullUser"
android:label="@string/search_map"
android:parentActivityName="app.organicmaps.MwmActivity"
@ -390,10 +390,11 @@
<activity
android:name="app.organicmaps.settings.SettingsActivity"
android:configChanges="orientation|screenLayout|screenSize"
android:configChanges="uiMode|orientation|screenLayout|screenSize"
android:screenOrientation="fullUser"
android:label="@string/settings"
android:parentActivityName="app.organicmaps.MwmActivity" />
android:parentActivityName="app.organicmaps.MwmActivity"
android:theme="@style/MwmTheme.CardBg"/>
<activity
android:name="app.organicmaps.help.HelpActivity"
@ -408,7 +409,7 @@
<activity
android:name="app.organicmaps.bookmarks.BookmarkCategoriesActivity"
android:configChanges="orientation|screenLayout|screenSize"
android:configChanges="uiMode|orientation|screenLayout|screenSize"
android:screenOrientation="fullUser"
android:label="@string/bookmarks_and_tracks"
android:parentActivityName="app.organicmaps.MwmActivity"
@ -416,7 +417,7 @@
<activity
android:name="app.organicmaps.bookmarks.BookmarkListActivity"
android:configChanges="orientation|screenLayout|screenSize"
android:configChanges="uiMode|orientation|screenLayout|screenSize"
android:screenOrientation="fullUser"
android:label="@string/bookmarks"
android:parentActivityName="app.organicmaps.bookmarks.BookmarkCategoriesActivity"
@ -424,7 +425,7 @@
<activity
android:name="app.organicmaps.editor.EditorActivity"
android:configChanges="orientation|screenLayout|screenSize"
android:configChanges="uiMode|orientation|screenLayout|screenSize"
android:screenOrientation="fullUser"
android:label="@string/edit_place"
android:parentActivityName="app.organicmaps.MwmActivity"
@ -458,7 +459,7 @@
android:name="app.organicmaps.settings.DrivingOptionsActivity"
android:label="@string/driving_options_title"/>
<activity
android:name="app.organicmaps.MapPlaceholderActivity"/>
android:name="app.organicmaps.MapPlaceholderActivity" />
<activity
android:name="app.organicmaps.car.screens.permissions.RequestPermissionsActivity"/>
<service

View file

@ -450,13 +450,6 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
.show();
}
@Override
@StyleRes
public int getThemeResourceId(@NonNull String theme)
{
return R.style.MwmTheme_DownloadResourcesLegacy;
}
private static native int nativeGetBytesToDownload();
private static native int nativeStartNextFileDownload(Listener listener);
private static native void nativeCancelCurrentFile();

View file

@ -66,8 +66,6 @@ public final class Map
private boolean mSurfaceAttached;
private boolean mLaunchByDeepLink;
@Nullable
private String mUiThemeOnPause;
@Nullable
private MapRenderingListener mMapRenderingListener;
@Nullable
private CallbackUnsupported mCallbackUnsupported;
@ -136,12 +134,6 @@ public final class Map
public void onSurfaceCreated(final Context context, final Surface surface, Rect surfaceFrame, int surfaceDpi)
{
if (isThemeChangingProcess(context))
{
Logger.d(TAG, "Theme changing process, skip 'onSurfaceCreated' callback");
return;
}
Logger.d(TAG, "mSurfaceCreated = " + mSurfaceCreated);
if (nativeIsEngineCreated())
{
@ -192,11 +184,6 @@ public final class Map
public void onSurfaceChanged(final Context context, final Surface surface, Rect surfaceFrame, boolean isSurfaceCreating)
{
if (isThemeChangingProcess(context))
{
Logger.d(TAG, "Theme changing process, skip 'onSurfaceChanged' callback");
return;
}
Logger.d(TAG, "mSurfaceCreated = " + mSurfaceCreated);
if (!mSurfaceCreated || (!mRequireResize && isSurfaceCreating))
@ -253,8 +240,6 @@ public final class Map
public void onPause(final Context context)
{
mUiThemeOnPause = Config.getCurrentUiTheme(context);
// Pause/Resume can be called without surface creation/destroy.
if (mSurfaceAttached)
nativePauseSurfaceRendering();
@ -361,11 +346,6 @@ public final class Map
nativeApplyWidgets();
}
private boolean isThemeChangingProcess(final Context context)
{
return mUiThemeOnPause != null && !mUiThemeOnPause.equals(Config.getCurrentUiTheme(context));
}
// Engine
private static native boolean nativeCreateEngine(Surface surface, int density,
boolean firstLaunch,

View file

@ -475,21 +475,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
}
}
@Override
@StyleRes
protected int getThemeResourceId(@NonNull String theme)
{
Context context = getApplicationContext();
if (ThemeUtils.isDefaultTheme(context, theme))
return R.style.MwmTheme_MainActivity;
if (ThemeUtils.isNightTheme(context, theme))
return R.style.MwmTheme_Night_MainActivity;
return super.getThemeResourceId(theme);
}
@Override
public void onDisplayChangedToCar(@NonNull Runnable onTaskFinishedCallback)
{
@ -581,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

@ -7,6 +7,7 @@ import static app.organicmaps.api.Const.EXTRA_PICK_POINT;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.Log;
@ -25,6 +26,7 @@ import app.organicmaps.location.LocationHelper;
import app.organicmaps.util.Config;
import app.organicmaps.util.LocationUtils;
import app.organicmaps.util.SharingUtils;
import app.organicmaps.util.ThemeSwitcher;
import app.organicmaps.util.ThemeUtils;
import app.organicmaps.util.Utils;
import app.organicmaps.util.concurrency.UiThread;
@ -59,15 +61,6 @@ public class SplashActivity extends AppCompatActivity
{
super.onCreate(savedInstanceState);
final Context context = getApplicationContext();
final String theme = Config.getCurrentUiTheme(context);
if (ThemeUtils.isDefaultTheme(context, theme))
setTheme(R.style.MwmTheme_Splash);
else if (ThemeUtils.isNightTheme(context, theme))
setTheme(R.style.MwmTheme_Night_Splash);
else
throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme);
UiThread.cancelDelayedTasks(mInitCoreDelayedTask);
setContentView(R.layout.activity_splash);
mPermissionRequest = registerForActivityResult(new ActivityResultContracts.RequestMultiplePermissions(),
@ -121,6 +114,14 @@ public class SplashActivity extends AppCompatActivity
mApiRequest = null;
}
@Override
public void onConfigurationChanged(@NonNull Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
ThemeSwitcher.INSTANCE.restart(false);
UiThread.runLater(this::recreate);
}
private void showFatalErrorDialog(@StringRes int titleId, @StringRes int messageId, Exception error)
{
mCanceled = true;

View file

@ -14,12 +14,6 @@ import app.organicmaps.util.ThemeUtils;
public class BaseMwmDialogFragment extends DialogFragment
{
@StyleRes
protected final int getFullscreenTheme()
{
return ThemeUtils.isNightTheme(requireContext()) ? getFullscreenDarkTheme() : getFullscreenLightTheme();
}
protected int getStyle()
{
return STYLE_NORMAL;
@ -38,22 +32,9 @@ public class BaseMwmDialogFragment extends DialogFragment
int style = getStyle();
int theme = getCustomTheme();
if (style != STYLE_NORMAL || theme != 0)
//noinspection WrongConstant
setStyle(style, theme);
}
@StyleRes
protected int getFullscreenLightTheme()
{
return R.style.MwmTheme_DialogFragment_Fullscreen;
}
@StyleRes
protected int getFullscreenDarkTheme()
{
return R.style.MwmTheme_DialogFragment_Fullscreen_Night;
}
@NonNull
protected Application getAppContextOrThrow()
{

View file

@ -1,9 +1,9 @@
package app.organicmaps.base;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.content.res.Configuration;
import android.media.AudioManager;
import android.os.Bundle;
import android.view.MenuItem;
@ -13,7 +13,6 @@ import androidx.activity.SystemBarStyle;
import androidx.annotation.CallSuper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StyleRes;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
@ -25,7 +24,7 @@ import app.organicmaps.R;
import app.organicmaps.SplashActivity;
import app.organicmaps.util.Config;
import app.organicmaps.util.RtlUtils;
import app.organicmaps.util.ThemeUtils;
import app.organicmaps.util.ThemeSwitcher;
import app.organicmaps.util.concurrency.UiThread;
import app.organicmaps.util.log.Logger;
@ -40,20 +39,6 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
@NonNull
private String mThemeName;
@StyleRes
protected int getThemeResourceId(@NonNull String theme)
{
Context context = getApplicationContext();
if (ThemeUtils.isDefaultTheme(context, theme))
return R.style.MwmTheme;
if (ThemeUtils.isNightTheme(context, theme))
return R.style.MwmTheme_Night;
throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme);
}
/**
* Shows splash screen and initializes the core in case when it was not initialized.
*
@ -65,8 +50,7 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
protected final void onCreate(@Nullable Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
mThemeName = Config.getCurrentUiTheme(getApplicationContext());
setTheme(getThemeResourceId(mThemeName));
mThemeName = Config.getThemeSettings(getApplicationContext());
EdgeToEdge.enable(this, SystemBarStyle.dark(Color.TRANSPARENT));
RtlUtils.manageRtl(this);
if (!MwmApplication.from(this).arePlatformAndCoreInitialized())
@ -125,13 +109,22 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
public void onPostResume()
{
super.onPostResume();
if (!mThemeName.equals(Config.getCurrentUiTheme(getApplicationContext())))
if (!mThemeName.equals(Config.getThemeSettings(getApplicationContext())))
{
// TODO: is this still needed?
// Workaround described in https://code.google.com/p/android/issues/detail?id=93731
UiThread.runLater(this::recreate);
}
}
@Override
public void onConfigurationChanged(@NonNull Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
ThemeSwitcher.INSTANCE.restart(false);
UiThread.runLater(this::recreate);
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{

View file

@ -39,14 +39,6 @@ public class BookmarkCategoriesActivity extends BaseToolbarActivity
super.onPause();
}
@Override
@StyleRes
public int getThemeResourceId(@NonNull String theme)
{
return ThemeUtils.getWindowBgThemeResourceId(getApplicationContext(), theme);
}
@Override
protected Class<? extends Fragment> getFragmentClass()
{

View file

@ -38,14 +38,6 @@ public class BookmarkListActivity extends BaseToolbarActivity
super.onPause();
}
@Override
@StyleRes
public int getThemeResourceId(@NonNull String theme)
{
return ThemeUtils.getCardBgThemeResourceId(getApplicationContext(), theme);
}
@Override
protected Class<? extends Fragment> getFragmentClass()
{

View file

@ -30,15 +30,15 @@ public class CategoriesScreen extends BaseMapScreen
private record CategoryData(@StringRes int nameResId, @DrawableRes int iconResId, @DrawableRes int iconNightResId)
{
}
//TODO: previously handled theme by itself, but now icons are dynamic so not needed.
private static final List<CategoryData> CATEGORIES = Arrays.asList(
new CategoryData(R.string.category_fuel, R.drawable.ic_category_fuel, R.drawable.ic_category_fuel_night),
new CategoryData(R.string.category_parking, R.drawable.ic_category_parking, R.drawable.ic_category_parking_night),
new CategoryData(R.string.category_eat, R.drawable.ic_category_eat, R.drawable.ic_category_eat_night),
new CategoryData(R.string.category_food, R.drawable.ic_category_food, R.drawable.ic_category_food_night),
new CategoryData(R.string.category_hotel, R.drawable.ic_category_hotel, R.drawable.ic_category_hotel_night),
new CategoryData(R.string.category_toilet, R.drawable.ic_category_toilet, R.drawable.ic_category_toilet_night),
new CategoryData(R.string.category_rv, R.drawable.ic_category_rv, R.drawable.ic_category_rv_night)
new CategoryData(R.string.category_fuel, R.drawable.ic_category_fuel, R.drawable.ic_category_fuel),
new CategoryData(R.string.category_parking, R.drawable.ic_category_parking, R.drawable.ic_category_parking),
new CategoryData(R.string.category_eat, R.drawable.ic_category_eat, R.drawable.ic_category_eat),
new CategoryData(R.string.category_food, R.drawable.ic_category_food, R.drawable.ic_category_food),
new CategoryData(R.string.category_hotel, R.drawable.ic_category_hotel, R.drawable.ic_category_hotel),
new CategoryData(R.string.category_toilet, R.drawable.ic_category_toilet, R.drawable.ic_category_toilet),
new CategoryData(R.string.category_rv, R.drawable.ic_category_rv, R.drawable.ic_category_rv)
);
private final int MAX_CATEGORIES_SIZE;

View file

@ -75,7 +75,7 @@ public class SettingsScreen extends BaseMapScreen
private Item createThemeItem()
{
final Row.Builder builder = new Row.Builder();
builder.setTitle(getCarContext().getString(R.string.pref_map_style_title));
builder.setTitle(getCarContext().getString(R.string.pref_appearance_title));
builder.addText(getCarContext().getString(ThemeUtils.getThemeMode(getCarContext()).getTitleId()));
builder.setOnClickListener(() -> getScreenManager().push(new ThemeScreen(getCarContext(), getSurfaceRenderer())));
builder.setBrowsable(true);

View file

@ -47,7 +47,7 @@ public class ThemeScreen extends BaseMapScreen
{
final Header.Builder builder = new Header.Builder();
builder.setStartHeaderAction(Action.BACK);
builder.setTitle(getCarContext().getString(R.string.pref_map_style_title));
builder.setTitle(getCarContext().getString(R.string.pref_appearance_title));
return builder.build();
}
@ -56,7 +56,7 @@ public class ThemeScreen extends BaseMapScreen
{
final ItemList.Builder builder = new ItemList.Builder();
final ThemeUtils.ThemeMode currentThemeMode = ThemeUtils.getThemeMode(getCarContext());
builder.addItem(createRadioButton(ThemeUtils.ThemeMode.AUTO, currentThemeMode));
builder.addItem(createRadioButton(ThemeUtils.ThemeMode.FOLLOW_SYSTEM, currentThemeMode));
builder.addItem(createRadioButton(ThemeUtils.ThemeMode.NIGHT, currentThemeMode));
builder.addItem(createRadioButton(ThemeUtils.ThemeMode.LIGHT, currentThemeMode));
return new ListTemplate.Builder().setHeader(createHeader()).setSingleList(builder.build()).build();

View file

@ -17,9 +17,9 @@ public final class ThemeUtils
{
public enum ThemeMode
{
AUTO(R.string.auto, R.string.theme_auto),
LIGHT(R.string.off, R.string.theme_default),
NIGHT(R.string.on, R.string.theme_night);
LIGHT(R.string.light, R.string.theme_default),
NIGHT(R.string.dark, R.string.theme_night),
FOLLOW_SYSTEM(R.string.follow_system, R.string.theme_follow_system);
ThemeMode(@StringRes int titleId, @StringRes int prefsKeyId)
{
@ -58,7 +58,7 @@ public final class ThemeUtils
@UiThread
public static void update(@NonNull CarContext context, @NonNull ThemeMode oldThemeMode)
{
final ThemeMode newThemeMode = oldThemeMode == ThemeMode.AUTO ? (context.isDarkMode() ? ThemeMode.NIGHT : ThemeMode.LIGHT) : oldThemeMode;
final ThemeMode newThemeMode = oldThemeMode == ThemeMode.FOLLOW_SYSTEM ? (context.isDarkMode() ? ThemeMode.NIGHT : ThemeMode.LIGHT) : oldThemeMode;
@Framework.MapStyle
int newMapStyle;
@ -74,7 +74,7 @@ public final class ThemeUtils
public static boolean isNightMode(@NonNull CarContext context)
{
final ThemeMode themeMode = getThemeMode(context);
return themeMode == ThemeMode.NIGHT || (themeMode == ThemeMode.AUTO && context.isDarkMode());
return themeMode == ThemeMode.NIGHT || (themeMode == ThemeMode.FOLLOW_SYSTEM && context.isDarkMode());
}
@SuppressLint("ApplySharedPref")
@ -88,13 +88,13 @@ public final class ThemeUtils
@NonNull
public static ThemeMode getThemeMode(@NonNull CarContext context)
{
final String autoTheme = context.getString(R.string.theme_auto);
final String followSystemTheme = context.getString(R.string.theme_follow_system);
final String lightTheme = context.getString(R.string.theme_default);
final String nightTheme = context.getString(R.string.theme_night);
final String themeMode = getSharedPreferences(context).getString(THEME_KEY, autoTheme);
final String themeMode = getSharedPreferences(context).getString(THEME_KEY, followSystemTheme);
if (themeMode.equals(autoTheme))
return ThemeMode.AUTO;
if (themeMode.equals(followSystemTheme))
return ThemeMode.FOLLOW_SYSTEM;
else if (themeMode.equals(lightTheme))
return ThemeMode.LIGHT;
else if (themeMode.equals(nightTheme))

View file

@ -79,10 +79,7 @@ public class HoursMinutesPickerFragment extends BaseMwmDialogFragment
//noinspection ConstantConditions
mTabs.getTabAt(mSelectedTab).select();
@StyleRes final int theme = ThemeUtils.isNightTheme(requireContext()) ?
R.style.MwmMain_DialogFragment_TimePicker_Night :
R.style.MwmMain_DialogFragment_TimePicker;
final AlertDialog dialog = new MaterialAlertDialogBuilder(requireActivity(), theme)
final AlertDialog dialog = new MaterialAlertDialogBuilder(requireActivity())
.setView(root)
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(R.string.ok, null)
@ -141,14 +138,9 @@ public class HoursMinutesPickerFragment extends BaseMwmDialogFragment
mTabs = root.findViewById(R.id.tabs);
TextView tabView = (TextView) inflater.inflate(R.layout.tab_timepicker, mTabs, false);
tabView.setText(getResources().getString(R.string.editor_time_from));
final ColorStateList textColor = AppCompatResources.getColorStateList(requireContext(),
ThemeUtils.isNightTheme(requireContext()) ? R.color.accent_color_selector_night
: R.color.accent_color_selector);
tabView.setTextColor(textColor);
mTabs.addTab(mTabs.newTab().setCustomView(tabView), true);
tabView = (TextView) inflater.inflate(R.layout.tab_timepicker, mTabs, false);
tabView.setText(getResources().getString(R.string.editor_time_to));
tabView.setTextColor(textColor);
mTabs.addTab(mTabs.newTab().setCustomView(tabView), true);
mTabs.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener()
{

View file

@ -106,9 +106,6 @@ public class MapButtonsController extends Fragment
helpButton.setImageResource(R.drawable.ic_christmas_tree);
else
helpButton.setImageResource(R.drawable.logo);
// Keep this button colorful in normal theme.
if (!ThemeUtils.isNightTheme(requireContext()))
helpButton.getDrawable().setTintList(null);
}
final View zoomFrame = mFrame.findViewById(R.id.zoom_buttons_container);

View file

@ -39,29 +39,32 @@ public class TrafficButton
{
Context context = trafficBtn.getContext();
Resources res = context.getResources();
final int animResId = ThemeUtils.getResource(context, R.attr.trafficLoadingAnimation);
final int animResId = R.drawable.anim_traffic_loading;
return (AnimationDrawable) Objects.requireNonNull(ResourcesCompat.getDrawable(res, animResId, context.getTheme()));
}
void turnOff()
{
stopWaitingAnimation();
mButton.setImageResource(ThemeUtils.isNightTheme(mButton.getContext()) ? R.drawable.ic_traffic_on_night
: R.drawable.ic_traffic_on);
// TODO: Don't set theme programatically - use an xml with a night variant instead. Also convert to svg.
// mButton.setImageResource(ThemeUtils.isNightTheme(mButton.getContext()) ? R.drawable.ic_traffic_on_night
// : R.drawable.ic_traffic_on);
}
void turnOn()
{
stopWaitingAnimation();
mButton.setImageResource(ThemeUtils.isNightTheme(mButton.getContext()) ? R.drawable.ic_traffic_on_night
: R.drawable.ic_traffic_on);
// TODO: Don't set theme programatically - use an xml with a night variant instead. Also convert to svg.
// mButton.setImageResource(ThemeUtils.isNightTheme(mButton.getContext()) ? R.drawable.ic_traffic_on_night
// : R.drawable.ic_traffic_on);
}
void markAsOutdated()
{
stopWaitingAnimation();
mButton.setImageResource(ThemeUtils.isNightTheme(mButton.getContext()) ? R.drawable.ic_traffic_outdated_night
: R.drawable.ic_traffic_outdated);
// TODO: Don't set theme programatically - use an xml with a night variant instead. Also convert to svg.
// mButton.setImageResource(ThemeUtils.isNightTheme(mButton.getContext()) ? R.drawable.ic_traffic_outdated_night
// : R.drawable.ic_traffic_outdated);
}
void startWaitingAnimation()

View file

@ -146,7 +146,7 @@ final class RoutingBottomMenuController implements View.OnClickListener
mActionIcon = mActionButton.findViewById(R.id.iv__icon);
UiUtils.hide(mAltitudeChartFrame, mActionFrame);
mListener = listener;
int dividerRes = ThemeUtils.getResource(mContext, R.attr.transitStepDivider);
int dividerRes = R.drawable.dot_divider;
Drawable dividerDrawable = ContextCompat.getDrawable(mContext, dividerRes);
Resources res = mContext.getResources();
mTransitViewDecorator = new DotDividerItemDecoration(dividerDrawable, res.getDimensionPixelSize(R.dimen.margin_base),

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

@ -110,10 +110,7 @@ class CategoriesAdapter extends RecyclerView.Adapter<CategoriesAdapter.ViewHolde
@NonNull String packageName,
@NonNull String key)
{
final boolean isNightTheme = ThemeUtils.isNightTheme(context);
String iconId = "ic_" + key;
if (isNightTheme)
iconId = iconId + "_night";
return context.getResources().getIdentifier(iconId, "drawable", packageName);
}

View file

@ -34,12 +34,12 @@ public class SearchActivity extends BaseMwmFragmentActivity
activity.startActivity(i);
}
@Override
@StyleRes
public int getThemeResourceId(@NonNull String theme)
{
return ThemeUtils.getCardBgThemeResourceId(getApplicationContext(), theme);
}
// @Override
// @StyleRes
// public int getThemeResourceId(@NonNull String theme)
// {
// return ThemeUtils.getCardBgThemeResourceId(getApplicationContext(), theme);
// }
@Override
protected Class<? extends Fragment> getFragmentClass()

View file

@ -50,13 +50,6 @@ abstract class BaseXmlSettingsFragment extends PreferenceFragmentCompat
{
super.onViewCreated(view, savedInstanceState);
int color;
if (ThemeUtils.isDefaultTheme(requireContext()))
color = ContextCompat.getColor(requireContext(), R.color.bg_cards);
else
color = ContextCompat.getColor(requireContext(), R.color.bg_cards_night);
view.setBackgroundColor(color);
RecyclerView recyclerView = getListView();
ViewCompat.setOnApplyWindowInsetsListener(recyclerView, new ScrollableContentInsetsListener(recyclerView));
}

View file

@ -395,19 +395,17 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment implements La
{
final ListPreference pref = getPreference(getString(R.string.pref_map_style));
String curTheme = Config.getUiThemeSettings(requireContext());
String curTheme = Config.getThemeSettings(requireContext());
pref.setValue(curTheme);
pref.setSummary(pref.getEntry());
pref.setOnPreferenceChangeListener((preference, newValue) -> {
final String themeName = (String) newValue;
if (!Config.setUiThemeSettings(requireContext(), themeName))
pref.setValue(themeName);
pref.setSummary(pref.getEntry());
if (!Config.setThemeSettings(requireContext(), themeName))
return true;
ThemeSwitcher.INSTANCE.restart(false);
ThemeMode mode = ThemeMode.getInstance(requireContext().getApplicationContext(), themeName);
CharSequence summary = pref.getEntries()[mode.ordinal()];
pref.setSummary(summary);
return true;
});
}
@ -505,32 +503,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment implements La
getSettingsActivity().onBackPressed();
}
enum ThemeMode
{
DEFAULT(R.string.theme_default),
NIGHT(R.string.theme_night),
AUTO(R.string.theme_auto),
NAV_AUTO(R.string.theme_nav_auto);
private final int mModeStringId;
ThemeMode(@StringRes int modeStringId)
{
mModeStringId = modeStringId;
}
@NonNull
public static ThemeMode getInstance(@NonNull Context context, @NonNull String src)
{
for (ThemeMode each : values())
{
if (context.getResources().getString(each.mModeStringId).equals(src))
return each;
}
return AUTO;
}
}
public enum SpeedCameraMode
{
AUTO,

View file

@ -24,7 +24,6 @@ public final class Config
private static final String KEY_MISC_KAYAK_ACCEPTED = "IsKayakApproved";
private static final String KEY_MISC_LOCATION_REQUESTED = "LocationRequested";
private static final String KEY_MISC_UI_THEME = "UiTheme";
private static final String KEY_MISC_UI_THEME_SETTINGS = "UiThemeSettings";
private static final String KEY_MISC_USE_MOBILE_DATA = "UseMobileData";
private static final String KEY_MISC_USE_MOBILE_DATA_TIMESTAMP = "UseMobileDataTimestamp";
private static final String KEY_MISC_USE_MOBILE_DATA_ROAMING = "UseMobileDataRoaming";
@ -253,42 +252,23 @@ public final class Config
}
@NonNull
public static String getCurrentUiTheme(@NonNull Context context)
public static String getThemeSettings(@NonNull Context context)
{
String defaultTheme = MwmApplication.from(context).getString(R.string.theme_default);
String res = getString(KEY_MISC_UI_THEME, defaultTheme);
if (ThemeUtils.isValidTheme(context, res))
// Fallback & default theme
String fallbackTheme = MwmApplication.from(context).getString(R.string.theme_follow_system);
String res = getString(KEY_MISC_UI_THEME, fallbackTheme);
if (ThemeUtils.isValidTheme(context, res) || ThemeUtils.isValidThemeMode(context, res))
return res;
return defaultTheme;
return fallbackTheme;
}
static void setCurrentUiTheme(@NonNull Context context, @NonNull String theme)
public static boolean setThemeSettings(@NonNull Context context, @NonNull String theme)
{
if (getCurrentUiTheme(context).equals(theme))
return;
setString(KEY_MISC_UI_THEME, theme);
}
@NonNull
public static String getUiThemeSettings(@NonNull Context context)
{
String autoTheme = MwmApplication.from(context).getString(R.string.theme_auto);
String res = getString(KEY_MISC_UI_THEME_SETTINGS, autoTheme);
if (ThemeUtils.isValidTheme(context, res) || ThemeUtils.isAutoTheme(context, res) || ThemeUtils.isNavAutoTheme(context, res))
return res;
return autoTheme;
}
public static boolean setUiThemeSettings(@NonNull Context context, String theme)
{
if (getUiThemeSettings(context).equals(theme))
if (getThemeSettings(context).equals(theme))
return false;
setString(KEY_MISC_UI_THEME_SETTINGS, theme);
setString(KEY_MISC_UI_THEME, theme);
return true;
}

View file

@ -1,61 +1,28 @@
package app.organicmaps.util;
import android.app.Activity;
import android.app.UiModeManager;
import android.content.Context;
import android.content.res.Configuration;
import android.location.Location;
import android.os.Build;
import androidx.annotation.NonNull;
import androidx.annotation.UiThread;
import androidx.appcompat.app.AppCompatDelegate;
import java.util.Calendar;
import app.organicmaps.Framework;
import app.organicmaps.MwmApplication;
import app.organicmaps.R;
import app.organicmaps.display.DisplayManager;
import app.organicmaps.downloader.DownloaderStatusIcon;
import app.organicmaps.location.LocationHelper;
import app.organicmaps.routing.RoutingController;
import app.organicmaps.util.concurrency.UiThread;
import app.organicmaps.util.log.Logger;
public enum ThemeSwitcher
{
INSTANCE;
private static final long CHECK_INTERVAL_MS = 30 * 60 * 1000;
private static boolean mRendererActive = false;
private final Runnable mAutoThemeChecker = new Runnable()
{
@Override
public void run()
{
String nightTheme = MwmApplication.from(mContext).getString(R.string.theme_night);
String defaultTheme = MwmApplication.from(mContext).getString(R.string.theme_default);
String theme = defaultTheme;
Location last = LocationHelper.from(mContext).getSavedLocation();
boolean navAuto = RoutingController.get().isNavigating() && ThemeUtils.isNavAutoTheme(mContext);
if (navAuto || ThemeUtils.isAutoTheme(mContext))
{
if (last == null)
theme = Config.getCurrentUiTheme(mContext);
else
{
long currentTime = System.currentTimeMillis() / 1000;
boolean day = Framework.nativeIsDayTime(currentTime, last.getLatitude(), last.getLongitude());
theme = (day ? defaultTheme : nightTheme);
}
}
setThemeAndMapStyle(theme);
UiThread.cancelDelayedTasks(mAutoThemeChecker);
if (navAuto || ThemeUtils.isAutoTheme(mContext))
UiThread.runLater(mAutoThemeChecker, CHECK_INTERVAL_MS);
}
};
@SuppressWarnings("NotNullFieldNotInitialized")
@NonNull
private Context mContext;
@ -74,79 +41,35 @@ public enum ThemeSwitcher
* <code>true</code> only if the map is rendered and visible on the screen
* at this moment, otherwise <code>false</code>.
*/
@androidx.annotation.UiThread
@UiThread
public void restart(boolean isRendererActive)
{
mRendererActive = isRendererActive;
String theme = Config.getUiThemeSettings(mContext);
if (ThemeUtils.isAutoTheme(mContext, theme) || ThemeUtils.isNavAutoTheme(mContext, theme))
{
mAutoThemeChecker.run();
return;
}
UiThread.cancelDelayedTasks(mAutoThemeChecker);
setThemeAndMapStyle(theme);
String savedTheme = Config.getThemeSettings(mContext);
// TODO: Handle debug commands
String resolvedTheme = resolveBasicTheme(savedTheme);
int resolvedMapStyle = resolveMapStyle(resolvedTheme);
setAndroidTheme(resolvedTheme);
setMapStyle(resolvedMapStyle);
}
private void setThemeAndMapStyle(@NonNull String theme)
/**
* Applies the android theme
* @param theme MUST be follow-system/theme_light/dark
*/
private void setAndroidTheme(@NonNull String theme)
{
UiModeManager uiModeManager = (UiModeManager) mContext.getSystemService(Context.UI_MODE_SERVICE);
String oldTheme = Config.getCurrentUiTheme(mContext);
@Framework.MapStyle
int oldStyle = Framework.nativeGetMapStyle();
@Framework.MapStyle
int style;
if (ThemeUtils.isNightTheme(mContext, theme))
{
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_YES);
else
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
if (RoutingController.get().isVehicleNavigation())
style = Framework.MAP_STYLE_VEHICLE_DARK;
else if (Framework.nativeIsOutdoorsLayerEnabled())
style = Framework.MAP_STYLE_OUTDOORS_DARK;
else
style = Framework.MAP_STYLE_DARK;
}
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);
else
{
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_NO);
else
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
if (RoutingController.get().isVehicleNavigation())
style = Framework.MAP_STYLE_VEHICLE_CLEAR;
else if (Framework.nativeIsOutdoorsLayerEnabled())
style = Framework.MAP_STYLE_OUTDOORS_CLEAR;
else
style = Framework.MAP_STYLE_CLEAR;
}
if (!theme.equals(oldTheme))
{
Config.setCurrentUiTheme(mContext, theme);
DownloaderStatusIcon.clearCache();
final Activity a = MwmApplication.from(mContext).getTopActivity();
if (a != null && !a.isFinishing())
a.recreate();
}
else
{
// If the UI theme is not changed we just need to change the map style if needed.
int currentStyle = Framework.nativeGetMapStyle();
if (currentStyle == style)
return;
SetMapStyle(style);
}
throw new IllegalArgumentException(theme+" passed, but only follow-system/theme_light/dark are allowed.");
}
private void SetMapStyle(@Framework.MapStyle int style)
private void setMapStyle(@Framework.MapStyle int style)
{
// Because of the distinct behavior in auto theme, Android Auto employs its own mechanism for theme switching.
// For the Android Auto theme switcher, please consult the app.organicmaps.car.util.ThemeUtils module.
@ -159,4 +82,90 @@ public enum ThemeSwitcher
else
Framework.nativeMarkMapStyle(style);
}
}
/**
* resolve custom themes (auto, navauto) to basic ones (light, dark, follow-system)
* @return theme handle-able by android theme system.
*/
private String resolveBasicTheme(@NonNull String theme)
{
if (ThemeUtils.isAutoTheme(mContext, theme))
return calcAutoTheme();
else if (ThemeUtils.isNavAutoTheme(mContext, theme))
{
// navauto should always be light, except in nav mode
if (RoutingController.get().isVehicleNavigation())
return calcAutoTheme();
else
return mContext.getResources().getString(R.string.theme_default);
}
else
// Passthrough for normal themes
return theme;
}
/**
* Resolve the map (drape) style from a resolved theme string.
* @param theme MUST be theme_light/dark/follow-system
* @return drape/core compatible map style
*/
private int resolveMapStyle(@NonNull String theme)
{
// Resolve systemtheme for map style as android handles
// the UI so it's not really a custom theme.
if (ThemeUtils.isSystemTheme(mContext, theme))
{
int uiMode = mContext.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
theme = uiMode == Configuration.UI_MODE_NIGHT_YES
? mContext.getResources().getString(R.string.theme_night)
: mContext.getResources().getString(R.string.theme_default);
}
if (ThemeUtils.isNightTheme(mContext, theme))
{
if (RoutingController.get().isVehicleNavigation())
return Framework.MAP_STYLE_VEHICLE_DARK;
else if (Framework.nativeIsOutdoorsLayerEnabled())
return Framework.MAP_STYLE_OUTDOORS_DARK;
else
return Framework.MAP_STYLE_DARK;
}
else if (ThemeUtils.isDefaultTheme(mContext, theme))
{
if (RoutingController.get().isVehicleNavigation())
return Framework.MAP_STYLE_VEHICLE_CLEAR;
else if (Framework.nativeIsOutdoorsLayerEnabled())
return Framework.MAP_STYLE_OUTDOORS_CLEAR;
else
return Framework.MAP_STYLE_CLEAR;
}
else
throw new IllegalArgumentException(theme +" passed, but only theme_light/dark are allowed.");
}
/**
* Determine light/dark theme based on time and location,
* or fall back to time-based (06:00-18:00) when there's no location fix
* @return theme_light/dark string
*/
private String calcAutoTheme()
{
String defaultTheme = mContext.getResources().getString(R.string.theme_default);
String nightTheme = mContext.getResources().getString(R.string.theme_night);
Location last = LocationHelper.from(mContext).getSavedLocation();
boolean day;
if (last != null)
{
long currentTime = System.currentTimeMillis() / 1000;
day = Framework.nativeIsDayTime(currentTime, last.getLatitude(), last.getLongitude());
}
else
{
int currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
day = (currentHour < 18 && currentHour > 6);
}
return (day ? defaultTheme : nightTheme);
}
}

View file

@ -7,7 +7,6 @@ import android.util.TypedValue;
import androidx.annotation.AttrRes;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import androidx.annotation.StyleRes;
import app.organicmaps.R;
@ -45,49 +44,40 @@ public final class ThemeUtils
return VALUE_BUFFER.resourceId;
}
public static boolean isDefaultTheme(@NonNull Context context)
{
return isDefaultTheme(context, Config.getCurrentUiTheme(context));
}
public static boolean isDefaultTheme(@NonNull Context context, String theme)
{
String defaultTheme = context.getString(R.string.theme_default);
return defaultTheme.equals(theme);
}
public static boolean isNightTheme(@NonNull Context context)
{
return isNightTheme(context, Config.getCurrentUiTheme(context));
}
public static boolean isNightTheme(@NonNull Context context, String theme)
{
String nightTheme = context.getString(R.string.theme_night);
return nightTheme.equals(theme);
}
public static boolean isAutoTheme(@NonNull Context context)
public static boolean isSystemTheme(@NonNull Context context, String theme)
{
return isAutoTheme(context, Config.getUiThemeSettings(context));
}
public static boolean isAutoTheme(@NonNull Context context, String theme)
{
String autoTheme = context.getString(R.string.theme_auto);
return autoTheme.equals(theme);
}
public static boolean isNavAutoTheme(@NonNull Context context)
{
return isNavAutoTheme(context, Config.getUiThemeSettings(context));
String followSystemTheme = context.getString(R.string.theme_follow_system);
return followSystemTheme.equals(theme);
}
public static boolean isNavAutoTheme(@NonNull Context context, String theme)
{
String navAutoTheme = context.getString(R.string.theme_nav_auto);
return navAutoTheme.equals(theme);
}
}
public static boolean isAutoTheme(@NonNull Context context, String theme)
{
String followSystemTheme = context.getString(R.string.theme_auto);
return followSystemTheme.equals(theme);
}
public static boolean isValidThemeMode(@NonNull Context context, String res)
{
return isSystemTheme(context, res) || isNavAutoTheme(context, res) || isAutoTheme(context, res);
}
public static boolean isValidTheme(@NonNull Context context, String theme)
{
@ -95,28 +85,4 @@ public final class ThemeUtils
String nightTheme = context.getString(R.string.theme_night);
return (defaultTheme.equals(theme) || nightTheme.equals(theme));
}
@StyleRes
public static int getCardBgThemeResourceId(@NonNull Context context, @NonNull String theme)
{
if (isDefaultTheme(context, theme))
return R.style.MwmTheme_CardBg;
if (isNightTheme(context, theme))
return R.style.MwmTheme_Night_CardBg;
throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme);
}
@StyleRes
public static int getWindowBgThemeResourceId(@NonNull Context context, @NonNull String theme)
{
if (isDefaultTheme(context, theme))
return R.style.MwmTheme_WindowBg;
if (isNightTheme(context, theme))
return R.style.MwmTheme_Night_WindowBg;
throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme);
}
}

View file

@ -37,10 +37,8 @@ public class RoutingToolbarButton extends AppCompatRadioButton
private void initView()
{
setBackgroundResource(ThemeUtils.isNightTheme(getContext()) ? R.drawable.routing_toolbar_button_night
: R.drawable.routing_toolbar_button);
setButtonTintList(ThemeUtils.isNightTheme(getContext()) ? R.color.routing_toolbar_icon_tint_night
: R.color.routing_toolbar_icon_tint);
setBackgroundResource(R.drawable.routing_toolbar_button);
setButtonTintList(R.color.routing_toolbar_icon_tint);
}
public void progress()

View file

@ -106,7 +106,7 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.
@Override
protected int getCustomTheme()
{
return getFullscreenTheme();
return R.style.MwmTheme_DialogFragment_Fullscreen;
}
@Nullable

View file

@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_activated="true"
android:color="@color/routing_button_activated_tint"/>
android:color="?routingToolbarButtonIconActive"/>
<item
android:state_pressed="true"
android:color="@color/routing_button_pressed_tint"/>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_activated="true"
android:color="@color/routing_button_activated_tint_night"/>
<item
android:state_pressed="true"
android:color="@color/routing_button_pressed_tint"/>
<item
android:color="@color/routing_button_tint"/>
</selector>

View file

@ -3,5 +3,5 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorBtnHighlight">
<item android:drawable="@drawable/ripple_mask"/>
<item android:drawable="@drawable/button_accent_night_internal"/>
<item android:drawable="@drawable/button_accent_internal"/>
</ripple>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/button_accent_pressed_night"
<item android:drawable="@drawable/button_accent_pressed"
android:state_pressed="true"/>
<item android:drawable="@drawable/button_accent_normal_night"
<item android:drawable="@drawable/button_accent_normal"
android:state_enabled="true"/>
<item android:drawable="@drawable/button_accent_disabled_night"/>
<item android:drawable="@drawable/button_accent_disabled"/>
</selector>

View file

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View file

@ -3,5 +3,5 @@
android:shape="oval"
android:height="40dp"
android:width="40dp">
<solid android:color="@color/white_primary"/>
<solid android:color="?routingToolbarButtonActive"/>
</shape>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorControlHighlight">
<item>
<selector>
<item
android:state_activated="true"
android:drawable="@drawable/routing_toolbar_button_active"/>
<item
android:drawable="@drawable/routing_toolbar_button_normal_night"/>
</selector>
</item>
</ripple>

View file

@ -3,5 +3,5 @@
android:shape="oval"
android:height="40dp"
android:width="40dp">
<solid android:color="@color/bg_primary_dark"/>
<solid android:color="?routingToolbarButton"/>
</shape>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:height="40dp"
android:width="40dp">
<solid android:color="@color/bg_primary_dark_night"/>
</shape>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:opacity="opaque">
<item android:drawable="?attr/colorPrimary"/>
<item android:drawable="@drawable/ic_splash" android:gravity="center"/>
</layer-list>

View file

@ -48,7 +48,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_half"
android:orientation="vertical"
android:background="?navNextTurnFrame"
android:background="@drawable/bg_nav_next_turn"
android:elevation="@dimen/nav_elevation">
<FrameLayout
android:layout_width="wrap_content"
@ -92,7 +92,7 @@
android:layout_below="@id/nav_next_turn_frame"
android:layout_alignStart="@id/nav_next_turn_frame"
android:layout_alignEnd="@id/nav_next_turn_frame"
android:background="?navNextNextTurnFrame"
android:background="@drawable/bg_nav_next_next_turn"
android:elevation="@dimen/nav_elevation"
android:visibility="gone"
tools:visibility="visible">

View file

@ -5,14 +5,15 @@
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:gravity="center">
android:gravity="center"
android:theme="@style/MwmTheme.Splash">
<ImageView
android:id="@+id/iv__logo"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:contentDescription="@null"
app:srcCompat="@drawable/splash"
app:srcCompat="@drawable/ic_splash"
android:layout_weight="1000"
android:layout_margin="@dimen/margin_double"/>

View file

@ -11,7 +11,7 @@
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?elevationProfileYourLocationPinBg"
android:background="@drawable/bg_your_location_pin"
android:ellipsize="end"
android:paddingStart="@dimen/margin_quarter"
android:paddingEnd="@dimen/margin_quarter"

View file

@ -23,7 +23,7 @@
android:layout_marginStart="@dimen/margin_half"
android:layout_marginTop="@dimen/margin_quarter"
android:layout_marginEnd="@dimen/margin_base_plus"
android:background="?altitudeBg"
android:background="@drawable/bg_altitude"
android:paddingStart="@dimen/margin_quarter_plus"
android:paddingTop="@dimen/margin_eighth"
android:paddingEnd="@dimen/margin_quarter_plus"
@ -39,7 +39,7 @@
android:layout_marginStart="@dimen/margin_half"
android:layout_marginEnd="@dimen/margin_base_plus"
android:layout_marginBottom="@dimen/margin_base_plus"
android:background="?altitudeBg"
android:background="@drawable/bg_altitude"
android:paddingStart="@dimen/margin_quarter_plus"
android:paddingTop="@dimen/margin_eighth"
android:paddingEnd="@dimen/margin_quarter_plus"

View file

@ -43,7 +43,7 @@
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/margin_quarter"
android:layout_weight="1"
android:background="?elevationProfilePropertyBg"
android:background="@drawable/bg_rounded_rect"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="@dimen/margin_quarter_plus">
@ -73,7 +73,7 @@
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/margin_quarter"
android:layout_weight="1"
android:background="?elevationProfilePropertyBg"
android:background="@drawable/bg_rounded_rect"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="@dimen/margin_quarter_plus">
@ -103,7 +103,7 @@
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/margin_quarter"
android:layout_weight="1"
android:background="?elevationProfilePropertyBg"
android:background="@drawable/bg_rounded_rect"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="@dimen/margin_quarter_plus">
@ -132,7 +132,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?elevationProfilePropertyBg"
android:background="@drawable/bg_rounded_rect"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="@dimen/margin_quarter_plus">

View file

@ -38,7 +38,7 @@
android:layout_marginTop="@dimen/margin_half"
android:layout_marginBottom="@dimen/margin_half"
android:layout_toEndOf="@id/floating_triangle"
android:background="?elevationProfileSelectedPointBg"
android:background="@drawable/bg_point_desc"
android:elevation="@dimen/margin_eighth"
android:maxWidth="@dimen/dialog_min_height"
android:padding="@dimen/margin_quarter_plus"

View file

@ -48,7 +48,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_half"
android:orientation="vertical"
android:background="?navNextTurnFrame"
android:background="@drawable/bg_nav_next_turn"
android:elevation="@dimen/nav_elevation">
<FrameLayout
android:layout_width="wrap_content"
@ -92,7 +92,7 @@
android:layout_below="@id/nav_next_turn_frame"
android:layout_alignStart="@id/nav_next_turn_frame"
android:layout_alignEnd="@id/nav_next_turn_frame"
android:background="?navNextNextTurnFrame"
android:background="@drawable/bg_nav_next_next_turn"
android:elevation="@dimen/nav_elevation"
android:visibility="invisible"
tools:visibility="visible">

View file

@ -6,4 +6,5 @@
style="@style/MwmWidget.MapButton.Square"
android:contentDescription="@string/help"
app:shapeAppearanceOverlay="@style/MwmWidget.MapButton.Square"
app:srcCompat="@drawable/ic_question_mark" />
app:srcCompat="@drawable/logo"
android:tint="?helpIconTint"/>

View file

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="MwmTheme.Base" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge">
<item name="materialCalendarStyle">@style/Widget.MaterialComponents.MaterialCalendar</item>
<item name="materialCalendarFullscreenTheme">@style/MwmWidget.MaterialCalendar.Theme.FullScreen.Dark</item>
<item name="materialCalendarTheme">@style/MwmWidget.MaterialCalendar.Theme.Dark</item>
<item name="android:listViewStyle">@style/MwmWidget.ListView</item>
<item name="android:textViewStyle">@style/MwmWidget.TextView</item>
<item name="android:forceDarkAllowed" tools:targetApi="Q">false</item>
<item name="android:textColorPrimary">@color/text_light</item>
<item name="android:textColorPrimaryInverse">@color/text_dark</item>
<item name="android:textColorSecondary">@color/text_light_subtitle</item>
<item name="android:windowBackground">?windowBackgroundForced</item>
<item name="android:colorPrimaryDark">@color/bg_primary_dark_night</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:fontFamily">@string/robotoRegular</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="clickableBackground">?selectableItemBackground</item>
<item name="android:statusBarColor">?colorPrimary</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:enforceNavigationBarContrast" tools:targetApi="Q">false</item>
<item name="android:enforceStatusBarContrast" tools:targetApi="Q">false</item>
<item name="alertDialogTheme">@style/MwmTheme.AlertDialog</item>
<item name="windowBackgroundForced">@color/bg_window_night</item>
<item name="cardBackground">@color/bg_cards_night</item>
<item name="titleDialogTheme">@color/white_primary</item>
<item name="textDialogTheme">@color/white_secondary</item>
<item name="fullscreenDialogTheme">@style/MwmTheme.DialogFragment.Fullscreen</item>
<item name="colorPrimary">@color/bg_primary_night</item>
<item name="colorControlNormal">?secondary</item>
<item name="colorAccent">@color/base_accent_night</item>
<item name="colorAccentTransparent">@color/base_accent_transparent</item>
<item name="colorBtnHighlight">@color/white_24</item>
<item name="panel">@color/bg_panel_night</item>
<item name="colorLogo">@color/white_primary</item>
<item name="iconTint">@color/white_secondary</item>
<item name="iconTintDisabled">@color/white_12</item>
<item name="iconTintActive">@color/yellow</item>
<item name="iconTintLight">@color/icon_tint_light_night</item>
<item name="helpIconTint">@color/white_secondary</item>
<item name="secondary">@color/text_light_hint</item>
<item name="dividerHorizontal">@color/divider_night</item>
<item name="ppBackground">@color/bg_cards_night</item>
<item name="ppButtonsBackground">@color/bg_window_night</item>
<item name="navLanesBackgroundColor">@color/base_accent_night</item>
<item name="navLaneArrowActiveColor">@color/nav_lane_arrow_active_night</item>
<item name="navLaneArrowInactiveColor">@color/nav_lane_arrow_inactive_night</item>
<item name="buttonTextColor">@color/button_text_night</item>
<item name="buttonTextColorDisabled">@color/button_text_disabled_night</item>
<item name="buttonDialogTextColor">@color/base_accent_night</item>
<item name="accentButtonTextColor">@color/button_accent_text_night</item>
<!-- TODO: remove accentButtonTextColorDisabled attribute and use everywhere
accentButtonTextColor selector -->
<item name="accentButtonTextColorDisabled">@color/button_accent_text_disabled_night</item>
<item name="redButtonBackground">@drawable/button_red</item>
<item name="redButtonTextColor">@color/button_red_text</item>
<item name="redButtonTextColorDisabled">@color/button_red_text_disabled</item>
<item name="primaryButtonBackground">@drawable/button_accent</item>
<item name="menuBackground">@color/bg_menu_night</item>
<item name="wheelPendingAnimation">@drawable/anim_spinner_pending</item>
<item name="navButtonsThemeRect">@style/MwmTheme.NavButtonsRect</item>
<item name="navButtonsThemeRound">@style/MwmTheme.NavButtonsRound</item>
<item name="downloaderTheme">@style/MwmTheme.Downloader</item>
<item name="navigationTheme">@style/MwmTheme.Navigation</item>
<item name="routingButtonHint">@color/routing_button_tint</item>
<item name="routingToolbarButtonIconActive">@color/routing_button_activated_tint_night</item>
<item name="routingToolbarButtonActive">@color/routing_button_tint</item>
<item name="routingToolbarButton">@color/bg_primary_dark_night</item>
<item name="transitPedestrianBackground">@color/white_4</item>
<item name="transitRulerBackground">@color/white_4</item>
<item name="accentColorSelector">@color/accent_color_selector_night</item>
<item name="android:textAppearance">@style/TextAppearance</item>
<item name="android:textAppearanceSmall">@style/TextAppearance.Small</item>
<item name="android:textAppearanceMedium">@style/TextAppearance.Medium</item>
<item name="android:textAppearanceLarge">@style/TextAppearance.Large</item>
<item name="fontHeadline1">@style/TextAppearance.MdcTypographyStyles.Headline1</item>
<item name="fontHeadline2">@style/TextAppearance.MdcTypographyStyles.Headline2</item>
<item name="fontHeadline3">@style/TextAppearance.MdcTypographyStyles.Headline3</item>
<item name="fontHeadline4">@style/TextAppearance.MdcTypographyStyles.Headline4</item>
<item name="fontHeadline5">@style/TextAppearance.MaterialComponents.Headline5</item>
<item name="fontHeadline6">@style/TextAppearance.MdcTypographyStyles.Headline6</item>
<item name="fontSubtitle1">@style/TextAppearance.MdcTypographyStyles.Subtitle1</item>
<item name="fontSubtitle2">@style/TextAppearance.MdcTypographyStyles.Subtitle2</item>
<item name="fontBody1">@style/TextAppearance.MdcTypographyStyles.Body1</item>
<item name="fontBody2">@style/TextAppearance.MdcTypographyStyles.Body2</item>
<item name="fontButton">@style/TextAppearance.MdcTypographyStyles.Button</item>
<item name="fontCaption">@style/TextAppearance.MdcTypographyStyles.Caption</item>
<item name="fontOverline">@style/TextAppearance.MdcTypographyStyles.Overline</item>
<item name="drivingOptionsViewBg">@color/driving_options_bg_black</item>
<item name="elevationProfilePropIconTint">@color/white_secondary</item>
<item name="elevationProfileAxisLabelColor">@color/white_54</item>
<item name="elevationProfileSelectedPointTriangle">@drawable/ic_triangle_night</item>
<item name="elevationProfileFloatingTriangle">@drawable/ic_triangle_elevation_night</item>
<item name="elevationProfileColor">@color/elevation_profile_dark</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Dark</item>
<item name="outdoorsMenuEnabled">@drawable/ic_layers_outdoors_active</item>
<item name="trafficMenuEnabled">@drawable/ic_layers_traffic_active</item>
<item name="subwayMenuEnabled">@drawable/ic_layers_subway_active</item>
<item name="isoLinesMenuEnabled">@drawable/ic_layers_isoline_active</item>
<item name="outdoorsMenuDisabled">@drawable/ic_layers_outdoors_inactive</item>
<item name="trafficMenuDisabled">@drawable/ic_layers_traffic_inactive</item>
<item name="subwayMenuDisabled">@drawable/ic_layers_subway_inactive</item>
<item name="isoLinesMenuDisabled">@drawable/ic_layers_isoline_inactive</item>
<item name="bottomSheetStyle">@style/MwmWidget.BottomSheet</item>
<item name="bottomSheetDialogTheme">@style/MwmTheme.BottomSheetDialog</item>
</style>
</resources>

View file

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MwmTheme" parent="MwmTheme.Base"/>
<style name="MwmTheme.Splash">
<item name="android:background">@color/bg_primary_night</item>
<item name="android:textColorPrimary">@color/white_primary</item>
<item name="android:navigationBarColor">@color/bg_primary_night</item>
<item name="android:statusBarColor">@color/bg_primary_night</item>
</style>
<style name="MwmTheme.CardBg">
<item name="android:windowBackground">@color/bg_cards_night</item>
</style>
<style name="MwmTheme.WindowBg">
<item name="android:windowBackground">@color/bg_window_night</item>
</style>
<style name="MwmTheme.AlertDialog" parent="Theme.MaterialComponents.Dialog.Alert">
<item name="colorAccent">?buttonDialogTextColor</item>
<item name="colorPrimary">?buttonDialogTextColor</item>
<item name="android:background">?cardBackground</item>
<!-- Used for the message in the dialog -->
<item name="android:textColorPrimary">?textDialogTheme</item>
<item name="android:textSize">@dimen/text_size_body_1</item>
<!-- Used for the title in the dialog -->
<item name="android:windowTitleStyle">@style/MwmTheme.DialogTitleStyle</item>
</style>
<style name="MwmTheme.DialogTitleStyle" parent="MwmTheme.DialogTitleBase">
<item name="android:textColor">?titleDialogTheme</item>
</style>
<style name="MwmTheme.NavButtonsRound" parent="MwmTheme">
<item name="searchLayoutBackground">@drawable/bg_search_wheel_background_round</item>
</style>
<style name="MwmTheme.NavButtonsRect" parent="MwmTheme">
<item name="searchLayoutBackground">@drawable/bg_search_wheel_background_rect</item>
</style>
<style name="MwmTheme.Navigation" parent="MwmTheme">
<item name="iconTint">@color/black_primary</item>
</style>
<style name="MwmTheme.DialogFragment.Fullscreen" parent="Theme.AppCompat">
<item name="colorPrimary">@color/bg_primary_night</item>
<item name="android:colorPrimaryDark">?statusBar</item>
<item name="colorAccent">@color/base_accent_night</item>
<item name="clickableBackground">?selectableItemBackground</item>
<item name="colorControlNormal">@color/text_dark_hint</item>
<item name="android:windowIsFloating">false</item>
<item name="android:textColorHint">@color/text_light_hint</item>
<item name="android:textViewStyle">@style/MwmWidget.TextView</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:fontFamily">@string/robotoRegular</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="MwmTheme.DialogFragment.NoFullscreen" parent="MwmTheme.DialogFragment.Fullscreen">
<item name="android:windowTranslucentStatus">false</item>
<item name="android:statusBarColor">@color/bg_dialog_translucent</item>
</style>
<style name="MwmMain.DialogFragment.TimePicker" parent="Theme.MaterialComponents.Dialog.Alert">
<item name="colorAccent">@color/base_accent_night</item>
<item name="colorPrimary">?buttonDialogTextColor</item>
<item name="android:fontFamily">@string/robotoMedium</item>
<item name="android:windowBackground">@color/bg_cards_night</item>
<item name="android:background">@color/bg_cards_night</item>
</style>
<style name="MwmTheme.Downloader">
<item name="status_done">@drawable/ic_downloader_done_night</item>
<item name="status_downloadable">@drawable/ic_downloader_download_night</item>
<item name="status_folder">@drawable/ic_downloader_folder_night</item>
<item name="status_folder_done">@drawable/ic_downloader_folder_done_night</item>
</style>
</resources>

View file

@ -8,11 +8,4 @@
<!-- Allows to show the app behind the camera notch in landscape and when hiding the status bar -->
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
<style name="MwmTheme.Night.MainActivity">
<item name="android:colorPrimaryDark">@android:color/black</item>
<item name="android:windowBackground">@null</item>
<item name="android:windowTranslucentNavigation">false</item>
<!-- Allows to show the app behind the camera notch in landscape and when hiding the status bar -->
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
</resources>

View file

@ -53,6 +53,7 @@
<string name="theme_night" translatable="false">night</string>
<string name="theme_auto" translatable="false">auto</string>
<string name="theme_nav_auto" translatable="false">nav-auto</string>
<string name="theme_follow_system" translatable="false">follow-system</string>
<!-- Tags -->
<string name="tag_menu_collapse" translatable="false">collapse</string>

View file

@ -24,19 +24,20 @@
<item>1</item>
</string-array>
<string-array name="map_style">
<item>@string/off</item>
<item>@string/on</item>
<item>@string/auto</item>
<string-array name="appearance">
<item>@string/follow_system</item>
<item>@string/nav_auto</item>
<item>@string/auto</item>
<item>@string/light</item>
<item>@string/dark</item>
</string-array>
<string-array name="map_style_values"
translatable="false">
<string-array name="appearance_values" translatable="false">
<item>@string/theme_follow_system</item>
<item>@string/theme_nav_auto</item>
<item>@string/theme_auto</item>
<item>@string/theme_default</item>
<item>@string/theme_night</item>
<item>@string/theme_auto</item>
<item>@string/theme_nav_auto</item>
</string-array>
<string-array name="speed_cameras">

View file

@ -235,6 +235,14 @@
<string name="pref_zoom_summary">Display on the map</string>
<!-- Settings «Map» category: «Night style» title -->
<string name="pref_map_style_title">Night Mode</string>
<!-- Settings «Map» category: «Appearance» title -->
<string name="pref_appearance_title">Appearance</string>
<!-- Generic «Light» string (eg. light theme, not lamps) -->
<string name="light">Light</string>
<!-- Generic «Dark» string -->
<string name="dark">Dark</string>
<!-- Appearance setting, OM should follow the system theme -->
<string name="follow_system">Follow System</string>
<!-- Generic «Off» string -->
<string name="off">Off</string>
<!-- Generic «On» string -->

View file

@ -49,7 +49,7 @@
<style name="MwmWidget.Button">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:background">?buttonBackground</item>
<item name="android:background">@drawable/button</item>
<item name="android:stateListAnimator">@null</item>
<item name="android:fontFamily">@string/robotoMedium</item>
<item name="android:textAllCaps">true</item>
@ -57,7 +57,7 @@
</style>
<style name="MwmWidget.Button.Accent">
<item name="android:background">?accentButtonBackground</item>
<item name="android:background">@drawable/button_accent</item>
<item name="android:textColor">?accentButtonTextColor</item>
</style>

View file

@ -5,7 +5,7 @@
<attr name="titleDialogTheme" format="reference" />
<attr name="textDialogTheme" format="reference" />
<attr name="windowBackgroundForced" format="reference|color" />
<attr name="cardBackground" format="reference" />
<attr name="cardBackground" format="color" />
<attr name="clickableBackground" format="reference" />
<attr name="statusBar" format="color" />
<attr name="secondary" format="color" />
@ -15,18 +15,15 @@
<attr name="iconTintDisabled" format="color" />
<attr name="iconTintActive" format="color" />
<attr name="iconTintLight" format="color" />
<attr name="helpIconTint" format="color" />
<attr name="ppBackground" format="color" />
<attr name="ppButtonsBackground" format="color" />
<attr name="navNextTurnFrame" format="reference" />
<attr name="navNextNextTurnFrame" format="reference" />
<attr name="navLanesBackgroundColor" format="reference" />
<attr name="navLaneArrowActiveColor" format="reference" />
<attr name="navLaneArrowInactiveColor" format="reference" />
<attr name="buttonBackground" format="reference" />
<attr name="buttonTextColor" format="color" />
<attr name="buttonTextColorDisabled" format="color" />
<attr name="buttonDialogTextColor" format="color" />
<attr name="accentButtonBackground" format="reference" />
<attr name="accentButtonTextColor" format="color" />
<attr name="accentButtonTextColorDisabled" format="color" />
<attr name="redButtonBackground" format="reference" />
@ -34,19 +31,19 @@
<attr name="redButtonTextColorDisabled" format="color" />
<attr name="primaryButtonBackground" format="reference" />
<attr name="menuBackground" format="color" />
<attr name="myPositionButtonAnimation" format="reference" />
<attr name="wheelPendingAnimation" format="reference" />
<attr name="trafficLoadingAnimation" format="reference" />
<attr name="navButtonsThemeRect" format="reference" />
<attr name="navButtonsThemeRound" format="reference" />
<attr name="downloaderTheme" format="reference" />
<attr name="navigationTheme" format="reference" />
<attr name="routingButtonHint" format="color" />
<attr name="routingToolbarButtonIconActive" format="color" />
<attr name="routingToolbarButtonActive" format="color" />
<attr name="routingToolbarButton" format="color" />
<attr name="drivingOptionsViewBg" format="color" />
<attr name="transitPedestrianBackground" format="color" />
<attr name="transitRulerBackground" format="color" />
<attr name="colorBtnHighlight" format="color" />
<attr name="transitStepDivider" format="reference" />
<attr name="colorAccentTransparent" format="reference" />
</declare-styleable>
<declare-styleable name="ThemeAttrs.Downloader">
@ -62,12 +59,8 @@
</declare-styleable>
<declare-styleable name="ThemeAttrs.ElevationProfile">
<attr name="elevationProfileColor" format="color" />
<attr name="elevationProfilePropertyBg" format="reference" />
<attr name="elevationProfilePropIconTint" format="color" />
<attr name="altitudeBg" format="reference" />
<attr name="elevationProfileAxisLabelColor" format="color" />
<attr name="elevationProfileYourLocationPinBg" format="reference" />
<attr name="elevationProfileSelectedPointBg" format="reference" />
<attr name="elevationProfileSelectedPointTriangle" format="reference" />
<attr name="elevationProfileFloatingTriangle" format="reference" />
</declare-styleable>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Default theme -->
<style name="MwmTheme.Base" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">
<item name="materialCalendarStyle">@style/Widget.MaterialComponents.MaterialCalendar</item>
<item name="materialCalendarFullscreenTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar.Fullscreen</item>
@ -20,6 +19,10 @@
<item name="android:windowActionBarOverlay">true</item>
<item name="clickableBackground">?selectableItemBackground</item>
<item name="android:statusBarColor">?colorPrimary</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:enforceNavigationBarContrast" tools:targetApi="Q">false</item>
<item name="android:enforceStatusBarContrast" tools:targetApi="Q">false</item>
<item name="alertDialogTheme">@style/MwmTheme.AlertDialog</item>
<item name="windowBackgroundForced">@color/bg_window</item>
<item name="cardBackground">@color/bg_cards</item>
@ -37,6 +40,7 @@
<item name="iconTintDisabled">@color/black_12</item>
<item name="iconTintActive">@color/yellow</item>
<item name="iconTintLight">@color/icon_tint_light</item>
<item name="helpIconTint">@android:color/transparent</item>
<item name="secondary">@color/text_dark_hint</item>
<item name="dividerHorizontal">@color/divider</item>
@ -44,18 +48,14 @@
<item name="ppBackground">@color/bg_cards</item>
<item name="ppButtonsBackground">?panel</item>
<item name="navNextTurnFrame">@drawable/bg_nav_next_turn</item>
<item name="navNextNextTurnFrame">@drawable/bg_nav_next_next_turn</item>
<item name="navLanesBackgroundColor">@color/base_accent</item>
<item name="navLaneArrowActiveColor">@color/nav_lane_arrow_active_light</item>
<item name="navLaneArrowInactiveColor">@color/nav_lane_arrow_inactive_light</item>
<item name="buttonBackground">@drawable/button</item>
<item name="buttonTextColor">@color/button_text</item>
<item name="buttonTextColorDisabled">@color/button_text_disabled</item>
<item name="buttonDialogTextColor">@color/base_accent</item>
<item name="accentButtonBackground">@drawable/button_accent</item>
<item name="accentButtonTextColor">@color/button_text_accent</item>
<!-- TODO: remove accentButtonTextColorDisabled attribute and use everywhere
accentButtonTextColor selector -->
@ -69,9 +69,7 @@
<item name="menuBackground">@color/bg_menu</item>
<item name="myPositionButtonAnimation">@drawable/ic_menu_location_pending</item>
<item name="wheelPendingAnimation">@drawable/anim_spinner_pending</item>
<item name="trafficLoadingAnimation">@drawable/anim_traffic_loading</item>
<item name="navButtonsThemeRect">@style/MwmTheme.NavButtonsRect</item>
<item name="navButtonsThemeRound">@style/MwmTheme.NavButtonsRound</item>
@ -79,14 +77,14 @@
<item name="navigationTheme">@style/MwmTheme.Navigation</item>
<item name="routingButtonHint">@color/routing_button_tint</item>
<item name="routingToolbarButtonIconActive">@color/routing_button_activated_tint</item>
<item name="routingToolbarButtonActive">@color/routing_button_tint</item>
<item name="routingToolbarButton">@color/bg_primary_dark</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
<item name="android:listDivider">@drawable/list_divider</item>
<item name="transitPedestrianBackground">@color/black_4</item>
<item name="transitRulerBackground">@color/black_4</item>
<item name="transitStepDivider">@drawable/dot_divider</item>
<item name="outdoorsMenuEnabled">@drawable/ic_layers_outdoors_active</item>
<item name="trafficMenuEnabled">@drawable/ic_layers_traffic_active</item>
<item name="subwayMenuEnabled">@drawable/ic_layers_subway_active</item>
@ -118,12 +116,8 @@
<item name="fontCaption">@style/TextAppearance.MdcTypographyStyles.Caption</item>
<item name="fontOverline">@style/TextAppearance.MdcTypographyStyles.Overline</item>
<item name="drivingOptionsViewBg">@color/light_green</item>
<item name="elevationProfilePropertyBg">@drawable/bg_rounded_rect</item>
<item name="elevationProfilePropIconTint">@color/black_secondary</item>
<item name="altitudeBg">@drawable/bg_altitude</item>
<item name="elevationProfileAxisLabelColor">@color/black_54</item>
<item name="elevationProfileYourLocationPinBg">@drawable/bg_your_location_pin</item>
<item name="elevationProfileSelectedPointBg">@drawable/bg_point_desc</item>
<item name="elevationProfileSelectedPointTriangle">@drawable/ic_triangle</item>
<item name="elevationProfileFloatingTriangle">@drawable/ic_triangle_elevation</item>
<item name="elevationProfileColor">@color/elevation_profile</item>
@ -134,125 +128,4 @@
<!-- Theme used for bottom sheet dialog components -->
<item name="bottomSheetDialogTheme">@style/MwmTheme.BottomSheetDialog</item>
</style>
<!-- Night theme -->
<style name="MwmTheme.Night.Base" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge">
<item name="materialCalendarStyle">@style/Widget.MaterialComponents.MaterialCalendar</item>
<item name="materialCalendarFullscreenTheme">@style/MwmWidget.MaterialCalendar.Theme.FullScreen.Dark</item>
<item name="materialCalendarTheme">@style/MwmWidget.MaterialCalendar.Theme.Dark</item>
<item name="android:listViewStyle">@style/MwmWidget.ListView</item>
<item name="android:textViewStyle">@style/MwmWidget.TextView</item>
<item name="android:forceDarkAllowed" tools:targetApi="Q">false</item>
<item name="android:textColorPrimary">@color/text_light</item>
<item name="android:textColorPrimaryInverse">@color/text_dark</item>
<item name="android:textColorSecondary">@color/text_light_subtitle</item>
<item name="android:windowBackground">?windowBackgroundForced</item>
<item name="android:colorPrimaryDark">@color/bg_primary_dark_night</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:fontFamily">@string/robotoRegular</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="clickableBackground">?selectableItemBackground</item>
<item name="android:statusBarColor">?colorPrimary</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="alertDialogTheme">@style/MwmTheme.Night.AlertDialog</item>
<item name="windowBackgroundForced">@color/bg_window_night</item>
<item name="cardBackground">@color/bg_cards_night</item>
<item name="titleDialogTheme">@color/white_primary</item>
<item name="textDialogTheme">@color/white_secondary</item>
<item name="fullscreenDialogTheme">@style/MwmTheme.DialogFragment.Fullscreen.Night</item>
<item name="colorPrimary">@color/bg_primary_night</item>
<item name="colorControlNormal">?secondary</item>
<item name="colorAccent">@color/base_accent_night</item>
<item name="colorAccentTransparent">@color/base_accent_transparent</item>
<item name="colorBtnHighlight">@color/white_24</item>
<item name="panel">@color/bg_panel_night</item>
<item name="colorLogo">@color/white_primary</item>
<item name="iconTint">@color/white_secondary</item>
<item name="iconTintDisabled">@color/white_12</item>
<item name="iconTintActive">@color/yellow</item>
<item name="iconTintLight">@color/icon_tint_light_night</item>
<item name="secondary">@color/text_light_hint</item>
<item name="dividerHorizontal">@color/divider_night</item>
<item name="ppBackground">@color/bg_cards_night</item>
<item name="ppButtonsBackground">@color/bg_window_night</item>
<item name="navNextTurnFrame">@drawable/bg_nav_next_turn_night</item>
<item name="navNextNextTurnFrame">@drawable/bg_nav_next_next_turn_night</item>
<item name="navLanesBackgroundColor">@color/base_accent_night</item>
<item name="navLaneArrowActiveColor">@color/nav_lane_arrow_active_night</item>
<item name="navLaneArrowInactiveColor">@color/nav_lane_arrow_inactive_night</item>
<item name="buttonBackground">@drawable/button_night</item>
<item name="buttonTextColor">@color/button_text_night</item>
<item name="buttonTextColorDisabled">@color/button_text_disabled_night</item>
<item name="buttonDialogTextColor">@color/base_accent_night</item>
<item name="accentButtonBackground">@drawable/button_accent_night</item>
<item name="accentButtonTextColor">@color/button_accent_text_night</item>
<!-- TODO: remove accentButtonTextColorDisabled attribute and use everywhere
accentButtonTextColor selector -->
<item name="accentButtonTextColorDisabled">@color/button_accent_text_disabled_night</item>
<item name="redButtonBackground">@drawable/button_red</item>
<item name="redButtonTextColor">@color/button_red_text</item>
<item name="redButtonTextColorDisabled">@color/button_red_text_disabled</item>
<item name="primaryButtonBackground">@drawable/button_accent</item>
<item name="menuBackground">@color/bg_menu_night</item>
<item name="myPositionButtonAnimation">@drawable/ic_menu_location_pending_night</item>
<item name="wheelPendingAnimation">@drawable/anim_spinner_pending</item>
<item name="trafficLoadingAnimation">@drawable/anim_traffic_loading_night</item>
<item name="navButtonsThemeRect">@style/MwmTheme.NavButtonsRect.Night</item>
<item name="navButtonsThemeRound">@style/MwmTheme.NavButtonsRound.Night</item>
<item name="downloaderTheme">@style/MwmTheme.Downloader.Night</item>
<item name="navigationTheme">@style/MwmTheme.Navigation.Night</item>
<item name="routingButtonHint">@color/routing_button_tint</item>
<item name="android:listDivider">@drawable/list_divider_night</item>
<item name="transitPedestrianBackground">@color/white_4</item>
<item name="transitRulerBackground">@color/white_4</item>
<item name="transitStepDivider">@drawable/dot_divider_night</item>
<item name="accentColorSelector">@color/accent_color_selector_night</item>
<item name="android:textAppearance">@style/TextAppearance</item>
<item name="android:textAppearanceSmall">@style/TextAppearance.Small</item>
<item name="android:textAppearanceMedium">@style/TextAppearance.Medium</item>
<item name="android:textAppearanceLarge">@style/TextAppearance.Large</item>
<item name="fontHeadline1">@style/TextAppearance.MdcTypographyStyles.Headline1</item>
<item name="fontHeadline2">@style/TextAppearance.MdcTypographyStyles.Headline2</item>
<item name="fontHeadline3">@style/TextAppearance.MdcTypographyStyles.Headline3</item>
<item name="fontHeadline4">@style/TextAppearance.MdcTypographyStyles.Headline4</item>
<item name="fontHeadline5">@style/TextAppearance.MaterialComponents.Headline5</item>
<item name="fontHeadline6">@style/TextAppearance.MdcTypographyStyles.Headline6</item>
<item name="fontSubtitle1">@style/TextAppearance.MdcTypographyStyles.Subtitle1</item>
<item name="fontSubtitle2">@style/TextAppearance.MdcTypographyStyles.Subtitle2</item>
<item name="fontBody1">@style/TextAppearance.MdcTypographyStyles.Body1</item>
<item name="fontBody2">@style/TextAppearance.MdcTypographyStyles.Body2</item>
<item name="fontButton">@style/TextAppearance.MdcTypographyStyles.Button</item>
<item name="fontCaption">@style/TextAppearance.MdcTypographyStyles.Caption</item>
<item name="fontOverline">@style/TextAppearance.MdcTypographyStyles.Overline</item>
<item name="drivingOptionsViewBg">@color/driving_options_bg_black</item>
<item name="elevationProfilePropertyBg">@drawable/bg_rounded_rect_night</item>
<item name="elevationProfilePropIconTint">@color/white_secondary</item>
<item name="altitudeBg">@drawable/bg_altitude_night</item>
<item name="elevationProfileAxisLabelColor">@color/white_54</item>
<item name="elevationProfileYourLocationPinBg">@drawable/bg_your_location_pin_night</item>
<item name="elevationProfileSelectedPointBg">@drawable/bg_point_desc_night</item>
<item name="elevationProfileSelectedPointTriangle">@drawable/ic_triangle_night</item>
<item name="elevationProfileFloatingTriangle">@drawable/ic_triangle_elevation_night</item>
<item name="elevationProfileColor">@color/elevation_profile_dark</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Dark</item>
<item name="bottomSheetStyle">@style/MwmWidget.BottomSheet</item>
<item name="bottomSheetDialogTheme">@style/MwmTheme.BottomSheetDialog</item>
</style>
</resources>

View file

@ -1,22 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MwmTheme" parent="MwmTheme.Base"/>
<style name="MwmTheme.Night" parent="MwmTheme.Night.Base"/>
<style name="MwmTheme.Splash">
<item name="android:windowBackground">@color/bg_primary</item>
<item name="android:background">@color/bg_primary</item>
<item name="android:textColorPrimary">@color/white_primary</item>
<item name="android:navigationBarColor">@color/bg_primary</item>
<item name="android:statusBarColor">@color/bg_primary</item>
</style>
<style name="MwmTheme.Night.Splash">
<item name="android:windowBackground">@color/bg_primary_night</item>
<item name="android:textColorPrimary">@color/white_primary</item>
<item name="android:navigationBarColor">@color/bg_primary_night</item>
<item name="android:statusBarColor">@color/bg_primary_night</item>
</style>
<!-- Theme is overridden in v27 folder to handle cutouts -->
<style name="MwmTheme.MainActivity">
<item name="android:colorPrimaryDark">@android:color/black</item>
@ -24,41 +16,26 @@
<item name="android:windowTranslucentNavigation">false</item>
</style>
<!-- Theme is overridden in v27 folder to handle cutouts -->
<style name="MwmTheme.Night.MainActivity">
<item name="android:colorPrimaryDark">@android:color/black</item>
<item name="android:windowBackground">@null</item>
<item name="android:windowTranslucentNavigation">false</item>
</style>
<style name="MwmTheme.DownloadResourcesLegacy">
<item name="android:statusBarColor">@android:color/white</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
</style>
<style name="MwmTheme.CardBg">
<item name="android:windowBackground">@color/bg_cards</item>
</style>
<style name="MwmTheme.Night.CardBg">
<item name="android:windowBackground">@color/bg_cards_night</item>
<item name="android:windowBackground">?cardBackground</item>
</style>
<style name="MwmTheme.WindowBg">
<item name="android:windowBackground">@color/bg_window</item>
</style>
<style name="MwmTheme.Night.WindowBg">
<item name="android:windowBackground">@color/bg_window_night</item>
</style>
<style name="MwmTheme.AlertDialog" parent="Theme.MaterialComponents.Light.Dialog.Alert">
<item name="colorAccent">?buttonDialogTextColor</item>
<item name="colorPrimary">?buttonDialogTextColor</item>
<item name="android:background">?cardBackground</item>
<item name="android:textColorPrimary">?textDialogTheme</item>
<item name="android:textSize">@dimen/text_size_body_1</item>
<item name="android:windowTitleStyle">@style/MwmTheme.DialogTitleStyle.Light</item>
<item name="android:windowTitleStyle">@style/MwmTheme.DialogTitleStyle</item>
</style>
<style name="MwmTheme.DialogTitleBase">
@ -66,22 +43,7 @@
<item name="android:fontFamily">@string/robotoMedium</item>
</style>
<style name="MwmTheme.DialogTitleStyle.Light" parent="MwmTheme.DialogTitleBase">
<item name="android:textColor">?titleDialogTheme</item>
</style>
<style name="MwmTheme.Night.AlertDialog" parent="Theme.MaterialComponents.Dialog.Alert">
<item name="colorAccent">?buttonDialogTextColor</item>
<item name="colorPrimary">?buttonDialogTextColor</item>
<item name="android:background">?cardBackground</item>
<!-- Used for the message in the dialog -->
<item name="android:textColorPrimary">?textDialogTheme</item>
<item name="android:textSize">@dimen/text_size_body_1</item>
<!-- Used for the title in the dialog -->
<item name="android:windowTitleStyle">@style/MwmTheme.DialogTitleStyle.Night</item>
</style>
<style name="MwmTheme.DialogTitleStyle.Night" parent="MwmTheme.DialogTitleBase">
<style name="MwmTheme.DialogTitleStyle" parent="MwmTheme.DialogTitleBase">
<item name="android:textColor">?titleDialogTheme</item>
</style>
@ -110,26 +72,6 @@
<item name="android:statusBarColor">@color/bg_dialog_translucent</item>
</style>
<style name="MwmTheme.DialogFragment.Fullscreen.Night" parent="Theme.AppCompat">
<item name="colorPrimary">@color/bg_primary_night</item>
<item name="android:colorPrimaryDark">?statusBar</item>
<item name="colorAccent">@color/base_accent_night</item>
<item name="clickableBackground">?selectableItemBackground</item>
<item name="colorControlNormal">@color/text_dark_hint</item>
<item name="android:windowIsFloating">false</item>
<item name="android:textColorHint">@color/text_light_hint</item>
<item name="android:textViewStyle">@style/MwmWidget.TextView</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:fontFamily">@string/robotoRegular</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="MwmTheme.DialogFragment.NoFullscreen.Night" parent="MwmTheme.DialogFragment.Fullscreen.Night">
<item name="android:windowTranslucentStatus">false</item>
<item name="android:statusBarColor">@color/bg_dialog_translucent</item>
</style>
<style name="MwmTheme.DialogFragment.Fullscreen.Translucent">
<item name="android:colorPrimaryDark">@android:color/black</item>
<item name="android:windowBackground">@color/bg_dialog_translucent</item>
@ -145,14 +87,6 @@
<item name="android:background">@color/bg_cards</item>
</style>
<style name="MwmMain.DialogFragment.TimePicker.Night" parent="Theme.MaterialComponents.Dialog.Alert">
<item name="colorAccent">@color/base_accent_night</item>
<item name="colorPrimary">?buttonDialogTextColor</item>
<item name="android:fontFamily">@string/robotoMedium</item>
<item name="android:windowBackground">@color/bg_cards_night</item>
<item name="android:background">@color/bg_cards_night</item>
</style>
<style name="MwmTheme.ProgressDialog" parent="MwmTheme.AlertDialog">
<item name="android:textColor">?textDialogTheme</item>
</style>
@ -166,37 +100,18 @@
<item name="status_folder_done">@drawable/ic_downloader_folder_done</item>
</style>
<style name="MwmTheme.Downloader.Night">
<item name="status_done">@drawable/ic_downloader_done_night</item>
<item name="status_downloadable">@drawable/ic_downloader_download_night</item>
<item name="status_folder">@drawable/ic_downloader_folder_night</item>
<item name="status_folder_done">@drawable/ic_downloader_folder_done_night</item>
</style>
<style name="MwmTheme.NavButtonsRound">
<item name="searchLayoutBackground">@drawable/bg_search_wheel_background_round</item>
</style>
<style name="MwmTheme.NavButtonsRound.Night" parent="MwmTheme.Night">
<item name="searchLayoutBackground">@drawable/bg_search_wheel_background_round_night</item>
</style>
<style name="MwmTheme.NavButtonsRect">
<item name="searchLayoutBackground">@drawable/bg_search_wheel_background_rect</item>
</style>
<style name="MwmTheme.NavButtonsRect.Night" parent="MwmTheme.Night">
<item name="searchLayoutBackground">@drawable/bg_search_wheel_background_rect_night</item>
</style>
<style name="MwmTheme.Navigation">
<item name="iconTint">@color/white_primary</item>
</style>
<style name="MwmTheme.Navigation.Night" parent="MwmTheme.Night">
<item name="iconTint">@color/black_primary</item>
</style>
<style name="PopupMenu" parent="ThemeOverlay.AppCompat">
<item name="android:popupBackground">?windowBackgroundForced</item>
</style>

View file

@ -14,6 +14,13 @@
android:key="@string/pref_settings_general"
android:title="@string/prefs_group_general"
android:order="2">
<ListPreference
android:entries="@array/appearance"
android:entryValues="@array/appearance_values"
android:key="@string/pref_map_style"
android:title="@string/pref_appearance_title"
app:singleLineTitle="false"
android:order="1" />
<ListPreference
android:key="@string/pref_munits"
android:title="@string/measurement_units"
@ -21,23 +28,23 @@
android:summary="@string/measurement_units_summary"
android:entries="@array/measument_units"
android:entryValues="@array/measument_units_values"
android:order="1"/>
android:order="2"/>
<SwitchPreferenceCompat
android:key="@string/pref_show_zoom_buttons"
android:title="@string/pref_zoom_title"
app:singleLineTitle="false"
android:summary="@string/pref_zoom_summary"
android:order="2"/>
android:order="3"/>
<SwitchPreferenceCompat
android:key="@string/pref_3d_buildings"
android:title="@string/pref_map_3d_buildings_title"
app:singleLineTitle="false"
android:order="3"/>
android:order="4"/>
<SwitchPreferenceCompat
android:key="@string/pref_autodownload"
android:title="@string/autodownload"
app:singleLineTitle="false"
android:order="4"/>
android:order="5"/>
<SwitchPreferenceCompat
android:key="@string/pref_large_fonts_size"
android:title="@string/big_font"
@ -62,13 +69,13 @@
app:singleLineTitle="false"
android:summary="@string/enable_logging_warning_message"
android:defaultValue="false"
android:order="12"/>
android:order="9"/>
<SwitchPreferenceCompat
android:key="@string/pref_emulate_bad_external_storage"
android:title="@string/setting_emulate_bad_storage"
app:singleLineTitle="false"
android:defaultValue="false"
android:order="13"/>
android:order="10"/>
<ListPreference
android:key="@string/pref_use_mobile_data"
android:title="@string/mobile_data"
@ -76,7 +83,7 @@
android:summary="@string/mobile_data_description"
android:entries="@array/mobile_data_options"
android:entryValues="@array/mobile_data_options_values"
android:order="14"/>
android:order="11"/>
<ListPreference
android:key="@string/pref_power_management"
android:title="@string/power_managment_title"
@ -84,60 +91,53 @@
android:summary="@string/power_managment_description"
android:entries="@array/power_management_scheme"
android:entryValues="@array/power_management_scheme_values"
android:order="15"/>
android:order="12"/>
<SwitchPreferenceCompat
android:key="@string/pref_keep_screen_on"
android:title="@string/enable_keep_screen_on"
app:singleLineTitle="false"
android:summary="@string/enable_keep_screen_on_description"
android:defaultValue="false"
android:order="16"/>
android:order="13"/>
<SwitchPreferenceCompat
android:key="@string/pref_show_on_lock_screen"
android:title="@string/enable_show_on_lock_screen"
app:singleLineTitle="false"
android:summary="@string/enable_show_on_lock_screen_description"
android:defaultValue="true"
android:order="17"/>
android:order="14"/>
<Preference
android:key="@string/pref_map_locale"
android:title="@string/change_map_locale"
app:singleLineTitle="false"
android:persistent="false"
android:order="18"/>
android:key="@string/pref_map_locale"
android:title="@string/change_map_locale"
app:singleLineTitle="false"
android:persistent="false"
android:order="15"/>
</androidx.preference.PreferenceCategory>
<androidx.preference.PreferenceCategory
android:key="@string/pref_navigation"
android:title="@string/prefs_group_route"
android:order="3">
<ListPreference
android:key="@string/pref_map_style"
android:title="@string/pref_map_style_title"
app:singleLineTitle="false"
android:entries="@array/map_style"
android:entryValues="@array/map_style_values"
android:order="1"/>
<SwitchPreferenceCompat
android:key="@string/pref_3d"
android:title="@string/pref_map_3d_title"
app:singleLineTitle="false"
android:order="2"/>
android:order="1" />
<SwitchPreferenceCompat
android:key="@string/pref_auto_zoom"
android:title="@string/pref_map_auto_zoom"
app:singleLineTitle="false"
android:order="3"/>
android:order="2" />
<Preference
android:key="@string/pref_tts_screen"
android:title="@string/pref_tts_enable_title"
app:singleLineTitle="false"
android:persistent="false"
android:order="4">
android:order="3">
</Preference>
<PreferenceScreen
android:key="@string/prefs_routing"
android:order="5"
android:order="4"
android:title="@string/driving_options_title">
<intent
android:targetClass="app.organicmaps.settings.DrivingOptionsActivity"

View file

@ -5715,7 +5715,7 @@
[pref_appearance_title]
comment = Settings «Map» category: «Appearance» title
tags = ios
tags = android,ios
en = Appearance
ar = المظهر
az = Görünüş
@ -5759,9 +5759,9 @@
zh-Hans = 外观
zh-Hant = 外觀
[pref_appearance_light]
comment = Settings "Appearance" category: "Light" title, should be consistent with the pref_appearance_title translation.
tags = ios
[light]
comment = Generic «Light» string (eg. light theme, not lamps)
tags = android,ios
en = Light
ar = فاتح
az = Parlaq
@ -5805,9 +5805,9 @@
zh-Hans = 浅色
zh-Hant = 淺色
[pref_appearance_dark]
comment = Settings "Appearance" category: "Dark" title, should be consistent with the pref_appearance_title translation.
tags = ios
[dark]
comment = Generic «Dark» string
tags = android,ios
en = Dark
ar = داكن
az = Tünd
@ -5851,6 +5851,53 @@
zh-Hans = 深色
zh-Hant = 深色
[follow_system]
comment = Appearance setting, OM should follow the system theme
tags = android
en = Follow System
af = Volg Stelsel
ar = نظام المتابعة
az = Sistemi izləyin
be = Сачыце за сістэмай
bg = Следване на системата
ca = Seguiu el sistema
cs = Sledování systému
da = Følg systemet
de = System folgen
el = Ακολουθήστε το σύστημα
es = Sistema de seguimiento
et = Jälgi süsteemi
eu = Jarraitu Sistema
fa = سیستم را دنبال کنید
fi = Seuraa järjestelmää
fr = Suivre le système
he = עקוב אחר מערכת
hi = सिस्टम का पालन करें
hu = Rendszer követése
id = Ikuti Sistem
it = Seguire il sistema
ja = フォローシステム
ko = 팔로우 시스템
lt = Sekite sistemą
lv = Sekojiet sistēmai
mr = सिस्टम फॉलो करा
nb = Følg systemet
nl = Systeem volgen
pl = Proszę śledzić system
pt = Siga o sistema
pt-BR = Seguir o sistema
ro = Urmați sistemul
ru = Система следования
sk = Sledovanie systému
sv = Följ systemet
sw = Fuata Mfumo
th = ติดตามระบบ
tr = Sistemi Takip Edin
uk = Система стеження
vi = Theo dõi hệ thống
zh-Hans = 遵循系统
zh-Hant = 關注系統
[off]
comment = Generic «Off» string
tags = android,ios