diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/com/wireguard/android/preference/LogExporterPreference.java | 6 | ||||
-rw-r--r-- | app/src/main/java/com/wireguard/android/preference/ZipExporterPreference.java | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/app/src/main/java/com/wireguard/android/preference/LogExporterPreference.java b/app/src/main/java/com/wireguard/android/preference/LogExporterPreference.java index d73c41bc..cba30522 100644 --- a/app/src/main/java/com/wireguard/android/preference/LogExporterPreference.java +++ b/app/src/main/java/com/wireguard/android/preference/LogExporterPreference.java @@ -91,9 +91,9 @@ public class LogExporterPreference extends Preference { Snackbar.make( getPrefActivity(this).findViewById(android.R.id.content), message, Snackbar.LENGTH_LONG).show(); + setEnabled(true); } else { exportedFilePath = filePath; - setEnabled(false); notifyChanged(); } } @@ -115,8 +115,10 @@ public class LogExporterPreference extends Preference { getPrefActivity(this).ensurePermissions( new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, (permissions, granted) -> { - if (granted.length > 0 && granted[0] == PackageManager.PERMISSION_GRANTED) + if (granted.length > 0 && granted[0] == PackageManager.PERMISSION_GRANTED) { + setEnabled(false); exportLog(); + } }); } diff --git a/app/src/main/java/com/wireguard/android/preference/ZipExporterPreference.java b/app/src/main/java/com/wireguard/android/preference/ZipExporterPreference.java index 70357e44..b2f22a67 100644 --- a/app/src/main/java/com/wireguard/android/preference/ZipExporterPreference.java +++ b/app/src/main/java/com/wireguard/android/preference/ZipExporterPreference.java @@ -99,9 +99,9 @@ public class ZipExporterPreference extends Preference { Snackbar.make( getPrefActivity(this).findViewById(android.R.id.content), message, Snackbar.LENGTH_LONG).show(); + setEnabled(true); } else { exportedFilePath = filePath; - setEnabled(false); notifyChanged(); } } @@ -123,8 +123,10 @@ public class ZipExporterPreference extends Preference { getPrefActivity(this).ensurePermissions( new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, (permissions, granted) -> { - if (granted.length > 0 && granted[0] == PackageManager.PERMISSION_GRANTED) + if (granted.length > 0 && granted[0] == PackageManager.PERMISSION_GRANTED) { + setEnabled(false); exportZip(); + } }); } |