]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/activities/SettingsActivity.java
Refactor Domains delete code. https://redmine.stoutner.com/issues/316
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / activities / SettingsActivity.java
index 075d5ece52f91a6df5699f2eec17ed11125ae733..2e87c400133a5e9f7c9cb095d2953b87c9519cb0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2016-2017 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2016-2018 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
  *
@@ -21,14 +21,28 @@ package com.stoutner.privacybrowser.activities;
 
 import android.os.Bundle;
 import android.preference.PreferenceFragment;
-import android.support.v4.app.NavUtils;
 import android.support.v7.app.AppCompatActivity;
+import android.view.WindowManager;
 
+import com.stoutner.privacybrowser.R;
 import com.stoutner.privacybrowser.fragments.SettingsFragment;
 
 public class SettingsActivity extends AppCompatActivity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
+        // Disable screenshots if not allowed.
+        if (!MainWebViewActivity.allowScreenshots) {
+            getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+        }
+
+        // Set the activity theme.
+        if (MainWebViewActivity.darkTheme) {
+            setTheme(R.style.PrivacyBrowserSettingsDark);
+        } else {
+            setTheme(R.style.PrivacyBrowserSettingsLight);
+        }
+
+        // Run the default commands.
         super.onCreate(savedInstanceState);
 
         // Display SettingsFragment.