mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Introduce folder name type (auto vs manual).
Bug: 147769158 - Use both InputConnectionWrapper and TextWatcher to detect manual input - Also fix a bug in FolderNameProvider Change-Id: I7bc0f380c6641481d934a53e9feb77caa19c674a
This commit is contained in:
@@ -21,15 +21,11 @@ import android.util.AttributeSet;
|
||||
import android.view.DragEvent;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.CompletionInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.android.launcher3.folder.FolderNameProvider;
|
||||
import com.android.launcher3.util.UiThreadHelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* The edit text that reports back when the back key has been pressed.
|
||||
@@ -105,25 +101,6 @@ public class ExtendedEditText extends EditText {
|
||||
UiThreadHelper.hideKeyboardAsync(getContext(), getWindowToken());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommitCompletion(CompletionInfo text) {
|
||||
setText(text.getText());
|
||||
setSelection(text.getText().length());
|
||||
}
|
||||
|
||||
/**
|
||||
* Currently only used for folder name suggestion.
|
||||
*/
|
||||
public void displayCompletions(List<String> suggestList) {
|
||||
int cnt = Math.min(suggestList.size(), FolderNameProvider.SUGGEST_MAX);
|
||||
CompletionInfo[] cInfo = new CompletionInfo[cnt];
|
||||
for (int i = 0; i < cnt; i++) {
|
||||
cInfo[i] = new CompletionInfo(i, i, suggestList.get(i));
|
||||
}
|
||||
post(() -> getContext().getSystemService(InputMethodManager.class)
|
||||
.displayCompletions(this, cInfo));
|
||||
}
|
||||
|
||||
private boolean showSoftInput() {
|
||||
return requestFocus() &&
|
||||
getContext().getSystemService(InputMethodManager.class)
|
||||
|
||||
Reference in New Issue
Block a user