1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2026-03-05 07:19:44 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Stypox
0cdf40cd5f Merge pull request #13298 from dustdfg/shareutils_kao 2026-03-02 09:26:52 +01:00
Yevhen Babiichuk (DustDFG)
0020a02a28 Apply suggestion 2026-03-02 08:42:07 +02:00
3 changed files with 10 additions and 17 deletions

View File

@@ -27,7 +27,6 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
@@ -996,19 +995,18 @@ public class MainActivity extends AppCompatActivity {
"pt", "cs", "sk", "fa", "ar", "tr", "el", "th", "ru", "uk", "ko", "zh", "ja");
final var locale = Localization.getAppLocale();
final String kaoBaseUrl = "https://keepandroidopen.org/";
final String kaoURIString;
final String kaoURI;
if (supportedLannguages.contains(locale.getLanguage())) {
if ("zh".equals(locale.getLanguage())) {
kaoURIString = kaoBaseUrl + ("TW".equals(locale.getCountry()) ? "zh-TW" : "zh-CN");
kaoURI = kaoBaseUrl + ("TW".equals(locale.getCountry()) ? "zh-TW" : "zh-CN");
} else {
kaoURIString = kaoBaseUrl + locale.getLanguage();
kaoURI = kaoBaseUrl + locale.getLanguage();
}
} else {
kaoURIString = kaoBaseUrl;
kaoURI = kaoBaseUrl;
}
final var kaoURI = Uri.parse(kaoURIString);
final var solutionURI = Uri.parse(
"https://github.com/woheller69/FreeDroidWarn?tab=readme-ov-file#solutions");
final var solutionURI =
"https://github.com/woheller69/FreeDroidWarn?tab=readme-ov-file#solutions";
if (kaoLastCheck.plus(30, ChronoUnit.DAYS).isBefore(now)) {
final var dialog = new AlertDialog.Builder(this)
@@ -1030,10 +1028,10 @@ public class MainActivity extends AppCompatActivity {
// If we use setNeutralButton and etc. dialog will close after pressing the buttons,
// but we want it to close only when positive button is pressed
dialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(v ->
this.startActivity(new Intent(Intent.ACTION_VIEW, kaoURI))
ShareUtils.openUrlInBrowser(this, kaoURI)
);
dialog.getButton(AlertDialog.BUTTON_NEUTRAL).setOnClickListener(v ->
this.startActivity(new Intent(Intent.ACTION_VIEW, solutionURI))
ShareUtils.openUrlInBrowser(this, solutionURI)
);
}
}

View File

@@ -58,7 +58,7 @@ teamnewpipe-nanojson = "e9d656ddb49a412a5a0a5d5ef20ca7ef09549996"
# the corresponding commit hash, since JitPack sometimes deletes artifacts.
# If theres already a git hash, just add more of it to the end (or remove a letter)
# to cause jitpack to regenerate the artifact.
teamnewpipe-newpipe-extractor = "66d9ee1-SNAPSHOT"
teamnewpipe-newpipe-extractor = "824486dfdf4e9ba0fbe820bc2938f9101ae739a6"
viewpager2 = "1.1.0"
webkit = "1.14.0" # Newer versions require minSdk >= 23
work = "2.10.5" # Newer versions require minSdk >= 23
@@ -114,7 +114,7 @@ lisawray-groupie-core = { module = "com.github.lisawray.groupie:groupie", versio
lisawray-groupie-viewbinding = { module = "com.github.lisawray.groupie:groupie-viewbinding", version.ref = "groupie" }
livefront-bridge = { module = "com.github.livefront:bridge", version.ref = "bridge" }
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockitoCore" }
newpipe-extractor = { module = "net.newpipe:extractor", version.ref = "teamnewpipe-newpipe-extractor" }
newpipe-extractor = { module = "com.github.TeamNewPipe:NewPipeExtractor", version.ref = "teamnewpipe-newpipe-extractor" }
newpipe-filepicker = { module = "com.github.TeamNewPipe:NoNonsense-FilePicker", version.ref = "teamnewpipe-filepicker" }
newpipe-nanojson = { module = "com.github.TeamNewPipe:nanojson", version.ref = "teamnewpipe-nanojson" }
noties-markwon-core = { module = "io.noties.markwon:core", version.ref = "markwon" }

View File

@@ -17,11 +17,6 @@ dependencyResolutionManagement {
mavenCentral()
maven(url = "https://jitpack.io")
maven(url = "https://repo.clojars.org")
maven(url = "https://central.sonatype.com/repository/maven-snapshots/") {
content {
includeGroup("net.newpipe")
}
}
}
}
include (":app")