mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 18:06:48 +00:00
Refactor Folder to use ActivityContext and BaseDragLayer
These are the more generic versions of Launcher and DragLayer, so that Folders can be used in other surfaces. Test: Open and close Folders on home screen, ensure works properly Bug: 171917176 Change-Id: I39b9aedbd8319ca61ea0e776bc95eab585e023d5
This commit is contained in:
@@ -31,7 +31,6 @@ import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Log;
|
||||
import android.view.ContextThemeWrapper;
|
||||
|
||||
import androidx.annotation.IntDef;
|
||||
|
||||
@@ -333,7 +332,7 @@ public abstract class BaseActivity extends Activity implements ActivityContext {
|
||||
public static <T extends BaseActivity> T fromContext(Context context) {
|
||||
if (context instanceof BaseActivity) {
|
||||
return (T) context;
|
||||
} else if (context instanceof ContextThemeWrapper) {
|
||||
} else if (context instanceof ContextWrapper) {
|
||||
return fromContext(((ContextWrapper) context).getBaseContext());
|
||||
} else {
|
||||
throw new IllegalArgumentException("Cannot find BaseActivity in parent tree");
|
||||
|
||||
Reference in New Issue
Block a user