]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/activities/GuideActivity.java
Create a dark theme for `GuideActivity`.
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / activities / GuideActivity.java
index c0caeabcaccd49541a8669581ce6d2d67c6b8d61..a8728fe650746782102fdf4bea573686f7835b99 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2017 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2016-2017 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
  *
@@ -35,8 +35,22 @@ import com.stoutner.privacybrowser.R;
 public class GuideActivity extends AppCompatActivity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
+        // Set the theme.
+        if (MainWebViewActivity.darkTheme) {
+            setTheme(R.style.PrivacyBrowserDark_SecondaryActivity);
+        } else {
+            setTheme(R.style.PrivacyBrowserLight_SecondaryActivity);
+        }
+
+        // Run the default commands.
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.guide_coordinatorlayout);
+
+        // Set the content view according to the theme.
+        if (MainWebViewActivity.darkTheme) {
+            setContentView(R.layout.guide_coordinatorlayout_dark);
+        } else {
+            setContentView(R.layout.guide_coordinatorlayout_light);
+        }
 
         // We need to use `SupportActionBar` from `android.support.v7.app.ActionBar` until the minimum API is >= 21.
         Toolbar guideAppBar = (Toolbar) findViewById(R.id.guide_toolbar);
@@ -66,7 +80,7 @@ public class GuideActivity extends AppCompatActivity {
         @Override
         // Get the count of the number of tabs.
         public int getCount() {
-            return 8;
+            return 7;
         }
 
         @Override
@@ -86,16 +100,13 @@ public class GuideActivity extends AppCompatActivity {
                     return getString(R.string.user_agent);
 
                 case 4:
-                    return getString(R.string.tor);
+                    return getString(R.string.domain_settings);
 
                 case 5:
-                    return getString(R.string.tracking_ids);
+                    return getString(R.string.tor);
 
                 case 6:
-                    return getString(R.string.clear_and_exit);
-
-                case 7:
-                    return getString(R.string.planned_features);
+                    return getString(R.string.tracking_ids);
 
                 default:
                     return "";