forked from organicmaps/organicmaps
more change needed
This commit is contained in:
parent
0edbc5c421
commit
ebbe713f8f
6 changed files with 53 additions and 52 deletions
|
@ -450,12 +450,12 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
|
|||
.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
@StyleRes
|
||||
public int getThemeResourceId(@NonNull String theme)
|
||||
{
|
||||
return R.style.MwmTheme_DownloadResourcesLegacy;
|
||||
}
|
||||
// @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);
|
||||
|
|
|
@ -475,20 +475,20 @@ 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
|
||||
// @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)
|
||||
|
|
|
@ -42,19 +42,20 @@ 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);
|
||||
}
|
||||
// TODO: need to set theme with android system, not custom
|
||||
// @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.
|
||||
|
@ -68,7 +69,7 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
|
|||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
mThemeName = Config.getUiThemeSettings(getApplicationContext());
|
||||
setTheme(getThemeResourceId(mThemeName));
|
||||
//setTheme(getThemeResourceId(mThemeName));
|
||||
EdgeToEdge.enable(this, SystemBarStyle.dark(Color.TRANSPARENT));
|
||||
RtlUtils.manageRtl(this);
|
||||
if (!MwmApplication.from(this).arePlatformAndCoreInitialized())
|
||||
|
|
|
@ -40,12 +40,12 @@ public class BookmarkCategoriesActivity extends BaseToolbarActivity
|
|||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
@StyleRes
|
||||
public int getThemeResourceId(@NonNull String theme)
|
||||
{
|
||||
return ThemeUtils.getWindowBgThemeResourceId(getApplicationContext(), theme);
|
||||
}
|
||||
// @Override
|
||||
// @StyleRes
|
||||
// public int getThemeResourceId(@NonNull String theme)
|
||||
// {
|
||||
// return ThemeUtils.getWindowBgThemeResourceId(getApplicationContext(), theme);
|
||||
// }
|
||||
|
||||
@Override
|
||||
protected Class<? extends Fragment> getFragmentClass()
|
||||
|
|
|
@ -39,12 +39,12 @@ public class BookmarkListActivity extends BaseToolbarActivity
|
|||
super.onPause();
|
||||
}
|
||||
|
||||
@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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue