diff --git a/android/build.gradle b/android/build.gradle index dc99454..6476971 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -4,7 +4,8 @@ version '2.0.3' buildscript { repositories { google() - jcenter() + mavenCentral() + jcenter { url 'https://maven.aliyun.com/repository/jcenter' } } dependencies { @@ -15,7 +16,8 @@ buildscript { rootProject.allprojects { repositories { google() - jcenter() + mavenCentral() + jcenter { url 'https://maven.aliyun.com/repository/jcenter' } maven { url "https://jitpack.io" } } } @@ -36,7 +38,7 @@ android { } dependencies { - implementation 'com.github.xuexiangjys:XUpdate:2.1.3' + implementation 'com.github.xuexiangjys:XUpdate:2.1.4' implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'com.google.code.gson:gson:2.8.5' implementation 'com.zhy:okhttputils:2.6.2' diff --git a/android/src/main/java/com/xuexiang/flutter_xupdate/RetryUpdateTipDialog.java b/android/src/main/java/com/xuexiang/flutter_xupdate/RetryUpdateTipDialog.java index 0ff7a87..2e0cb15 100644 --- a/android/src/main/java/com/xuexiang/flutter_xupdate/RetryUpdateTipDialog.java +++ b/android/src/main/java/com/xuexiang/flutter_xupdate/RetryUpdateTipDialog.java @@ -65,19 +65,19 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { final String url = getIntent().getStringExtra(KEY_URL); if (TextUtils.isEmpty(content)) { - content = "更新下载速度太慢了,是否考虑切换下载方式?"; + content = getString(R.string.xupdate_retry_tip_dialog_content); } AlertDialog dialog = new AlertDialog.Builder(this) .setMessage(content) - .setPositiveButton("是", new DialogInterface.OnClickListener() { + .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); goWeb(url); } }) - .setNegativeButton( "否", null) + .setNegativeButton(android.R.string.no, null) .setCancelable(false) .show(); dialog.setOnDismissListener(this); diff --git a/android/src/main/res/values-en-rUS/strings.xml b/android/src/main/res/values-en-rUS/strings.xml new file mode 100644 index 0000000..edf64bd --- /dev/null +++ b/android/src/main/res/values-en-rUS/strings.xml @@ -0,0 +1,6 @@ + + + + The download speed is too slow, do you consider switching the download method? + + \ No newline at end of file diff --git a/android/src/main/res/values-zh-rCN/strings.xml b/android/src/main/res/values-zh-rCN/strings.xml new file mode 100644 index 0000000..2869ca1 --- /dev/null +++ b/android/src/main/res/values-zh-rCN/strings.xml @@ -0,0 +1,6 @@ + + + + 更新下载速度太慢了,是否考虑切换下载方式? + + \ No newline at end of file diff --git a/android/src/main/res/values/strings.xml b/android/src/main/res/values/strings.xml new file mode 100644 index 0000000..edf64bd --- /dev/null +++ b/android/src/main/res/values/strings.xml @@ -0,0 +1,6 @@ + + + + The download speed is too slow, do you consider switching the download method? + + \ No newline at end of file diff --git a/example/android/build.gradle b/example/android/build.gradle index 6de3728..d8db2fb 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,7 +1,8 @@ buildscript { repositories { google() - jcenter() + mavenCentral() + jcenter { url 'https://maven.aliyun.com/repository/jcenter' } } dependencies { @@ -12,7 +13,8 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() + jcenter { url 'https://maven.aliyun.com/repository/jcenter' } } } diff --git a/example/lib/main.dart b/example/lib/main.dart index 00b6687..9410fb8 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -313,7 +313,7 @@ class _MyAppState extends State { ///显示重试提示弹窗 void showRetryDialogTip() { FlutterXUpdate.showRetryUpdateTipDialog( - retryContent: "Github下载速度太慢了,是否考虑切换蒲公英下载?", + // retryContent: "Github下载速度太慢了,是否考虑切换蒲公英下载?", retryUrl: "https://www.pgyer.com/flutter_learn"); }