mirror of https://github.com/M66B/FairEmail.git
SimpleTask: reuse themed context
This commit is contained in:
parent
3225d002fc
commit
1524f3f6df
|
@ -61,6 +61,7 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
||||||
|
|
||||||
private static PowerManager.WakeLock wl = null;
|
private static PowerManager.WakeLock wl = null;
|
||||||
private static ExecutorService globalExecutor = null;
|
private static ExecutorService globalExecutor = null;
|
||||||
|
private static Context themedContext = null;
|
||||||
private static final List<SimpleTask> tasks = new ArrayList<>();
|
private static final List<SimpleTask> tasks = new ArrayList<>();
|
||||||
|
|
||||||
private static final int MAX_WAKELOCK = 30 * 60 * 1000; // milliseconds
|
private static final int MAX_WAKELOCK = 30 * 60 * 1000; // milliseconds
|
||||||
|
@ -155,9 +156,10 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Context themedContext = new ContextThemeWrapper(
|
if (themedContext == null)
|
||||||
context.getApplicationContext(),
|
themedContext = new ContextThemeWrapper(
|
||||||
FragmentDialogTheme.getTheme(context));
|
context.getApplicationContext(),
|
||||||
|
FragmentDialogTheme.getTheme(context));
|
||||||
|
|
||||||
future = getExecutor(context).submit(new Runnable() {
|
future = getExecutor(context).submit(new Runnable() {
|
||||||
private Object data;
|
private Object data;
|
||||||
|
|
Loading…
Reference in New Issue