Add java8 support
This commit is contained in:
parent
723912d928
commit
7793cc822d
44 changed files with 512 additions and 929 deletions
|
|
@ -33,12 +33,7 @@ public abstract class DialogAsyncTask<Params, Progress, Result> extends AsyncTas
|
|||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
if (delay > 0) {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
initAndShowDialog();
|
||||
}
|
||||
}, delay);
|
||||
new Handler().postDelayed(this::initAndShowDialog, delay);
|
||||
} else {
|
||||
initAndShowDialog();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,20 +38,17 @@ public class UpdateToastMediaScannerCompletionListener implements MediaScannerCo
|
|||
public void onScanCompleted(final String path, final Uri uri) {
|
||||
Activity activity = activityWeakReference.get();
|
||||
if (activity != null) {
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast toast = toastWeakReference.get();
|
||||
if (toast != null) {
|
||||
if (uri == null) {
|
||||
failed++;
|
||||
} else {
|
||||
scanned++;
|
||||
}
|
||||
String text = " " + String.format(scannedFiles, scanned, toBeScanned.length) + (failed > 0 ? " " + String.format(couldNotScanFiles, failed) : "");
|
||||
toast.setText(text);
|
||||
toast.show();
|
||||
activity.runOnUiThread(() -> {
|
||||
Toast toast = toastWeakReference.get();
|
||||
if (toast != null) {
|
||||
if (uri == null) {
|
||||
failed++;
|
||||
} else {
|
||||
scanned++;
|
||||
}
|
||||
String text = " " + String.format(scannedFiles, scanned, toBeScanned.length) + (failed > 0 ? " " + String.format(couldNotScanFiles, failed) : "");
|
||||
toast.setText(text);
|
||||
toast.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue