Skip to content

Commit

Permalink
1.更新XUpdate版本
Browse files Browse the repository at this point in the history
2.RetryUpdateTipDialog国际化
  • Loading branch information
xuexiangjys committed Mar 26, 2023
1 parent 52ccb94 commit 8a892f2
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 9 deletions.
8 changes: 5 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ version '2.0.3'
buildscript {
repositories {
google()
jcenter()
mavenCentral()
jcenter { url 'https://maven.aliyun.com/repository/jcenter' }
}

dependencies {
Expand All @@ -15,7 +16,8 @@ buildscript {
rootProject.allprojects {
repositories {
google()
jcenter()
mavenCentral()
jcenter { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url "https://jitpack.io" }
}
}
Expand All @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions android/src/main/res/values-en-rUS/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="xupdate_retry_tip_dialog_content">The download speed is too slow, do you consider switching the download method?</string>

</resources>
6 changes: 6 additions & 0 deletions android/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="xupdate_retry_tip_dialog_content">更新下载速度太慢了,是否考虑切换下载方式?</string>

</resources>
6 changes: 6 additions & 0 deletions android/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="xupdate_retry_tip_dialog_content">The download speed is too slow, do you consider switching the download method?</string>

</resources>
6 changes: 4 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
jcenter { url 'https://maven.aliyun.com/repository/jcenter' }
}

dependencies {
Expand All @@ -12,7 +13,8 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
jcenter { url 'https://maven.aliyun.com/repository/jcenter' }
}
}

Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ class _MyAppState extends State<MyApp> {
///显示重试提示弹窗
void showRetryDialogTip() {
FlutterXUpdate.showRetryUpdateTipDialog(
retryContent: "Github下载速度太慢了,是否考虑切换蒲公英下载?",
// retryContent: "Github下载速度太慢了,是否考虑切换蒲公英下载?",
retryUrl: "https://www.pgyer.com/flutter_learn");
}

Expand Down

0 comments on commit 8a892f2

Please sign in to comment.