Enable hiding toolbar for new installations

This commit is contained in:
M66B 2024-05-24 12:29:25 +02:00
parent b3bf0b7eb4
commit ecfc14f044
3 changed files with 5 additions and 2 deletions

View File

@ -105,7 +105,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
@Override @Override
public void setContentView(View view) { public void setContentView(View view) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean hide_toolbar = prefs.getBoolean("hide_toolbar", !BuildConfig.PLAY_STORE_RELEASE); boolean hide_toolbar = prefs.getBoolean("hide_toolbar", true);
boolean edge_to_edge = prefs.getBoolean("edge_to_edge", false); boolean edge_to_edge = prefs.getBoolean("edge_to_edge", false);
LayoutInflater inflater = LayoutInflater.from(this); LayoutInflater inflater = LayoutInflater.from(this);

View File

@ -864,6 +864,9 @@ public class ApplicationEx extends Application
} else if (version < 2180) { } else if (version < 2180) {
if (Helper.isAndroid15()) if (Helper.isAndroid15())
editor.putInt("last_sdk", 0); editor.putInt("last_sdk", 0);
} else if (version < 2187) {
if (!prefs.contains("hide_toolbar"))
editor.putBoolean("hide_toolbar", !BuildConfig.PLAY_STORE_RELEASE);
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG)

View File

@ -1563,7 +1563,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
tvColumnWidth.setText(getString(R.string.title_advanced_column_width, NF.format(column_width))); tvColumnWidth.setText(getString(R.string.title_advanced_column_width, NF.format(column_width)));
sbColumnWidth.setProgress(column_width); sbColumnWidth.setProgress(column_width);
swHideToolbar.setChecked(prefs.getBoolean("hide_toolbar", !BuildConfig.PLAY_STORE_RELEASE)); swHideToolbar.setChecked(prefs.getBoolean("hide_toolbar", true));
swEdgeToEdge.setChecked(prefs.getBoolean("edge_to_edge", false)); swEdgeToEdge.setChecked(prefs.getBoolean("edge_to_edge", false));
swNavOptions.setChecked(prefs.getBoolean("nav_options", true)); swNavOptions.setChecked(prefs.getBoolean("nav_options", true));
swNavCategories.setChecked(prefs.getBoolean("nav_categories", false)); swNavCategories.setChecked(prefs.getBoolean("nav_categories", false));