X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2FAboutActivity.java;h=6b462acda690882915e45c5df1556180d1a6d998;hb=8951c7351854bbfc9f2815e74b81cc2a4d606bf0;hp=2e019f599e646b445461e5bbe16bb43ef26b6b3f;hpb=e82e1211aa3063e2cb2dd716df160364abfaa073;p=PrivacyBrowserAndroid.git diff --git a/app/src/main/java/com/stoutner/privacybrowser/AboutActivity.java b/app/src/main/java/com/stoutner/privacybrowser/AboutActivity.java index 2e019f59..6b462acd 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/AboutActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/AboutActivity.java @@ -25,22 +25,33 @@ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; +import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; public class AboutActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.about_linearlayout); + 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); + setSupportActionBar(aboutAppBar); + + // 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); - assert aboutViewPager != null; // This assert removes the incorrect warning on the following line that aboutViewPager might be null. + assert aboutViewPager != null; // This assert removes the incorrect warning in Android Studio on the following line that aboutViewPager might be null. aboutViewPager.setAdapter(new aboutPagerAdapter(getSupportFragmentManager())); // Setup the TabLayout and connect it to the ViewPager. TabLayout aboutTabLayout = (TabLayout) findViewById(R.id.about_tablayout); - assert aboutTabLayout != null; // This assert removes the incorrect warning on the following line that aboutTabLayout might be null. + assert aboutTabLayout != null; // This assert removes the incorrect warning in Android Studio on the following line that aboutTabLayout might be null. aboutTabLayout.setupWithViewPager(aboutViewPager); } @@ -52,7 +63,7 @@ public class AboutActivity extends AppCompatActivity { @Override // Get the count of the number of tabs. public int getCount() { - return 6; + return 7; } @Override @@ -72,11 +83,14 @@ public class AboutActivity extends AppCompatActivity { return getString(R.string.changelog); case 4: - return getString(R.string.license); + return getString(R.string.licenses); case 5: return getString(R.string.contributors); + case 6: + return getString(R.string.links); + default: return ""; } @@ -88,6 +102,4 @@ public class AboutActivity extends AppCompatActivity { return AboutTabFragment.createTab(tab); } } - - }