X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Factivities%2FAboutActivity.java;h=ca71d59c6b3b9259cf386de5092a0f26ff9d7070;hb=70e33ff1c78812721732cd004efb9f8751215be7;hp=bc5c7fb66a433aae42881bf83c39569ae0d9a166;hpb=61a76e491469916f2f30aebb47b98cda7cceb557;p=PrivacyBrowserAndroid.git diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/AboutActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/AboutActivity.java index bc5c7fb6..ca71d59c 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/AboutActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/AboutActivity.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2017 Soren Stoutner . + * Copyright © 2016-2018 Soren Stoutner . * * This file is part of Privacy Browser . * @@ -28,6 +28,7 @@ import android.support.v4.view.ViewPager; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; +import android.view.WindowManager; import com.stoutner.privacybrowser.fragments.AboutTabFragment; import com.stoutner.privacybrowser.R; @@ -35,24 +36,39 @@ import com.stoutner.privacybrowser.R; public class AboutActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { + // Disable screenshots if not allowed. + if (!MainWebViewActivity.allowScreenshots) { + getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE); + } + + // Set the theme. + if (MainWebViewActivity.darkTheme) { + setTheme(R.style.PrivacyBrowserDark_SecondaryActivity); + } else { + setTheme(R.style.PrivacyBrowserLight_SecondaryActivity); + } + + // Run the default commands. super.onCreate(savedInstanceState); + + // Set the content view. setContentView(R.layout.about_coordinatorlayout); - // We need to use the SupportActionBar from android.support.v7.app.ActionBar until the minimum API is >= 21. - Toolbar aboutAppBar = (Toolbar) findViewById(R.id.about_toolbar); + // `SupportActionBar` from `android.support.v7.app.ActionBar` must be used until the minimum API is >= 21. + Toolbar aboutAppBar = findViewById(R.id.about_toolbar); setSupportActionBar(aboutAppBar); - // Display the home arrow on supportAppBar. + // Display the home arrow on `supportAppBar`. final ActionBar appBar = getSupportActionBar(); - assert appBar != null;// This assert removes the incorrect warning in Android Studio on the following line that appBar might be null. + assert appBar != null; // This assert removes the incorrect warning in Android Studio on the following line that appBar might be null. appBar.setDisplayHomeAsUpEnabled(true); // Setup the ViewPager. - ViewPager aboutViewPager = (ViewPager) findViewById(R.id.about_viewpager); + ViewPager aboutViewPager = findViewById(R.id.about_viewpager); aboutViewPager.setAdapter(new aboutPagerAdapter(getSupportFragmentManager())); // Setup the TabLayout and connect it to the ViewPager. - TabLayout aboutTabLayout = (TabLayout) findViewById(R.id.about_tablayout); + TabLayout aboutTabLayout = findViewById(R.id.about_tablayout); aboutTabLayout.setupWithViewPager(aboutViewPager); }