mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Merge "Prevent the work mode switch thumb from being dragged." into ub-launcher3-master
This commit is contained in:
committed by
Android (Google) Code Review
commit
9e26e26f00
@@ -20,6 +20,7 @@ import android.os.AsyncTask;
|
||||
import android.os.Process;
|
||||
import android.os.UserHandle;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.Switch;
|
||||
|
||||
import com.android.launcher3.compat.UserManagerCompat;
|
||||
@@ -61,6 +62,11 @@ public class WorkModeSwitch extends Switch {
|
||||
setEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
return ev.getActionMasked() == MotionEvent.ACTION_MOVE || super.onTouchEvent(ev);
|
||||
}
|
||||
|
||||
private void trySetQuietModeEnabledToAllProfilesAsync(boolean enabled) {
|
||||
new SetQuietModeEnabledAsyncTask(enabled, new WeakReference<>(this)).execute();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user