Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31971a3b authored by Hyunyoung Song's avatar Hyunyoung Song
Browse files

Icon size should update when grid config changes

Bug: 123311886

More context: after IDP changes, DeviceProfile member is never updated
with newly calculated values.

However, all apps is still seriously broken, and I didn't address that
in this CL because jon may be working on it.

Change-Id: I69447a44c30ee467eec52b04bff0dc1afa5696a9
parent 4bf9336d
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -153,7 +153,8 @@ import java.util.Set;
 * Default launcher application.
 */
public class Launcher extends BaseDraggingActivity implements LauncherExterns,
        LauncherModel.Callbacks, LauncherProviderChangeListener, UserEventDelegate{
        LauncherModel.Callbacks, LauncherProviderChangeListener, UserEventDelegate,
        InvariantDeviceProfile.OnIDPChangeListener {
    public static final String TAG = "Launcher";
    static final boolean LOGD = false;

@@ -283,8 +284,9 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
        LauncherAppState app = LauncherAppState.getInstance(this);
        mOldConfig = new Configuration(getResources().getConfiguration());
        mModel = app.setLauncher(this);
        initDeviceProfile(app.getInvariantDeviceProfile());

        InvariantDeviceProfile idp = app.getInvariantDeviceProfile();
        initDeviceProfile(idp);
        idp.addOnChangeListener(this);
        mSharedPrefs = Utilities.getPrefs(this);
        mIconCache = app.getIconCache();
        mAccessibilityDelegate = new LauncherAccessibilityDelegate(this);
@@ -404,6 +406,12 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
        }
    }

    @Override
    public void onIdpChanged(int changeFlags, InvariantDeviceProfile idp) {
        initDeviceProfile(idp);
        getRootView().dispatchInsets();
    }

    private void initDeviceProfile(InvariantDeviceProfile idp) {
        // Load configuration-specific DeviceProfile
        mDeviceProfile = idp.getDeviceProfile(this);
@@ -1316,7 +1324,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,

        TextKeyListener.getInstance().release();
        clearPendingBinds();

        LauncherAppState.getIDP(this).removeOnChangeListener(this);
        if (mLauncherCallbacks != null) {
            mLauncherCallbacks.onDestroy();
        }