copy AutoCompleteTextView from AOSP

copied from main branch (frameworks/base commit 72ea9148bc619515a649cec9029136e42b342d9b)
This commit is contained in:
Julian Winkler
2025-02-11 18:02:46 +01:00
parent 1cf48085ff
commit c725bb32df
9 changed files with 2889 additions and 29 deletions

View File

@@ -43,7 +43,7 @@ import java.util.List;
* or to have some of data besides toString() results fill the views,
* override {@link #getView(int, View, ViewGroup)} to return the type of view you want.
*/
public class ArrayAdapter<T> extends BaseAdapter /*implements Filterable*/ {
public class ArrayAdapter<T> extends BaseAdapter implements Filterable {
/**
* Contains the list of objects that represent the data of this ArrayAdapter.
* The content of this list is referred to as "the array" in the documentation.

File diff suppressed because it is too large Load Diff

View File

@@ -16,6 +16,10 @@ public class EditText extends TextView {
super(context, attrs);
}
public EditText(Context context, AttributeSet attrs, int defStyle, int defStyleRes) {
super(context, attrs, defStyle, defStyleRes);
}
@Override
protected native long native_constructor(Context context, AttributeSet attrs);
protected native String native_getText(long widget);

File diff suppressed because it is too large Load Diff

View File

@@ -43,12 +43,16 @@ public class PopupWindow {
protected native long native_constructor();
protected native void native_setContentView(long widget, long contentView);
protected native void native_showAsDropDown(long widget, long anchor, int xoff, int yoff, int gravity);
protected native boolean native_isShowing(long widget);
protected native void native_dismiss(long widget);
public void setBackgroundDrawable(Drawable background) {}
public void setInputMethodMode(int mode) {}
public boolean isShowing() {return false;}
public boolean isShowing() {
return native_isShowing(popover);
}
public native void setOnDismissListener(OnDismissListener listener);
@@ -58,8 +62,10 @@ public class PopupWindow {
public void setContentView(View view) {
contentView = view;
contentView.attachToWindowInternal();
native_setContentView(popover, view.widget);
if (contentView != null) {
contentView.attachToWindowInternal();
}
native_setContentView(popover, view == null ? 0 : view.widget);
}
public int getInputMethodMode() {return 0;}
@@ -95,7 +101,7 @@ public class PopupWindow {
}
public void dismiss() {
System.out.println("PopupWindow.dismiss() called");
native_dismiss(popover);
}
public void setAnimationStyle(int animationStyle) {}

View File

@@ -39,6 +39,10 @@ public class TextView extends View {
}
public TextView(Context context, AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}
public TextView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr);
TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.TextView, defStyleAttr, 0);