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
ListView: copy from AOSP
copied from tag android-6.0.1_r81
This commit is contained in:
@@ -130,7 +130,6 @@ libtranslationlayer_so = shared_library('translation_layer_main', [
|
|||||||
'src/api-impl-jni/widgets/WrapperWidget.c',
|
'src/api-impl-jni/widgets/WrapperWidget.c',
|
||||||
'src/api-impl-jni/widgets/android_view_SurfaceView.c',
|
'src/api-impl-jni/widgets/android_view_SurfaceView.c',
|
||||||
'src/api-impl-jni/widgets/android_webkit_WebView.c',
|
'src/api-impl-jni/widgets/android_webkit_WebView.c',
|
||||||
'src/api-impl-jni/widgets/android_widget_AbsListView.c',
|
|
||||||
'src/api-impl-jni/widgets/android_widget_Button.c',
|
'src/api-impl-jni/widgets/android_widget_Button.c',
|
||||||
'src/api-impl-jni/widgets/android_widget_CheckBox.c',
|
'src/api-impl-jni/widgets/android_widget_CheckBox.c',
|
||||||
'src/api-impl-jni/widgets/android_widget_CompoundButton.c',
|
'src/api-impl-jni/widgets/android_widget_CompoundButton.c',
|
||||||
|
|||||||
@@ -1,267 +0,0 @@
|
|||||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
|
||||||
#include <jni.h>
|
|
||||||
/* Header for class android_widget_AbsListView */
|
|
||||||
|
|
||||||
#ifndef _Included_android_widget_AbsListView
|
|
||||||
#define _Included_android_widget_AbsListView
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
#undef android_widget_AbsListView_NO_ID
|
|
||||||
#define android_widget_AbsListView_NO_ID -1L
|
|
||||||
#undef android_widget_AbsListView_NOT_FOCUSABLE
|
|
||||||
#define android_widget_AbsListView_NOT_FOCUSABLE 0L
|
|
||||||
#undef android_widget_AbsListView_FOCUSABLE
|
|
||||||
#define android_widget_AbsListView_FOCUSABLE 1L
|
|
||||||
#undef android_widget_AbsListView_FOCUSABLE_MASK
|
|
||||||
#define android_widget_AbsListView_FOCUSABLE_MASK 1L
|
|
||||||
#undef android_widget_AbsListView_FITS_SYSTEM_WINDOWS
|
|
||||||
#define android_widget_AbsListView_FITS_SYSTEM_WINDOWS 2L
|
|
||||||
#undef android_widget_AbsListView_VISIBLE
|
|
||||||
#define android_widget_AbsListView_VISIBLE 0L
|
|
||||||
#undef android_widget_AbsListView_INVISIBLE
|
|
||||||
#define android_widget_AbsListView_INVISIBLE 4L
|
|
||||||
#undef android_widget_AbsListView_GONE
|
|
||||||
#define android_widget_AbsListView_GONE 8L
|
|
||||||
#undef android_widget_AbsListView_VISIBILITY_MASK
|
|
||||||
#define android_widget_AbsListView_VISIBILITY_MASK 12L
|
|
||||||
#undef android_widget_AbsListView_ENABLED
|
|
||||||
#define android_widget_AbsListView_ENABLED 0L
|
|
||||||
#undef android_widget_AbsListView_DISABLED
|
|
||||||
#define android_widget_AbsListView_DISABLED 32L
|
|
||||||
#undef android_widget_AbsListView_ENABLED_MASK
|
|
||||||
#define android_widget_AbsListView_ENABLED_MASK 32L
|
|
||||||
#undef android_widget_AbsListView_WILL_NOT_DRAW
|
|
||||||
#define android_widget_AbsListView_WILL_NOT_DRAW 128L
|
|
||||||
#undef android_widget_AbsListView_DRAW_MASK
|
|
||||||
#define android_widget_AbsListView_DRAW_MASK 128L
|
|
||||||
#undef android_widget_AbsListView_SCROLLBARS_NONE
|
|
||||||
#define android_widget_AbsListView_SCROLLBARS_NONE 0L
|
|
||||||
#undef android_widget_AbsListView_SCROLLBARS_HORIZONTAL
|
|
||||||
#define android_widget_AbsListView_SCROLLBARS_HORIZONTAL 256L
|
|
||||||
#undef android_widget_AbsListView_SCROLLBARS_VERTICAL
|
|
||||||
#define android_widget_AbsListView_SCROLLBARS_VERTICAL 512L
|
|
||||||
#undef android_widget_AbsListView_SCROLLBARS_MASK
|
|
||||||
#define android_widget_AbsListView_SCROLLBARS_MASK 768L
|
|
||||||
#undef android_widget_AbsListView_FILTER_TOUCHES_WHEN_OBSCURED
|
|
||||||
#define android_widget_AbsListView_FILTER_TOUCHES_WHEN_OBSCURED 1024L
|
|
||||||
#undef android_widget_AbsListView_OPTIONAL_FITS_SYSTEM_WINDOWS
|
|
||||||
#define android_widget_AbsListView_OPTIONAL_FITS_SYSTEM_WINDOWS 2048L
|
|
||||||
#undef android_widget_AbsListView_FADING_EDGE_NONE
|
|
||||||
#define android_widget_AbsListView_FADING_EDGE_NONE 0L
|
|
||||||
#undef android_widget_AbsListView_FADING_EDGE_HORIZONTAL
|
|
||||||
#define android_widget_AbsListView_FADING_EDGE_HORIZONTAL 4096L
|
|
||||||
#undef android_widget_AbsListView_FADING_EDGE_VERTICAL
|
|
||||||
#define android_widget_AbsListView_FADING_EDGE_VERTICAL 8192L
|
|
||||||
#undef android_widget_AbsListView_FADING_EDGE_MASK
|
|
||||||
#define android_widget_AbsListView_FADING_EDGE_MASK 12288L
|
|
||||||
#undef android_widget_AbsListView_CLICKABLE
|
|
||||||
#define android_widget_AbsListView_CLICKABLE 16384L
|
|
||||||
#undef android_widget_AbsListView_DRAWING_CACHE_ENABLED
|
|
||||||
#define android_widget_AbsListView_DRAWING_CACHE_ENABLED 32768L
|
|
||||||
#undef android_widget_AbsListView_SAVE_DISABLED
|
|
||||||
#define android_widget_AbsListView_SAVE_DISABLED 65536L
|
|
||||||
#undef android_widget_AbsListView_SAVE_DISABLED_MASK
|
|
||||||
#define android_widget_AbsListView_SAVE_DISABLED_MASK 65536L
|
|
||||||
#undef android_widget_AbsListView_WILL_NOT_CACHE_DRAWING
|
|
||||||
#define android_widget_AbsListView_WILL_NOT_CACHE_DRAWING 131072L
|
|
||||||
#undef android_widget_AbsListView_FOCUSABLE_IN_TOUCH_MODE
|
|
||||||
#define android_widget_AbsListView_FOCUSABLE_IN_TOUCH_MODE 262144L
|
|
||||||
#undef android_widget_AbsListView_DRAWING_CACHE_QUALITY_LOW
|
|
||||||
#define android_widget_AbsListView_DRAWING_CACHE_QUALITY_LOW 524288L
|
|
||||||
#undef android_widget_AbsListView_DRAWING_CACHE_QUALITY_HIGH
|
|
||||||
#define android_widget_AbsListView_DRAWING_CACHE_QUALITY_HIGH 1048576L
|
|
||||||
#undef android_widget_AbsListView_DRAWING_CACHE_QUALITY_AUTO
|
|
||||||
#define android_widget_AbsListView_DRAWING_CACHE_QUALITY_AUTO 0L
|
|
||||||
#undef android_widget_AbsListView_DRAWING_CACHE_QUALITY_MASK
|
|
||||||
#define android_widget_AbsListView_DRAWING_CACHE_QUALITY_MASK 1572864L
|
|
||||||
#undef android_widget_AbsListView_LONG_CLICKABLE
|
|
||||||
#define android_widget_AbsListView_LONG_CLICKABLE 2097152L
|
|
||||||
#undef android_widget_AbsListView_DUPLICATE_PARENT_STATE
|
|
||||||
#define android_widget_AbsListView_DUPLICATE_PARENT_STATE 4194304L
|
|
||||||
#undef android_widget_AbsListView_SCROLLBARS_INSIDE_OVERLAY
|
|
||||||
#define android_widget_AbsListView_SCROLLBARS_INSIDE_OVERLAY 0L
|
|
||||||
#undef android_widget_AbsListView_SCROLLBARS_INSIDE_INSET
|
|
||||||
#define android_widget_AbsListView_SCROLLBARS_INSIDE_INSET 16777216L
|
|
||||||
#undef android_widget_AbsListView_SCROLLBARS_OUTSIDE_OVERLAY
|
|
||||||
#define android_widget_AbsListView_SCROLLBARS_OUTSIDE_OVERLAY 33554432L
|
|
||||||
#undef android_widget_AbsListView_SCROLLBARS_OUTSIDE_INSET
|
|
||||||
#define android_widget_AbsListView_SCROLLBARS_OUTSIDE_INSET 50331648L
|
|
||||||
#undef android_widget_AbsListView_SCROLLBARS_INSET_MASK
|
|
||||||
#define android_widget_AbsListView_SCROLLBARS_INSET_MASK 16777216L
|
|
||||||
#undef android_widget_AbsListView_SCROLLBARS_OUTSIDE_MASK
|
|
||||||
#define android_widget_AbsListView_SCROLLBARS_OUTSIDE_MASK 33554432L
|
|
||||||
#undef android_widget_AbsListView_SCROLLBARS_STYLE_MASK
|
|
||||||
#define android_widget_AbsListView_SCROLLBARS_STYLE_MASK 50331648L
|
|
||||||
#undef android_widget_AbsListView_KEEP_SCREEN_ON
|
|
||||||
#define android_widget_AbsListView_KEEP_SCREEN_ON 67108864L
|
|
||||||
#undef android_widget_AbsListView_SOUND_EFFECTS_ENABLED
|
|
||||||
#define android_widget_AbsListView_SOUND_EFFECTS_ENABLED 134217728L
|
|
||||||
#undef android_widget_AbsListView_HAPTIC_FEEDBACK_ENABLED
|
|
||||||
#define android_widget_AbsListView_HAPTIC_FEEDBACK_ENABLED 268435456L
|
|
||||||
#undef android_widget_AbsListView_PARENT_SAVE_DISABLED
|
|
||||||
#define android_widget_AbsListView_PARENT_SAVE_DISABLED 536870912L
|
|
||||||
#undef android_widget_AbsListView_PARENT_SAVE_DISABLED_MASK
|
|
||||||
#define android_widget_AbsListView_PARENT_SAVE_DISABLED_MASK 536870912L
|
|
||||||
#undef android_widget_AbsListView_FOCUSABLES_ALL
|
|
||||||
#define android_widget_AbsListView_FOCUSABLES_ALL 0L
|
|
||||||
#undef android_widget_AbsListView_FOCUSABLES_TOUCH_MODE
|
|
||||||
#define android_widget_AbsListView_FOCUSABLES_TOUCH_MODE 1L
|
|
||||||
#undef android_widget_AbsListView_FOCUS_BACKWARD
|
|
||||||
#define android_widget_AbsListView_FOCUS_BACKWARD 1L
|
|
||||||
#undef android_widget_AbsListView_FOCUS_FORWARD
|
|
||||||
#define android_widget_AbsListView_FOCUS_FORWARD 2L
|
|
||||||
#undef android_widget_AbsListView_FOCUS_LEFT
|
|
||||||
#define android_widget_AbsListView_FOCUS_LEFT 17L
|
|
||||||
#undef android_widget_AbsListView_FOCUS_UP
|
|
||||||
#define android_widget_AbsListView_FOCUS_UP 33L
|
|
||||||
#undef android_widget_AbsListView_FOCUS_RIGHT
|
|
||||||
#define android_widget_AbsListView_FOCUS_RIGHT 66L
|
|
||||||
#undef android_widget_AbsListView_FOCUS_DOWN
|
|
||||||
#define android_widget_AbsListView_FOCUS_DOWN 130L
|
|
||||||
#undef android_widget_AbsListView_MEASURED_SIZE_MASK
|
|
||||||
#define android_widget_AbsListView_MEASURED_SIZE_MASK 16777215L
|
|
||||||
#undef android_widget_AbsListView_MEASURED_STATE_MASK
|
|
||||||
#define android_widget_AbsListView_MEASURED_STATE_MASK -16777216L
|
|
||||||
#undef android_widget_AbsListView_MEASURED_HEIGHT_STATE_SHIFT
|
|
||||||
#define android_widget_AbsListView_MEASURED_HEIGHT_STATE_SHIFT 16L
|
|
||||||
#undef android_widget_AbsListView_MEASURED_STATE_TOO_SMALL
|
|
||||||
#define android_widget_AbsListView_MEASURED_STATE_TOO_SMALL 16777216L
|
|
||||||
#undef android_widget_AbsListView_PFLAG2_DRAG_CAN_ACCEPT
|
|
||||||
#define android_widget_AbsListView_PFLAG2_DRAG_CAN_ACCEPT 1L
|
|
||||||
#undef android_widget_AbsListView_PFLAG2_DRAG_HOVERED
|
|
||||||
#define android_widget_AbsListView_PFLAG2_DRAG_HOVERED 2L
|
|
||||||
#undef android_widget_AbsListView_LAYOUT_DIRECTION_LTR
|
|
||||||
#define android_widget_AbsListView_LAYOUT_DIRECTION_LTR 0L
|
|
||||||
#undef android_widget_AbsListView_LAYOUT_DIRECTION_RTL
|
|
||||||
#define android_widget_AbsListView_LAYOUT_DIRECTION_RTL 1L
|
|
||||||
#undef android_widget_AbsListView_LAYOUT_DIRECTION_INHERIT
|
|
||||||
#define android_widget_AbsListView_LAYOUT_DIRECTION_INHERIT 2L
|
|
||||||
#undef android_widget_AbsListView_LAYOUT_DIRECTION_LOCALE
|
|
||||||
#define android_widget_AbsListView_LAYOUT_DIRECTION_LOCALE 3L
|
|
||||||
#undef android_widget_AbsListView_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT
|
|
||||||
#define android_widget_AbsListView_PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT 2L
|
|
||||||
#undef android_widget_AbsListView_PFLAG2_LAYOUT_DIRECTION_MASK
|
|
||||||
#define android_widget_AbsListView_PFLAG2_LAYOUT_DIRECTION_MASK 12L
|
|
||||||
#undef android_widget_AbsListView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL
|
|
||||||
#define android_widget_AbsListView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL 16L
|
|
||||||
#undef android_widget_AbsListView_PFLAG2_LAYOUT_DIRECTION_RESOLVED
|
|
||||||
#define android_widget_AbsListView_PFLAG2_LAYOUT_DIRECTION_RESOLVED 32L
|
|
||||||
#undef android_widget_AbsListView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK
|
|
||||||
#define android_widget_AbsListView_PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK 48L
|
|
||||||
#undef android_widget_AbsListView_STATUS_BAR_HIDDEN
|
|
||||||
#define android_widget_AbsListView_STATUS_BAR_HIDDEN 1L
|
|
||||||
#undef android_widget_AbsListView_STATUS_BAR_VISIBLE
|
|
||||||
#define android_widget_AbsListView_STATUS_BAR_VISIBLE 0L
|
|
||||||
#undef android_widget_AbsListView_SYSTEM_UI_FLAG_FULLSCREEN
|
|
||||||
#define android_widget_AbsListView_SYSTEM_UI_FLAG_FULLSCREEN 4L
|
|
||||||
#undef android_widget_AbsListView_SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
|
||||||
#define android_widget_AbsListView_SYSTEM_UI_FLAG_HIDE_NAVIGATION 2L
|
|
||||||
#undef android_widget_AbsListView_SYSTEM_UI_FLAG_IMMERSIVE
|
|
||||||
#define android_widget_AbsListView_SYSTEM_UI_FLAG_IMMERSIVE 2048L
|
|
||||||
#undef android_widget_AbsListView_SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
|
||||||
#define android_widget_AbsListView_SYSTEM_UI_FLAG_IMMERSIVE_STICKY 4096L
|
|
||||||
#undef android_widget_AbsListView_SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
|
||||||
#define android_widget_AbsListView_SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN 1024L
|
|
||||||
#undef android_widget_AbsListView_SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
|
||||||
#define android_widget_AbsListView_SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION 512L
|
|
||||||
#undef android_widget_AbsListView_SYSTEM_UI_FLAG_LAYOUT_STABLE
|
|
||||||
#define android_widget_AbsListView_SYSTEM_UI_FLAG_LAYOUT_STABLE 256L
|
|
||||||
#undef android_widget_AbsListView_SYSTEM_UI_FLAG_LOW_PROFILE
|
|
||||||
#define android_widget_AbsListView_SYSTEM_UI_FLAG_LOW_PROFILE 1L
|
|
||||||
#undef android_widget_AbsListView_SYSTEM_UI_FLAG_VISIBLE
|
|
||||||
#define android_widget_AbsListView_SYSTEM_UI_FLAG_VISIBLE 0L
|
|
||||||
#undef android_widget_AbsListView_SYSTEM_UI_LAYOUT_FLAGS
|
|
||||||
#define android_widget_AbsListView_SYSTEM_UI_LAYOUT_FLAGS 1536L
|
|
||||||
#undef android_widget_AbsListView_TEXT_ALIGNMENT_CENTER
|
|
||||||
#define android_widget_AbsListView_TEXT_ALIGNMENT_CENTER 4L
|
|
||||||
#undef android_widget_AbsListView_TEXT_ALIGNMENT_GRAVITY
|
|
||||||
#define android_widget_AbsListView_TEXT_ALIGNMENT_GRAVITY 1L
|
|
||||||
#undef android_widget_AbsListView_TEXT_ALIGNMENT_INHERIT
|
|
||||||
#define android_widget_AbsListView_TEXT_ALIGNMENT_INHERIT 0L
|
|
||||||
#undef android_widget_AbsListView_TEXT_ALIGNMENT_TEXT_END
|
|
||||||
#define android_widget_AbsListView_TEXT_ALIGNMENT_TEXT_END 3L
|
|
||||||
#undef android_widget_AbsListView_TEXT_ALIGNMENT_TEXT_START
|
|
||||||
#define android_widget_AbsListView_TEXT_ALIGNMENT_TEXT_START 2L
|
|
||||||
#undef android_widget_AbsListView_TEXT_ALIGNMENT_VIEW_END
|
|
||||||
#define android_widget_AbsListView_TEXT_ALIGNMENT_VIEW_END 6L
|
|
||||||
#undef android_widget_AbsListView_TEXT_ALIGNMENT_VIEW_START
|
|
||||||
#define android_widget_AbsListView_TEXT_ALIGNMENT_VIEW_START 5L
|
|
||||||
#undef android_widget_AbsListView_TEXT_DIRECTION_ANY_RTL
|
|
||||||
#define android_widget_AbsListView_TEXT_DIRECTION_ANY_RTL 2L
|
|
||||||
#undef android_widget_AbsListView_TEXT_DIRECTION_FIRST_STRONG
|
|
||||||
#define android_widget_AbsListView_TEXT_DIRECTION_FIRST_STRONG 1L
|
|
||||||
#undef android_widget_AbsListView_TEXT_DIRECTION_INHERIT
|
|
||||||
#define android_widget_AbsListView_TEXT_DIRECTION_INHERIT 0L
|
|
||||||
#undef android_widget_AbsListView_TEXT_DIRECTION_LOCALE
|
|
||||||
#define android_widget_AbsListView_TEXT_DIRECTION_LOCALE 5L
|
|
||||||
#undef android_widget_AbsListView_TEXT_DIRECTION_LTR
|
|
||||||
#define android_widget_AbsListView_TEXT_DIRECTION_LTR 3L
|
|
||||||
#undef android_widget_AbsListView_TEXT_DIRECTION_RTL
|
|
||||||
#define android_widget_AbsListView_TEXT_DIRECTION_RTL 4L
|
|
||||||
#undef android_widget_AbsListView_ITEM_VIEW_TYPE_IGNORE
|
|
||||||
#define android_widget_AbsListView_ITEM_VIEW_TYPE_IGNORE -1L
|
|
||||||
#undef android_widget_AbsListView_ITEM_VIEW_TYPE_HEADER_OR_FOOTER
|
|
||||||
#define android_widget_AbsListView_ITEM_VIEW_TYPE_HEADER_OR_FOOTER -2L
|
|
||||||
#undef android_widget_AbsListView_SYNC_SELECTED_POSITION
|
|
||||||
#define android_widget_AbsListView_SYNC_SELECTED_POSITION 0L
|
|
||||||
#undef android_widget_AbsListView_SYNC_FIRST_POSITION
|
|
||||||
#define android_widget_AbsListView_SYNC_FIRST_POSITION 1L
|
|
||||||
#undef android_widget_AbsListView_SYNC_MAX_DURATION_MILLIS
|
|
||||||
#define android_widget_AbsListView_SYNC_MAX_DURATION_MILLIS 100L
|
|
||||||
#undef android_widget_AbsListView_INVALID_POSITION
|
|
||||||
#define android_widget_AbsListView_INVALID_POSITION -1L
|
|
||||||
#undef android_widget_AbsListView_INVALID_ROW_ID
|
|
||||||
#define android_widget_AbsListView_INVALID_ROW_ID -9223372036854775808LL
|
|
||||||
/*
|
|
||||||
* Class: android_widget_AbsListView
|
|
||||||
* Method: native_constructor
|
|
||||||
* Signature: (Landroid/content/Context;Landroid/util/AttributeSet;)J
|
|
||||||
*/
|
|
||||||
JNIEXPORT jlong JNICALL Java_android_widget_AbsListView_native_1constructor
|
|
||||||
(JNIEnv *, jobject, jobject, jobject);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Class: android_widget_AbsListView
|
|
||||||
* Method: native_setAdapter
|
|
||||||
* Signature: (JLandroid/widget/ListAdapter;)V
|
|
||||||
*/
|
|
||||||
JNIEXPORT void JNICALL Java_android_widget_AbsListView_native_1setAdapter
|
|
||||||
(JNIEnv *, jobject, jlong, jobject);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Class: android_widget_AbsListView
|
|
||||||
* Method: native_scrollTo
|
|
||||||
* Signature: (JI)V
|
|
||||||
*/
|
|
||||||
JNIEXPORT void JNICALL Java_android_widget_AbsListView_native_1scrollTo
|
|
||||||
(JNIEnv *, jobject, jlong, jint);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Class: android_widget_AbsListView
|
|
||||||
* Method: setItemChecked
|
|
||||||
* Signature: (IZ)V
|
|
||||||
*/
|
|
||||||
JNIEXPORT void JNICALL Java_android_widget_AbsListView_setItemChecked
|
|
||||||
(JNIEnv *, jobject, jint, jboolean);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Class: android_widget_AbsListView
|
|
||||||
* Method: setOnItemClickListener
|
|
||||||
* Signature: (Landroid/widget/AdapterView/OnItemClickListener;)V
|
|
||||||
*/
|
|
||||||
JNIEXPORT void JNICALL Java_android_widget_AbsListView_setOnItemClickListener
|
|
||||||
(JNIEnv *, jobject, jobject);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Class: android_widget_AbsListView
|
|
||||||
* Method: getCheckedItemPosition
|
|
||||||
* Signature: ()I
|
|
||||||
*/
|
|
||||||
JNIEXPORT jint JNICALL Java_android_widget_AbsListView_getCheckedItemPosition
|
|
||||||
(JNIEnv *, jobject);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
@@ -1,182 +0,0 @@
|
|||||||
#include <gtk/gtk.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include "../defines.h"
|
|
||||||
#include "../util.h"
|
|
||||||
|
|
||||||
#include "WrapperWidget.h"
|
|
||||||
#include "AdapterView.h"
|
|
||||||
#include "../views/AndroidLayout.h"
|
|
||||||
|
|
||||||
#include "../generated_headers/android_widget_AbsListView.h"
|
|
||||||
|
|
||||||
static void range_list_model_init(RangeListModel *list_model) {}
|
|
||||||
static void range_list_model_class_init(RangeListModelClass *class) {}
|
|
||||||
|
|
||||||
static guint range_list_model_get_n_items(GListModel *list_model)
|
|
||||||
{
|
|
||||||
return (RANGE_LIST_MODEL(list_model))->n_items;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gpointer range_list_model_get_item(GListModel *list_model, guint index)
|
|
||||||
{
|
|
||||||
if (index >= RANGE_LIST_MODEL(list_model)->n_items)
|
|
||||||
return NULL;
|
|
||||||
RangeListItem *item = g_object_new(range_list_item_get_type(), NULL);
|
|
||||||
item->model = RANGE_LIST_MODEL(list_model);
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void range_list_model_model_init(GListModelInterface *iface)
|
|
||||||
{
|
|
||||||
iface->get_n_items = range_list_model_get_n_items;
|
|
||||||
iface->get_item_type = (GType (*)(GListModel *))range_list_item_get_type;
|
|
||||||
iface->get_item = range_list_model_get_item;
|
|
||||||
}
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE(RangeListModel, range_list_model, G_TYPE_OBJECT,
|
|
||||||
G_IMPLEMENT_INTERFACE(G_TYPE_LIST_MODEL, range_list_model_model_init))
|
|
||||||
|
|
||||||
static void range_list_item_class_init(RangeListItemClass *cls){}
|
|
||||||
static void range_list_item_init(RangeListItem *self){}
|
|
||||||
G_DEFINE_TYPE(RangeListItem, range_list_item, G_TYPE_OBJECT)
|
|
||||||
|
|
||||||
static void on_click(GtkGestureClick *gesture, int n_press, double x, double y, GtkListItem *list_item)
|
|
||||||
{
|
|
||||||
JNIEnv *env = get_jni_env();
|
|
||||||
guint position = gtk_list_item_get_position(list_item);
|
|
||||||
RangeListModel *model = RANGE_LIST_ITEM(gtk_list_item_get_item(list_item))->model;
|
|
||||||
jobject listener = g_object_get_data(G_OBJECT(model->list_view), "on_click_listener");
|
|
||||||
if (!listener)
|
|
||||||
return;
|
|
||||||
WrapperWidget *wrapper = WRAPPER_WIDGET(gtk_list_item_get_child(list_item));
|
|
||||||
|
|
||||||
jmethodID onClick = _METHOD(_CLASS(listener), "onItemClick", "(Landroid/widget/AdapterView;Landroid/view/View;IJ)V");
|
|
||||||
(*env)->CallVoidMethod(env, listener, onClick, model->jobject, wrapper->jobj, position, 0);
|
|
||||||
|
|
||||||
if((*env)->ExceptionCheck(env))
|
|
||||||
(*env)->ExceptionDescribe(env);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void bind_listitem_cb(GtkListItemFactory *factory, GtkListItem *list_item)
|
|
||||||
{
|
|
||||||
JNIEnv *env = get_jni_env();
|
|
||||||
|
|
||||||
guint index = gtk_list_item_get_position(list_item);
|
|
||||||
WrapperWidget *wrapper = WRAPPER_WIDGET(gtk_list_item_get_child(list_item));
|
|
||||||
RangeListModel *model = RANGE_LIST_ITEM(gtk_list_item_get_item(list_item))->model;
|
|
||||||
int n_items = g_list_model_get_n_items(G_LIST_MODEL(model));
|
|
||||||
if (index >= n_items) {
|
|
||||||
printf("invalid index: %d >= %d\n", index, n_items);
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
jmethodID getView = _METHOD(_CLASS(model->adapter), "getView", "(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;");
|
|
||||||
jobject view = (*env)->CallObjectMethod(env, model->adapter, getView, index, wrapper ? wrapper->jobj : NULL, model->jobject);
|
|
||||||
view = _REF(view);
|
|
||||||
GtkWidget *child = GTK_WIDGET(_PTR(_GET_LONG_FIELD(view, "widget")));
|
|
||||||
GtkWidget *child_wrapper = gtk_widget_get_parent(child);
|
|
||||||
jobject layout_params = _GET_OBJ_FIELD(view, "layout_params", "Landroid/view/ViewGroup$LayoutParams;");
|
|
||||||
GtkLayoutManager *layout_manager = gtk_widget_get_layout_manager(child);
|
|
||||||
if (!layout_params && ATL_IS_ANDROID_LAYOUT(layout_manager)) { // use default layout params
|
|
||||||
android_layout_set_params(ATL_ANDROID_LAYOUT(layout_manager), MATCH_PARENT, WRAP_CONTENT);
|
|
||||||
}
|
|
||||||
gtk_list_item_set_child(list_item, child_wrapper);
|
|
||||||
|
|
||||||
GtkEventController *controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
|
|
||||||
gtk_event_controller_set_propagation_phase(controller, GTK_PHASE_BUBBLE);
|
|
||||||
g_signal_connect(controller, "released", G_CALLBACK(on_click), list_item);
|
|
||||||
gtk_widget_add_controller(GTK_WIDGET(child_wrapper), controller);
|
|
||||||
g_object_set_data(G_OBJECT(child_wrapper), "on_item_click_listener", controller);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void unbind_listitem_cb(GtkListItemFactory *factory, GtkListItem *list_item)
|
|
||||||
{
|
|
||||||
GtkWidget *child = gtk_list_item_get_child(list_item);
|
|
||||||
GtkEventController *controller = g_object_get_data(G_OBJECT(child), "on_item_click_listener");
|
|
||||||
gtk_widget_remove_controller(child, controller);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_android_widget_AbsListView_native_1constructor(JNIEnv *env, jobject this, jobject context, jobject attrs)
|
|
||||||
{
|
|
||||||
GtkWidget *wrapper = g_object_ref(wrapper_widget_new());
|
|
||||||
|
|
||||||
GtkListItemFactory *factory = gtk_signal_list_item_factory_new();
|
|
||||||
g_signal_connect(factory, "bind", G_CALLBACK(bind_listitem_cb), NULL);
|
|
||||||
g_signal_connect(factory, "unbind", G_CALLBACK(unbind_listitem_cb), NULL);
|
|
||||||
RangeListModel *model = g_object_new(range_list_model_get_type(), NULL);
|
|
||||||
GtkWidget *list_view = gtk_list_view_new(GTK_SELECTION_MODEL(gtk_single_selection_new(G_LIST_MODEL(model))), factory);
|
|
||||||
model->list_view = list_view;
|
|
||||||
model->jobject = _WEAK_REF(this);
|
|
||||||
GtkWidget *scrolled_window = gtk_scrolled_window_new();
|
|
||||||
gtk_scrolled_window_set_propagate_natural_height(GTK_SCROLLED_WINDOW(scrolled_window), TRUE);
|
|
||||||
gtk_scrolled_window_set_propagate_natural_width(GTK_SCROLLED_WINDOW(scrolled_window), TRUE);
|
|
||||||
gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(scrolled_window), list_view);
|
|
||||||
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), scrolled_window);
|
|
||||||
wrapper_widget_set_jobject(WRAPPER_WIDGET(wrapper), env, this);
|
|
||||||
gtk_widget_set_name(list_view, "ListView");
|
|
||||||
gtk_list_view_set_show_separators(GTK_LIST_VIEW(list_view), TRUE);
|
|
||||||
return _INTPTR(scrolled_window);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_android_widget_AbsListView_native_1setAdapter(JNIEnv *env, jobject this, jlong widget_ptr, jobject adapter)
|
|
||||||
{
|
|
||||||
GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW(_PTR(widget_ptr));
|
|
||||||
GtkListView *list_view = GTK_LIST_VIEW(gtk_scrolled_window_get_child(scrolled_window));
|
|
||||||
RangeListModel *model = RANGE_LIST_MODEL(gtk_single_selection_get_model(GTK_SINGLE_SELECTION(gtk_list_view_get_model(list_view))));
|
|
||||||
|
|
||||||
if (model->adapter)
|
|
||||||
_UNREF(model->adapter);
|
|
||||||
model->adapter = adapter ? _REF(adapter) : NULL;
|
|
||||||
guint old_n_items = model->n_items;
|
|
||||||
model->n_items = adapter ? (*env)->CallIntMethod(env, adapter, _METHOD(_CLASS(adapter), "getCount", "()I")) : 0;
|
|
||||||
g_list_model_items_changed(G_LIST_MODEL(model), 0, old_n_items, model->n_items);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_android_widget_AbsListView_setItemChecked(JNIEnv *env, jobject this, jint position, jboolean checked)
|
|
||||||
{
|
|
||||||
GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW(_PTR(_GET_LONG_FIELD(this, "widget")));
|
|
||||||
GtkListView *list_view = GTK_LIST_VIEW(gtk_scrolled_window_get_child(scrolled_window));
|
|
||||||
GtkSelectionModel *model = gtk_list_view_get_model(list_view);
|
|
||||||
|
|
||||||
if (checked)
|
|
||||||
gtk_selection_model_select_item(model, position, FALSE);
|
|
||||||
else
|
|
||||||
gtk_selection_model_unselect_item(model, position);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void on_activate(GtkListView *list_view, guint position)
|
|
||||||
{
|
|
||||||
JNIEnv *env = get_jni_env();
|
|
||||||
jobject listener = g_object_get_data(G_OBJECT(list_view), "on_click_listener");
|
|
||||||
RangeListModel *model = RANGE_LIST_MODEL(gtk_single_selection_get_model(GTK_SINGLE_SELECTION(gtk_list_view_get_model(list_view))));
|
|
||||||
jmethodID onClick = _METHOD(_CLASS(listener), "onItemClick", "(Landroid/widget/AdapterView;Landroid/view/View;IJ)V");
|
|
||||||
(*env)->CallVoidMethod(env, listener, onClick, model->jobject, NULL, position, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_android_widget_AbsListView_setOnItemClickListener(JNIEnv *env, jobject this, jobject listener)
|
|
||||||
{
|
|
||||||
GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW(_PTR(_GET_LONG_FIELD(this, "widget")));
|
|
||||||
GtkListView *list_view = GTK_LIST_VIEW(gtk_scrolled_window_get_child(scrolled_window));
|
|
||||||
g_object_set_data(G_OBJECT(list_view), "on_click_listener", _REF(listener));
|
|
||||||
|
|
||||||
g_signal_connect(list_view, "activate", G_CALLBACK(on_activate), NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL Java_android_widget_AbsListView_getCheckedItemPosition(JNIEnv *env, jobject this)
|
|
||||||
{
|
|
||||||
GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW(_PTR(_GET_LONG_FIELD(this, "widget")));
|
|
||||||
GtkListView *list_view = GTK_LIST_VIEW(gtk_scrolled_window_get_child(scrolled_window));
|
|
||||||
GtkSingleSelection *single_selection = GTK_SINGLE_SELECTION(gtk_list_view_get_model(list_view));
|
|
||||||
|
|
||||||
return gtk_single_selection_get_selected(single_selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_android_widget_AbsListView_native_1scrollTo(JNIEnv *env, jobject this, jlong widget_ptr, jint position)
|
|
||||||
{
|
|
||||||
GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW(_PTR(widget_ptr));
|
|
||||||
GtkListView *list_view = GTK_LIST_VIEW(gtk_scrolled_window_get_child(scrolled_window));
|
|
||||||
#if GTK_CHECK_VERSION(4, 12, 0)
|
|
||||||
gtk_list_view_scroll_to(list_view, position, GTK_LIST_SCROLL_NONE, NULL);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
@@ -8,6 +8,37 @@
|
|||||||
|
|
||||||
#include "../generated_headers/android_widget_Spinner.h"
|
#include "../generated_headers/android_widget_Spinner.h"
|
||||||
|
|
||||||
|
static void range_list_model_init(RangeListModel *list_model) {}
|
||||||
|
static void range_list_model_class_init(RangeListModelClass *class) {}
|
||||||
|
|
||||||
|
static guint range_list_model_get_n_items(GListModel *list_model)
|
||||||
|
{
|
||||||
|
return (RANGE_LIST_MODEL(list_model))->n_items;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpointer range_list_model_get_item(GListModel *list_model, guint index)
|
||||||
|
{
|
||||||
|
if (index >= RANGE_LIST_MODEL(list_model)->n_items)
|
||||||
|
return NULL;
|
||||||
|
RangeListItem *item = g_object_new(range_list_item_get_type(), NULL);
|
||||||
|
item->model = RANGE_LIST_MODEL(list_model);
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void range_list_model_model_init(GListModelInterface *iface)
|
||||||
|
{
|
||||||
|
iface->get_n_items = range_list_model_get_n_items;
|
||||||
|
iface->get_item_type = (GType (*)(GListModel *))range_list_item_get_type;
|
||||||
|
iface->get_item = range_list_model_get_item;
|
||||||
|
}
|
||||||
|
|
||||||
|
G_DEFINE_TYPE_WITH_CODE(RangeListModel, range_list_model, G_TYPE_OBJECT,
|
||||||
|
G_IMPLEMENT_INTERFACE(G_TYPE_LIST_MODEL, range_list_model_model_init))
|
||||||
|
|
||||||
|
static void range_list_item_class_init(RangeListItemClass *cls){}
|
||||||
|
static void range_list_item_init(RangeListItem *self){}
|
||||||
|
G_DEFINE_TYPE(RangeListItem, range_list_item, G_TYPE_OBJECT)
|
||||||
|
|
||||||
static void bind_listitem_cb(GtkListItemFactory *factory, GtkListItem *list_item)
|
static void bind_listitem_cb(GtkListItemFactory *factory, GtkListItem *list_item)
|
||||||
{
|
{
|
||||||
JNIEnv *env = get_jni_env();
|
JNIEnv *env = get_jni_env();
|
||||||
|
|||||||
@@ -466,6 +466,10 @@ public class Canvas {
|
|||||||
|
|
||||||
public void drawColor(int color, PorterDuff.Mode mode) {}
|
public void drawColor(int color, PorterDuff.Mode mode) {}
|
||||||
|
|
||||||
|
public boolean clipRect(Rect rect) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private static native long native_canvas_from_bitmap(long pixbuf);
|
private static native long native_canvas_from_bitmap(long pixbuf);
|
||||||
|
|
||||||
private static native void native_save(long skia_canvas, long widget);
|
private static native void native_save(long skia_canvas, long widget);
|
||||||
|
|||||||
@@ -997,12 +997,16 @@ public class View implements Drawable.Callback {
|
|||||||
if (canvas instanceof GskCanvas)
|
if (canvas instanceof GskCanvas)
|
||||||
native_drawContent(widget, ((GskCanvas)canvas).snapshot);
|
native_drawContent(widget, ((GskCanvas)canvas).snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void dispatchDraw(Canvas canvas) {
|
||||||
|
if (canvas instanceof GskCanvas)
|
||||||
|
native_drawChildren(widget, ((GskCanvas)canvas).snapshot);
|
||||||
|
}
|
||||||
public void draw(Canvas canvas) {
|
public void draw(Canvas canvas) {
|
||||||
if (canvas instanceof GskCanvas)
|
if (canvas instanceof GskCanvas)
|
||||||
native_drawBackground(widget, ((GskCanvas)canvas).snapshot);
|
native_drawBackground(widget, ((GskCanvas)canvas).snapshot);
|
||||||
onDraw(canvas);
|
onDraw(canvas);
|
||||||
if (canvas instanceof GskCanvas)
|
dispatchDraw(canvas);
|
||||||
native_drawChildren(widget, ((GskCanvas)canvas).snapshot);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public View(Context context) {
|
public View(Context context) {
|
||||||
@@ -1429,6 +1433,8 @@ public class View implements Drawable.Callback {
|
|||||||
boolean changed = oldWidth != width || oldHeight != height;
|
boolean changed = oldWidth != width || oldHeight != height;
|
||||||
if (changed)
|
if (changed)
|
||||||
onSizeChanged(width, height, oldWidth, oldHeight);
|
onSizeChanged(width, height, oldWidth, oldHeight);
|
||||||
|
bottom = top + height;
|
||||||
|
right = left + width;
|
||||||
onLayout(changed, 0, 0, width, height);
|
onLayout(changed, 0, 0, width, height);
|
||||||
oldWidth = width;
|
oldWidth = width;
|
||||||
oldHeight = height;
|
oldHeight = height;
|
||||||
@@ -1841,6 +1847,9 @@ public class View implements Drawable.Callback {
|
|||||||
protected void onDetachedFromWindow() {
|
protected void onDetachedFromWindow() {
|
||||||
attachedToWindow = false;
|
attachedToWindow = false;
|
||||||
}
|
}
|
||||||
|
public void attachToWindowInternal() {
|
||||||
|
onAttachedToWindow();
|
||||||
|
}
|
||||||
|
|
||||||
public void setLayerType(int layerType, Paint paint) {}
|
public void setLayerType(int layerType, Paint paint) {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package android.view.animation;
|
package android.view.animation;
|
||||||
|
|
||||||
import android.animation.TimeInterpolator;
|
public class LinearInterpolator implements Interpolator {
|
||||||
|
|
||||||
public class LinearInterpolator implements TimeInterpolator {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getInterpolation(float input) {
|
public float getInterpolation(float input) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,5 @@
|
|||||||
package android.widget;
|
package android.widget;
|
||||||
|
|
||||||
public interface Filterable {}
|
public interface Filterable {
|
||||||
|
public Filter getFilter();
|
||||||
|
}
|
||||||
|
|||||||
@@ -228,4 +228,40 @@ public class HeaderViewListAdapter implements ListAdapter, Filterable {
|
|||||||
public ListAdapter getWrappedAdapter() {
|
public ListAdapter getWrappedAdapter() {
|
||||||
return mAdapter;
|
return mAdapter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Filter getFilter() {
|
||||||
|
if (mAdapter instanceof Filterable) {
|
||||||
|
return ((Filterable) mAdapter).getFilter();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEnabled(int position) {
|
||||||
|
// Header (negative positions will throw an IndexOutOfBoundsException)
|
||||||
|
int numHeaders = getHeadersCount();
|
||||||
|
if (position < numHeaders) {
|
||||||
|
return mHeaderViewInfos.get(position).isSelectable;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adapter
|
||||||
|
final int adjPosition = position - numHeaders;
|
||||||
|
int adapterCount = 0;
|
||||||
|
if (mAdapter != null) {
|
||||||
|
adapterCount = mAdapter.getCount();
|
||||||
|
if (adjPosition < adapterCount) {
|
||||||
|
return mAdapter.isEnabled(adjPosition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Footer (off-limits positions will throw an IndexOutOfBoundsException)
|
||||||
|
return mFooterViewInfos.get(adjPosition - adapterCount).isSelectable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean areAllItemsEnabled() {
|
||||||
|
if (mAdapter != null) {
|
||||||
|
return mAreAllFixedViewsSelectable && mAdapter.areAllItemsEnabled();
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
package android.widget;
|
package android.widget;
|
||||||
|
|
||||||
public interface ListAdapter extends Adapter {
|
public interface ListAdapter extends Adapter {
|
||||||
|
|
||||||
|
public boolean isEnabled(int position);
|
||||||
|
|
||||||
|
public boolean areAllItemsEnabled();
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -58,6 +58,7 @@ public class PopupWindow {
|
|||||||
|
|
||||||
public void setContentView(View view) {
|
public void setContentView(View view) {
|
||||||
contentView = view;
|
contentView = view;
|
||||||
|
contentView.attachToWindowInternal();
|
||||||
native_setContentView(popover, view.widget);
|
native_setContentView(popover, view.widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user