Have separate DeviceProfile instances for taskbar and all apps windows.

We want to scale down the DeviceProfile for taskbar, but the all apps
window should rely on the original DeviceProfile.

Test: Manual
Fix: 232907361
Change-Id: Ia09f674ada9e445c1d7278fa94c536ea9de13ef9
Merged-In: Ia09f674ada9e445c1d7278fa94c536ea9de13ef9
This commit is contained in:
Brian Isganitis
2022-05-23 18:11:47 -07:00
parent 3ddec48384
commit a9a78117c7
7 changed files with 39 additions and 42 deletions

View File

@@ -19,7 +19,6 @@ import android.content.Context;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DeviceProfile.DeviceProfileListenable;
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
import com.android.launcher3.util.Themes;
@@ -36,8 +35,6 @@ public abstract class BaseTaskbarContext extends ContextThemeWrapper implements
protected final LayoutInflater mLayoutInflater;
private final List<OnDeviceProfileChangeListener> mDPChangeListeners = new ArrayList<>();
protected DeviceProfile mDeviceProfile;
public BaseTaskbarContext(Context windowContext) {
super(windowContext, Themes.getActivityThemeRes(windowContext));
mLayoutInflater = LayoutInflater.from(this).cloneInContext(this);
@@ -48,19 +45,11 @@ public abstract class BaseTaskbarContext extends ContextThemeWrapper implements
return mLayoutInflater;
}
@Override
public final DeviceProfile getDeviceProfile() {
return mDeviceProfile;
}
@Override
public final List<OnDeviceProfileChangeListener> getOnDeviceProfileChangeListeners() {
return mDPChangeListeners;
}
/** Updates the {@link DeviceProfile} instance to the latest representation of the screen. */
public abstract void updateDeviceProfile(DeviceProfile dp);
/** Callback invoked when a drag is initiated within this context. */
public abstract void onDragStart();