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