From 6b0381b9031aca56e2c11269b874c79b90213d8e Mon Sep 17 00:00:00 2001 From: bopol Date: Sun, 31 May 2020 12:17:54 +0200 Subject: [PATCH] avoid duplicate: use openUrlInBrowser instead of openWebsite --- .../org/schabi/newpipe/about/AboutActivity.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/about/AboutActivity.java b/app/src/main/java/org/schabi/newpipe/about/AboutActivity.java index 2fb8ac7f7..b5be2dde6 100644 --- a/app/src/main/java/org/schabi/newpipe/about/AboutActivity.java +++ b/app/src/main/java/org/schabi/newpipe/about/AboutActivity.java @@ -1,8 +1,6 @@ package org.schabi.newpipe.about; import android.content.Context; -import android.content.Intent; -import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; import android.view.MenuItem; @@ -26,6 +24,7 @@ import org.schabi.newpipe.R; import org.schabi.newpipe.util.ThemeHelper; import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage; +import static org.schabi.newpipe.util.ShareUtils.openUrlInBrowser; public class AboutActivity extends AppCompatActivity { /** @@ -143,28 +142,23 @@ public class AboutActivity extends AppCompatActivity { View githubLink = rootView.findViewById(R.id.github_link); githubLink.setOnClickListener(nv -> - openWebsite(context.getString(R.string.github_url), context)); + openUrlInBrowser(context, context.getString(R.string.github_url))); View donationLink = rootView.findViewById(R.id.donation_link); donationLink.setOnClickListener(v -> - openWebsite(context.getString(R.string.donation_url), context)); + openUrlInBrowser(context, context.getString(R.string.donation_url))); View websiteLink = rootView.findViewById(R.id.website_link); websiteLink.setOnClickListener(nv -> - openWebsite(context.getString(R.string.website_url), context)); + openUrlInBrowser(context, context.getString(R.string.website_url))); View privacyPolicyLink = rootView.findViewById(R.id.privacy_policy_link); privacyPolicyLink.setOnClickListener(v -> - openWebsite(context.getString(R.string.privacy_policy_url), context)); + openUrlInBrowser(context, context.getString(R.string.privacy_policy_url))); return rootView; } - private void openWebsite(final String url, final Context context) { - Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); - context.startActivity(intent); - } - } /**