Removing Launcher dependency from Folders

This allows opening/closing folders without a Launcher context

Bug: 187353581
Test: Manual
Change-Id: Id73a40445a23004eb554f0422d286aa0ff6b3c41
This commit is contained in:
Sunny Goyal
2021-05-06 12:11:44 -07:00
parent 7bce233fb4
commit 5996937798
16 changed files with 559 additions and 256 deletions

View File

@@ -15,6 +15,8 @@
*/
package com.android.launcher3;
import static com.android.launcher3.util.UiThreadHelper.hideKeyboardAsync;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
@@ -25,7 +27,7 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.util.UiThreadHelper;
import com.android.launcher3.views.ActivityContext;
/**
@@ -99,7 +101,7 @@ public class ExtendedEditText extends EditText {
}
public void hideKeyboard() {
UiThreadHelper.hideKeyboardAsync(Launcher.getLauncher(getContext()), getWindowToken());
hideKeyboardAsync(ActivityContext.lookupContext(getContext()), getWindowToken());
}
private boolean showSoftInput() {