You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
copy AutoCompleteTextView from AOSP
copied from main branch (frameworks/base commit 72ea9148bc619515a649cec9029136e42b342d9b)
This commit is contained in:
@@ -31,6 +31,22 @@ JNIEXPORT void JNICALL Java_android_widget_PopupWindow_native_1setContentView
|
|||||||
JNIEXPORT void JNICALL Java_android_widget_PopupWindow_native_1showAsDropDown
|
JNIEXPORT void JNICALL Java_android_widget_PopupWindow_native_1showAsDropDown
|
||||||
(JNIEnv *, jobject, jlong, jlong, jint, jint, jint);
|
(JNIEnv *, jobject, jlong, jlong, jint, jint, jint);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: android_widget_PopupWindow
|
||||||
|
* Method: native_isShowing
|
||||||
|
* Signature: (J)Z
|
||||||
|
*/
|
||||||
|
JNIEXPORT jboolean JNICALL Java_android_widget_PopupWindow_native_1isShowing
|
||||||
|
(JNIEnv *, jobject, jlong);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: android_widget_PopupWindow
|
||||||
|
* Method: native_dismiss
|
||||||
|
* Signature: (J)V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_android_widget_PopupWindow_native_1dismiss
|
||||||
|
(JNIEnv *, jobject, jlong);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: android_widget_PopupWindow
|
* Class: android_widget_PopupWindow
|
||||||
* Method: setOnDismissListener
|
* Method: setOnDismissListener
|
||||||
|
|||||||
@@ -58,3 +58,13 @@ JNIEXPORT void JNICALL Java_android_widget_PopupWindow_setOnDismissListener(JNIE
|
|||||||
GtkWidget *popover = GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "popover")));
|
GtkWidget *popover = GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "popover")));
|
||||||
g_signal_connect(popover, "closed", G_CALLBACK(on_closed_cb), _REF(listener));
|
g_signal_connect(popover, "closed", G_CALLBACK(on_closed_cb), _REF(listener));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT jboolean JNICALL Java_android_widget_PopupWindow_native_1isShowing(JNIEnv *env, jobject this, jlong popover_ptr)
|
||||||
|
{
|
||||||
|
return gtk_widget_get_visible(GTK_WIDGET(_PTR(popover_ptr)));
|
||||||
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_android_widget_PopupWindow_native_1dismiss(JNIEnv *env, jobject this, jlong popover_ptr)
|
||||||
|
{
|
||||||
|
gtk_popover_popdown(GTK_POPOVER(_PTR(popover_ptr)));
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,6 +17,11 @@ public class ContextThemeWrapper extends ContextWrapper {
|
|||||||
setTheme(themeResId);
|
setTheme(themeResId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ContextThemeWrapper(Context context, Resources.Theme theme) {
|
||||||
|
super(context);
|
||||||
|
this.theme = theme;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTheme(int resid) {
|
public void setTheme(int resid) {
|
||||||
if (theme == null) {
|
if (theme == null) {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ import java.util.List;
|
|||||||
* or to have some of data besides toString() results fill the views,
|
* 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.
|
* 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.
|
* 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.
|
* The content of this list is referred to as "the array" in the documentation.
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -16,6 +16,10 @@ public class EditText extends TextView {
|
|||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EditText(Context context, AttributeSet attrs, int defStyle, int defStyleRes) {
|
||||||
|
super(context, attrs, defStyle, defStyleRes);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected native long native_constructor(Context context, AttributeSet attrs);
|
protected native long native_constructor(Context context, AttributeSet attrs);
|
||||||
protected native String native_getText(long widget);
|
protected native String native_getText(long widget);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -43,12 +43,16 @@ public class PopupWindow {
|
|||||||
protected native long native_constructor();
|
protected native long native_constructor();
|
||||||
protected native void native_setContentView(long widget, long contentView);
|
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 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 setBackgroundDrawable(Drawable background) {}
|
||||||
|
|
||||||
public void setInputMethodMode(int mode) {}
|
public void setInputMethodMode(int mode) {}
|
||||||
|
|
||||||
public boolean isShowing() {return false;}
|
public boolean isShowing() {
|
||||||
|
return native_isShowing(popover);
|
||||||
|
}
|
||||||
|
|
||||||
public native void setOnDismissListener(OnDismissListener listener);
|
public native void setOnDismissListener(OnDismissListener listener);
|
||||||
|
|
||||||
@@ -58,8 +62,10 @@ public class PopupWindow {
|
|||||||
|
|
||||||
public void setContentView(View view) {
|
public void setContentView(View view) {
|
||||||
contentView = view;
|
contentView = view;
|
||||||
contentView.attachToWindowInternal();
|
if (contentView != null) {
|
||||||
native_setContentView(popover, view.widget);
|
contentView.attachToWindowInternal();
|
||||||
|
}
|
||||||
|
native_setContentView(popover, view == null ? 0 : view.widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getInputMethodMode() {return 0;}
|
public int getInputMethodMode() {return 0;}
|
||||||
@@ -95,7 +101,7 @@ public class PopupWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void dismiss() {
|
public void dismiss() {
|
||||||
System.out.println("PopupWindow.dismiss() called");
|
native_dismiss(popover);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAnimationStyle(int animationStyle) {}
|
public void setAnimationStyle(int animationStyle) {}
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ public class TextView extends View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public TextView(Context context, AttributeSet attrs, int defStyleAttr) {
|
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);
|
super(context, attrs, defStyleAttr);
|
||||||
|
|
||||||
TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.TextView, defStyleAttr, 0);
|
TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.TextView, defStyleAttr, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user