Skip to content

Commit a3bd3f2

Browse files
authored
Merge pull request #98 from eltos/eltos-fix-97
Fix crash on dismissing SimpleProgressDialog after pressing Home
2 parents 6779c9b + 984deb2 commit a3bd3f2

File tree

7 files changed

+25
-17
lines changed

7 files changed

+25
-17
lines changed

.idea/gradle.xml

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
mavenCentral()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:8.1.4'
9+
classpath 'com.android.tools.build:gradle:8.13.0'
1010

1111
// Required plugins added to classpath to facilitate pushing to maven
1212
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sat Nov 04 11:57:33 CET 2023
1+
#Tue Sep 30 18:40:20 CEST 2025
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

lintchecks/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ apply plugin: 'com.android.lint'
33

44
dependencies {
55
// If the Gradle plugin version is X.Y.Z, then the Lint library version is X+23.Y.Z
6-
compileOnly 'com.android.tools.lint:lint-api:31.9.1'
7-
compileOnly 'com.android.tools.lint:lint-checks:31.9.1'
6+
compileOnly 'com.android.tools.lint:lint-api:31.13.0'
7+
compileOnly 'com.android.tools.lint:lint-checks:31.13.0'
88
}
99

1010
jar {

simpledialogfragments/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ apply plugin: 'com.android.library'
33
android {
44
namespace 'eltos.simpledialogfragment'
55

6-
compileSdk 34
76

87
defaultConfig {
8+
compileSdkVersion 36
99
minSdkVersion 21
1010
targetSdkVersion 34
1111
}
@@ -34,8 +34,8 @@ dependencies {
3434
lintPublish project(':lintchecks')
3535

3636
testImplementation 'junit:junit:4.13.2'
37-
implementation 'androidx.appcompat:appcompat:1.7.0'
38-
implementation 'com.google.android.material:material:1.12.0'
37+
implementation 'androidx.appcompat:appcompat:1.7.1'
38+
implementation 'com.google.android.material:material:1.13.0'
3939
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
4040
implementation 'com.alimuzaffar.lib:pinentryedittext:2.0.6'
4141
}

simpledialogfragments/src/main/java/eltos/simpledialogfragment/SimpleProgressDialog.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package eltos.simpledialogfragment;
1818

19+
import android.os.AsyncTask;
1920
import android.os.Bundle;
2021
import android.text.TextUtils;
2122
import android.view.View;
@@ -282,13 +283,21 @@ public void updateFinished(){
282283
setPositiveButtonEnabled(true);
283284
setNeutralButtonEnabled(false);
284285
if (getArgs().getBoolean(AUTO_DISMISS)){
285-
dismiss();
286+
dismissAllowingStateLoss(); // ok to fail if stopped, will dismiss in onResume
286287
callResultListener(COMPLETED, new Bundle());
287288
}
288289
}
289290
}
290291

291-
292+
@Override
293+
public void onResume() {
294+
super.onResume();
295+
if (getArgs().getBoolean(AUTO_DISMISS)) {
296+
if (mTask != null && mTask.getStatus() == AsyncTask.Status.FINISHED) {
297+
dismiss();
298+
}
299+
}
300+
}
292301

293302
/**
294303
* Set or update the progress text at the start of the progress bar /

testApp/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ plugins {
66
android {
77
namespace 'eltos.simpledialogfragments'
88

9-
compileSdk 34
109

1110
defaultConfig {
1211
applicationId 'eltos.simpledialogfragments.test'
12+
compileSdkVersion 36
1313
minSdkVersion 21
1414
targetSdkVersion 34
1515
versionCode rootProject.ext['VERSION_NR']
@@ -30,10 +30,10 @@ repositories {
3030

3131
dependencies {
3232
testImplementation 'junit:junit:4.13.2'
33-
implementation 'androidx.appcompat:appcompat:1.7.0'
34-
implementation 'com.google.android.material:material:1.12.0'
33+
implementation 'androidx.appcompat:appcompat:1.7.1'
34+
implementation 'com.google.android.material:material:1.13.0'
3535
implementation 'com.google.android.flexbox:flexbox:3.0.0'
36-
implementation 'com.google.zxing:core:3.5.2'
36+
implementation 'com.google.zxing:core:3.5.3'
3737

3838
// sonatype maven
3939
//implementation 'io.github.eltos:simpledialogfragments:3.5.1'

0 commit comments

Comments
 (0)