mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 07:46:55 +00:00
Lawnchair: Fix icon size and label size reload, implement launcher restart
This commit is contained in:
@@ -45,13 +45,21 @@ import com.android.launcher3.util.SecureSettingsObserver;
|
||||
import com.android.launcher3.util.SimpleBroadcastReceiver;
|
||||
import com.android.launcher3.widget.custom.CustomWidgetManager;
|
||||
|
||||
import app.lawnchair.LawnchairAppKt;
|
||||
|
||||
public class LauncherAppState {
|
||||
|
||||
public static final String ACTION_FORCE_ROLOAD = "force-reload-launcher";
|
||||
|
||||
// We do not need any synchronization for this variable as its only written on UI thread.
|
||||
public static final MainThreadInitializedObject<LauncherAppState> INSTANCE =
|
||||
new MainThreadInitializedObject<>(LauncherAppState::new);
|
||||
new MainThreadInitializedObject<LauncherAppState>(LauncherAppState::new) {
|
||||
@Override
|
||||
protected void onPostInit(Context context) {
|
||||
super.onPostInit(context);
|
||||
LawnchairAppKt.getLawnchairApp(context).onLauncherAppStateCreated();
|
||||
}
|
||||
};
|
||||
|
||||
private final Context mContext;
|
||||
private final LauncherModel mModel;
|
||||
@@ -65,6 +73,7 @@ public class LauncherAppState {
|
||||
private SimpleBroadcastReceiver mModelChangeReceiver;
|
||||
private SafeCloseable mCalendarChangeTracker;
|
||||
private SafeCloseable mUserChangeListener;
|
||||
private Launcher mLauncher;
|
||||
|
||||
public static LauncherAppState getInstance(final Context context) {
|
||||
return INSTANCE.get(context);
|
||||
@@ -177,6 +186,14 @@ public class LauncherAppState {
|
||||
}
|
||||
}
|
||||
|
||||
public void setLauncher(Launcher launcher) {
|
||||
mLauncher = launcher;
|
||||
}
|
||||
|
||||
public Launcher getLauncher() {
|
||||
return mLauncher;
|
||||
}
|
||||
|
||||
public IconCache getIconCache() {
|
||||
return mIconCache;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user