]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/activities/ImportExportActivity.java
Fix a crash when opening a drawer while restarting. https://redmine.stoutner.com...
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / activities / ImportExportActivity.java
index b9acb8c5b420bff373ee7f00dbf50bb46a34f3ad..7fe893275d8397d8a1a36d354cf8518a7d42d119 100644 (file)
@@ -117,8 +117,9 @@ public class ImportExportActivity extends AppCompatActivity {
         // Get a handle for the shared preferences.
         SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
 
-        // Get the screenshot preference.
-        boolean allowScreenshots = sharedPreferences.getBoolean("allow_screenshots", false);
+        // Get the preferences.
+        boolean allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false);
+        boolean bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false);
 
         // Disable screenshots if not allowed.
         if (!allowScreenshots) {
@@ -132,10 +133,16 @@ public class ImportExportActivity extends AppCompatActivity {
         super.onCreate(savedInstanceState);
 
         // Set the content view.
-        setContentView(R.layout.import_export_coordinatorlayout);
+        if (bottomAppBar) {
+            setContentView(R.layout.import_export_bottom_appbar);
+        } else {
+            setContentView(R.layout.import_export_top_appbar);
+        }
 
-        // Set the support action bar.
+        // Get a handle for the toolbar.
         Toolbar toolbar = findViewById(R.id.import_export_toolbar);
+
+        // Set the support action bar.
         setSupportActionBar(toolbar);
 
         // Get a handle for the action bar.