]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java
Add a requests activity. https://redmine.stoutner.com/issues/170
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / activities / BookmarksActivity.java
index 2f6738cd88a9064b02b6d9a405f411b90037d0bc..9f4231ab3f4ca810b42c85e00d66d23c4d927982 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>.
  *
@@ -43,6 +43,7 @@ import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.WindowManager;
 import android.widget.AbsListView;
 import android.widget.CursorAdapter;
 import android.widget.EditText;
@@ -103,6 +104,11 @@ public class BookmarksActivity extends AppCompatActivity implements CreateBookma
 
     @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.PrivacyBrowserDark_SecondaryActivity);
@@ -130,15 +136,15 @@ public class BookmarksActivity extends AppCompatActivity implements CreateBookma
         final Toolbar bookmarksAppBar = findViewById(R.id.bookmarks_toolbar);
         setSupportActionBar(bookmarksAppBar);
 
-        // Get a handle for the activity, the app bar, and the `ListView`.
+        // Get a handle for the activity, the app bar, and the ListView.
         final Activity bookmarksActivity = this;
         appBar = getSupportActionBar();
         bookmarksListView = findViewById(R.id.bookmarks_listview);
 
-        // This assert removes the incorrect warning in Android Studio on the following line that `appBar` might be null.
+        // Remove the incorrect lint warning that `appBar` might be null.
         assert appBar != null;
 
-        // Display the home arrow on `SupportActionBar`.
+        // Display the home arrow on the app bar.
         appBar.setDisplayHomeAsUpEnabled(true);
 
         // Initialize the database helper.  `this` specifies the context.  The two `nulls` do not specify the database name or a `CursorFactory`.