diff --git a/src/api-impl-jni/views/android_view_View.c b/src/api-impl-jni/views/android_view_View.c index 412ea602..7621a849 100644 --- a/src/api-impl-jni/views/android_view_View.c +++ b/src/api-impl-jni/views/android_view_View.c @@ -360,6 +360,7 @@ JNIEXPORT jlong JNICALL Java_android_view_View_native_1constructor(JNIEnv *env, { GtkWidget *wrapper = g_object_ref(wrapper_widget_new()); GtkWidget *widget = g_object_new(java_widget_get_type(), NULL); + gtk_widget_set_layout_manager(widget, android_layout_new(_REF(this))); wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), widget); wrapper_widget_set_jobject(WRAPPER_WIDGET(wrapper), env, this); @@ -373,12 +374,6 @@ JNIEXPORT jlong JNICALL Java_android_view_View_native_1constructor(JNIEnv *env, /* this should better match default android behavior */ gtk_widget_set_overflow(wrapper, GTK_OVERFLOW_VISIBLE); - jmethodID measure_method = _METHOD(class, "onMeasure", "(II)V"); - jmethodID layout_method = _METHOD(class, "onLayout", "(ZIIII)V"); - if (measure_method != handle_cache.view.onMeasure || layout_method != handle_cache.view.onLayout) { - gtk_widget_set_layout_manager(widget, android_layout_new(_REF(this))); - } - if (_METHOD(_CLASS(this), "onGenericMotionEvent", "(Landroid/view/MotionEvent;)Z") != handle_cache.view.onGenericMotionEvent) { GtkEventController *controller = gtk_event_controller_scroll_new(GTK_EVENT_CONTROLLER_SCROLL_VERTICAL); diff --git a/src/api-impl/android/view/ViewStub.java b/src/api-impl/android/view/ViewStub.java index 626ae197..b7c640aa 100644 --- a/src/api-impl/android/view/ViewStub.java +++ b/src/api-impl/android/view/ViewStub.java @@ -10,12 +10,10 @@ public class ViewStub extends View { public ViewStub(Context context) { this(context, null, 0); - haveCustomMeasure = false; } public ViewStub(Context context, AttributeSet attributeSet) { this(context, attributeSet, 0); - haveCustomMeasure = false; } public ViewStub(Context context, AttributeSet attributeSet, int defStyle) { diff --git a/src/api-impl/android/widget/Space.java b/src/api-impl/android/widget/Space.java index 5c76becb..bfd66e91 100644 --- a/src/api-impl/android/widget/Space.java +++ b/src/api-impl/android/widget/Space.java @@ -8,12 +8,10 @@ public class Space extends View { public Space(Context context) { super(context); - haveCustomMeasure = false; } public Space(Context context, AttributeSet attributeSet) { super(context, attributeSet); - haveCustomMeasure = false; } } \ No newline at end of file