feat: Add option to clear home screen in settings (#6125)
Signed-off-by: abhixv <abhi.sharma1@hotmail.com>
This commit is contained in:
committed by
Pun Butrach
parent
9898749619
commit
5f3a03f4fb
@@ -15,31 +15,33 @@
|
||||
*/
|
||||
package com.android.launcher3.util;
|
||||
|
||||
import android.R;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.view.ContextThemeWrapper;
|
||||
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
|
||||
import com.android.launcher3.InvariantDeviceProfile;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
import com.android.launcher3.views.BaseDragLayer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* {@link ContextWrapper} with internal Launcher interface for testing
|
||||
*/
|
||||
public class ActivityContextWrapper extends BaseContext {
|
||||
public class ActivityContextWrapper extends ContextThemeWrapper implements ActivityContext {
|
||||
|
||||
private final List<OnDeviceProfileChangeListener> mDpChangeListeners = new ArrayList<>();
|
||||
|
||||
private final DeviceProfile mProfile;
|
||||
private final MyDragLayer mMyDragLayer;
|
||||
|
||||
public ActivityContextWrapper(Context base) {
|
||||
this(base, R.style.Theme_DeviceDefault);
|
||||
}
|
||||
|
||||
public ActivityContextWrapper(Context base, int theme) {
|
||||
super(base, theme);
|
||||
super(base, android.R.style.Theme_DeviceDefault);
|
||||
mProfile = InvariantDeviceProfile.INSTANCE.get(base).getDeviceProfile(base).copy(base);
|
||||
mMyDragLayer = new MyDragLayer(this);
|
||||
Executors.MAIN_EXECUTOR.execute(this::onViewCreated);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,6 +49,11 @@ public class ActivityContextWrapper extends BaseContext {
|
||||
return mMyDragLayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OnDeviceProfileChangeListener> getOnDeviceProfileChangeListeners() {
|
||||
return mDpChangeListeners;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceProfile getDeviceProfile() {
|
||||
return mProfile;
|
||||
|
||||
Reference in New Issue
Block a user