mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
Merge "Clean up device profile change listeners for AllApps." into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
cdfdd444bc
@@ -76,7 +76,6 @@ public class PredictionRowView<T extends Context & ActivityContext>
|
||||
|
||||
mFocusHelper = new SimpleFocusIndicatorHelper(this);
|
||||
mActivityContext = ActivityContext.lookupContext(context);
|
||||
mActivityContext.addOnDeviceProfileChangeListener(this);
|
||||
mNumPredictedAppsPerRow = mActivityContext.getDeviceProfile().numShownAllAppsColumns;
|
||||
updateVisibility();
|
||||
}
|
||||
@@ -84,6 +83,13 @@ public class PredictionRowView<T extends Context & ActivityContext>
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
mActivityContext.addOnDeviceProfileChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
mActivityContext.removeOnDeviceProfileChangeListener(this);
|
||||
}
|
||||
|
||||
public void setup(FloatingHeaderView parent, FloatingHeaderRow[] rows, boolean tabsHidden) {
|
||||
|
||||
@@ -112,12 +112,23 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
|
||||
DeviceProfile dp = mActivityContext.getDeviceProfile();
|
||||
setShiftRange(dp.allAppsShiftRange);
|
||||
|
||||
mActivityContext.addOnDeviceProfileChangeListener(this);
|
||||
setContentBackgroundWithParent(
|
||||
getContext().getDrawable(R.drawable.bg_rounded_corner_bottom_sheet),
|
||||
mAppsView.getBottomSheetBackground());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
mActivityContext.addOnDeviceProfileChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
mActivityContext.removeOnDeviceProfileChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onScaleProgressChanged() {
|
||||
super.onScaleProgressChanged();
|
||||
|
||||
Reference in New Issue
Block a user