Renamed things pertaining to the about package
This commit is contained in:
parent
c7efa8c4f1
commit
cc72fa4793
6 changed files with 29 additions and 40 deletions
|
@ -85,16 +85,16 @@ public class AboutActivity extends AppCompatActivity {
|
||||||
final ActivityAboutBinding aboutBinding = ActivityAboutBinding.inflate(getLayoutInflater());
|
final ActivityAboutBinding aboutBinding = ActivityAboutBinding.inflate(getLayoutInflater());
|
||||||
setContentView(aboutBinding.getRoot());
|
setContentView(aboutBinding.getRoot());
|
||||||
|
|
||||||
setSupportActionBar(aboutBinding.toolbar);
|
setSupportActionBar(aboutBinding.aboutToolbar);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
// Create the adapter that will return a fragment for each of the three
|
// Create the adapter that will return a fragment for each of the three
|
||||||
// primary sections of the activity.
|
// primary sections of the activity.
|
||||||
final SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(this);
|
final AboutStateAdapter mAboutStateAdapter = new AboutStateAdapter(this);
|
||||||
|
|
||||||
// Set up the ViewPager with the sections adapter.
|
// Set up the ViewPager with the sections adapter.
|
||||||
aboutBinding.container.setAdapter(mSectionsPagerAdapter);
|
aboutBinding.aboutViewPager2.setAdapter(mAboutStateAdapter);
|
||||||
|
|
||||||
new TabLayoutMediator(aboutBinding.tabs, aboutBinding.container, (tab, position) -> {
|
new TabLayoutMediator(aboutBinding.aboutTabLayout, aboutBinding.aboutViewPager2, (tab, position) -> {
|
||||||
switch (position) {
|
switch (position) {
|
||||||
default:
|
default:
|
||||||
case POS_ABOUT:
|
case POS_ABOUT:
|
||||||
|
@ -143,18 +143,18 @@ public class AboutActivity extends AppCompatActivity {
|
||||||
FragmentAboutBinding.inflate(inflater, container, false);
|
FragmentAboutBinding.inflate(inflater, container, false);
|
||||||
final Context context = getContext();
|
final Context context = getContext();
|
||||||
|
|
||||||
aboutBinding.appVersion.setText(BuildConfig.VERSION_NAME);
|
aboutBinding.aboutAppVersion.setText(BuildConfig.VERSION_NAME);
|
||||||
|
|
||||||
aboutBinding.githubLink.setOnClickListener(nv ->
|
aboutBinding.aboutGithubLink.setOnClickListener(nv ->
|
||||||
openUrlInBrowser(context, context.getString(R.string.github_url), false));
|
openUrlInBrowser(context, context.getString(R.string.github_url), false));
|
||||||
|
|
||||||
aboutBinding.donationLink.setOnClickListener(v ->
|
aboutBinding.aboutDonationLink.setOnClickListener(v ->
|
||||||
openUrlInBrowser(context, context.getString(R.string.donation_url), false));
|
openUrlInBrowser(context, context.getString(R.string.donation_url), false));
|
||||||
|
|
||||||
aboutBinding.websiteLink.setOnClickListener(nv ->
|
aboutBinding.aboutWebsiteLink.setOnClickListener(nv ->
|
||||||
openUrlInBrowser(context, context.getString(R.string.website_url), false));
|
openUrlInBrowser(context, context.getString(R.string.website_url), false));
|
||||||
|
|
||||||
aboutBinding.privacyPolicyLink.setOnClickListener(v ->
|
aboutBinding.aboutPrivacyPolicyLink.setOnClickListener(v ->
|
||||||
openUrlInBrowser(context, context.getString(R.string.privacy_policy_url),
|
openUrlInBrowser(context, context.getString(R.string.privacy_policy_url),
|
||||||
false));
|
false));
|
||||||
|
|
||||||
|
@ -166,8 +166,8 @@ public class AboutActivity extends AppCompatActivity {
|
||||||
* A {@link FragmentStateAdapter} that returns a fragment corresponding to
|
* A {@link FragmentStateAdapter} that returns a fragment corresponding to
|
||||||
* one of the sections/tabs/pages.
|
* one of the sections/tabs/pages.
|
||||||
*/
|
*/
|
||||||
public static class SectionsPagerAdapter extends FragmentStateAdapter {
|
private static class AboutStateAdapter extends FragmentStateAdapter {
|
||||||
public SectionsPagerAdapter(final FragmentActivity fa) {
|
AboutStateAdapter(final FragmentActivity fa) {
|
||||||
super(fa);
|
super(fa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class LicenseFragment extends Fragment {
|
||||||
final FragmentLicensesBinding binding = FragmentLicensesBinding
|
final FragmentLicensesBinding binding = FragmentLicensesBinding
|
||||||
.inflate(inflater, container, false);
|
.inflate(inflater, container, false);
|
||||||
|
|
||||||
binding.appReadLicense.setOnClickListener(v -> {
|
binding.licensesAppReadLicense.setOnClickListener(v -> {
|
||||||
activeLicense = StandardLicenses.GPL3;
|
activeLicense = StandardLicenses.GPL3;
|
||||||
compositeDisposable.add(LicenseFragmentHelper.showLicense(getActivity(),
|
compositeDisposable.add(LicenseFragmentHelper.showLicense(getActivity(),
|
||||||
StandardLicenses.GPL3));
|
StandardLicenses.GPL3));
|
||||||
|
@ -96,7 +96,7 @@ public class LicenseFragment extends Fragment {
|
||||||
compositeDisposable.add(LicenseFragmentHelper.showLicense(getActivity(),
|
compositeDisposable.add(LicenseFragmentHelper.showLicense(getActivity(),
|
||||||
component.getLicense()));
|
component.getLicense()));
|
||||||
});
|
});
|
||||||
binding.softwareComponents.addView(root);
|
binding.licensesSoftwareComponents.addView(root);
|
||||||
registerForContextMenu(root);
|
registerForContextMenu(root);
|
||||||
}
|
}
|
||||||
if (activeLicense != null) {
|
if (activeLicense != null) {
|
||||||
|
@ -125,10 +125,10 @@ public class LicenseFragment extends Fragment {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.action_website:
|
case R.id.menu_software_website:
|
||||||
ShareUtils.openUrlInBrowser(getActivity(), component.getLink());
|
ShareUtils.openUrlInBrowser(getActivity(), component.getLink());
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_show_license:
|
case R.id.menu_software_show_license:
|
||||||
compositeDisposable.add(LicenseFragmentHelper.showLicense(getActivity(),
|
compositeDisposable.add(LicenseFragmentHelper.showLicense(getActivity(),
|
||||||
component.getLicense()));
|
component.getLicense()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,12 @@
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/main_content"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
tools:context="org.schabi.newpipe.about.AboutActivity">
|
tools:context="org.schabi.newpipe.about.AboutActivity">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/appbar"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/appbar_padding_top"
|
android:paddingTop="@dimen/appbar_padding_top"
|
||||||
|
@ -17,21 +15,21 @@
|
||||||
app:popupTheme="@style/ThemeOverlay.AppCompat.ActionBar">
|
app:popupTheme="@style/ThemeOverlay.AppCompat.ActionBar">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/about_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
android:background="?attr/colorPrimary"
|
android:background="?attr/colorPrimary"
|
||||||
app:layout_scrollFlags="scroll|enterAlways" />
|
app:layout_scrollFlags="scroll|enterAlways" />
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabLayout
|
<com.google.android.material.tabs.TabLayout
|
||||||
android:id="@+id/tabs"
|
android:id="@+id/about_tabLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<androidx.viewpager2.widget.ViewPager2
|
<androidx.viewpager2.widget.ViewPager2
|
||||||
android:id="@+id/container"
|
android:id="@+id/about_viewPager2"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
|
|
@ -15,16 +15,14 @@
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin">
|
android:paddingBottom="@dimen/activity_vertical_margin">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/logo"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:contentDescription="TODO"
|
android:contentDescription="@string/app_name"
|
||||||
app:srcCompat="@mipmap/ic_launcher" />
|
app:srcCompat="@mipmap/ic_launcher" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/app_name"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
|
@ -33,7 +31,7 @@
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/app_version"
|
android:id="@+id/about_app_version"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
|
@ -42,14 +40,12 @@
|
||||||
tools:text="0.9.9" />
|
tools:text="0.9.9" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/app_description"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingBottom="5dp"
|
android:paddingBottom="5dp"
|
||||||
android:text="@string/app_description" />
|
android:text="@string/app_description" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title_contribution"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
|
@ -62,7 +58,7 @@
|
||||||
android:text="@string/contribution_encouragement" />
|
android:text="@string/contribution_encouragement" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/github_link"
|
android:id="@+id/about_github_link"
|
||||||
style="@style/Base.Widget.AppCompat.Button.Borderless"
|
style="@style/Base.Widget.AppCompat.Button.Borderless"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -70,7 +66,6 @@
|
||||||
android:text="@string/view_on_github" />
|
android:text="@string/view_on_github" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title_donate"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
|
@ -83,7 +78,7 @@
|
||||||
android:text="@string/donation_encouragement" />
|
android:text="@string/donation_encouragement" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/donation_link"
|
android:id="@+id/about_donation_link"
|
||||||
style="@style/Base.Widget.AppCompat.Button.Borderless"
|
style="@style/Base.Widget.AppCompat.Button.Borderless"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -91,7 +86,6 @@
|
||||||
android:text="@string/give_back" />
|
android:text="@string/give_back" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title_website"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
|
@ -104,7 +98,7 @@
|
||||||
android:text="@string/website_encouragement" />
|
android:text="@string/website_encouragement" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/website_link"
|
android:id="@+id/about_website_link"
|
||||||
style="@style/Base.Widget.AppCompat.Button.Borderless"
|
style="@style/Base.Widget.AppCompat.Button.Borderless"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -112,7 +106,6 @@
|
||||||
android:text="@string/open_in_browser" />
|
android:text="@string/open_in_browser" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title_privacy_policy"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
|
@ -125,7 +118,7 @@
|
||||||
android:text="@string/privacy_policy_encouragement" />
|
android:text="@string/privacy_policy_encouragement" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/privacy_policy_link"
|
android:id="@+id/about_privacy_policy_link"
|
||||||
style="@style/Base.Widget.AppCompat.Button.Borderless"
|
style="@style/Base.Widget.AppCompat.Button.Borderless"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin">
|
android:paddingBottom="@dimen/activity_vertical_margin">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/app_license_title"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
||||||
|
@ -23,7 +22,6 @@
|
||||||
android:textAppearance="@android:style/TextAppearance.Large" />
|
android:textAppearance="@android:style/TextAppearance.Large" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/app_license"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
||||||
|
@ -31,7 +29,7 @@
|
||||||
android:text="@string/app_license" />
|
android:text="@string/app_license" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/app_read_license"
|
android:id="@+id/licenses_app_read_license"
|
||||||
style="@style/Base.Widget.AppCompat.Button.Borderless"
|
style="@style/Base.Widget.AppCompat.Button.Borderless"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -49,7 +47,7 @@
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/software_components"
|
android:id="@+id/licenses_software_components"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical" />
|
android:orientation="vertical" />
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_website"
|
android:id="@+id/menu_software_website"
|
||||||
android:title="@string/action_open_website" />
|
android:title="@string/action_open_website" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_show_license"
|
android:id="@+id/menu_software_show_license"
|
||||||
android:title="@string/read_full_license"></item>
|
android:title="@string/read_full_license" />
|
||||||
</menu>
|
</menu>
|
||||||
|
|
Loading…
Reference in a new issue