mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Moving Event dispatcher definition from LAuncher to BaseActivity so that
it can be used in other activities as well. Bug: 34766840 Change-Id: Ie4b723483792bee93fb75e63146ebea7dfeebeda
This commit is contained in:
@@ -21,9 +21,12 @@ import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.view.View.AccessibilityDelegate;
|
||||
|
||||
import com.android.launcher3.logging.UserEventDispatcher;
|
||||
|
||||
public abstract class BaseActivity extends Activity {
|
||||
|
||||
protected DeviceProfile mDeviceProfile;
|
||||
protected UserEventDispatcher mUserEventDispatcher;
|
||||
|
||||
public DeviceProfile getDeviceProfile() {
|
||||
return mDeviceProfile;
|
||||
@@ -33,6 +36,13 @@ public abstract class BaseActivity extends Activity {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final UserEventDispatcher getUserEventDispatcher() {
|
||||
if (mUserEventDispatcher == null) {
|
||||
mUserEventDispatcher = UserEventDispatcher.get(this);
|
||||
}
|
||||
return mUserEventDispatcher;
|
||||
}
|
||||
|
||||
public static BaseActivity fromContext(Context context) {
|
||||
if (context instanceof BaseActivity) {
|
||||
return (BaseActivity) context;
|
||||
|
||||
Reference in New Issue
Block a user