- // 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.
- appBar.setDisplayHomeAsUpEnabled(true);
-
- // Setup the ViewPager.
- ViewPager aboutViewPager = (ViewPager) 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);
- aboutTabLayout.setupWithViewPager(aboutViewPager);
- }
-
- private class aboutPagerAdapter extends FragmentPagerAdapter {
- private aboutPagerAdapter(FragmentManager fm) {
- super(fm);
+ // Disable screenshots if not allowed.
+ if (!allowScreenshots) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);