add support for ViewGroups with custom onLayout()

A custom GtkLayoutManager is set to these objects, which calls into the
java handlers when measure or layout is requested.

Androids onMeasure method is quite different from GTKs measure method,
because Android already defines the final size during onMeasure.
Therefore, we call onMeasure from GTKs allocate callback instead of the
measure callback.
This commit is contained in:
Julian Winkler
2023-08-22 14:18:33 +02:00
parent 4434de4a58
commit ca975a0e7c
8 changed files with 268 additions and 11 deletions

View File

@@ -263,6 +263,30 @@ JNIEXPORT void JNICALL Java_android_view_View_native_1set_1size_1request
JNIEXPORT void JNICALL Java_android_view_View_native_1destructor
(JNIEnv *, jobject, jlong);
/*
* Class: android_view_View
* Method: native_measure
* Signature: (JII)V
*/
JNIEXPORT void JNICALL Java_android_view_View_native_1measure
(JNIEnv *, jobject, jlong, jint, jint);
/*
* Class: android_view_View
* Method: native_layout
* Signature: (JIIII)V
*/
JNIEXPORT void JNICALL Java_android_view_View_native_1layout
(JNIEnv *, jobject, jlong, jint, jint, jint, jint);
/*
* Class: android_view_View
* Method: native_requestLayout
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_android_view_View_native_1requestLayout
(JNIEnv *, jobject, jlong);
/*
* Class: android_view_View
* Method: nativeInvalidate