mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 07:46:55 +00:00
Exposing some private methods to easily customize arrow popup
Change-Id: I6f6dc0604a616f26c0879732a0237767ddbfdccc
This commit is contained in:
@@ -26,6 +26,7 @@ import android.content.ContextWrapper;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.support.annotation.IntDef;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.View.AccessibilityDelegate;
|
||||
|
||||
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
|
||||
@@ -116,13 +117,6 @@ public abstract class BaseActivity extends Activity implements UserEventDelegate
|
||||
return Utilities.ATLEAST_NOUGAT && isInMultiWindowMode();
|
||||
}
|
||||
|
||||
public static BaseActivity fromContext(Context context) {
|
||||
if (context instanceof BaseActivity) {
|
||||
return (BaseActivity) context;
|
||||
}
|
||||
return ((BaseActivity) ((ContextWrapper) context).getBaseContext());
|
||||
}
|
||||
|
||||
public SystemUiController getSystemUiController() {
|
||||
if (mSystemUiController == null) {
|
||||
mSystemUiController = new SystemUiController(getWindow());
|
||||
@@ -259,4 +253,14 @@ public abstract class BaseActivity extends Activity implements UserEventDelegate
|
||||
writer.println(" mActivityFlags: " + mActivityFlags);
|
||||
writer.println(" mForceInvisible: " + mForceInvisible);
|
||||
}
|
||||
|
||||
public static <T extends BaseActivity> T fromContext(Context context) {
|
||||
if (context instanceof BaseActivity) {
|
||||
return (T) context;
|
||||
} else if (context instanceof ContextThemeWrapper) {
|
||||
return fromContext(((ContextWrapper) context).getBaseContext());
|
||||
} else {
|
||||
throw new IllegalArgumentException("Cannot find BaseActivity in parent tree");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user