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
android_layout_measure(): refactor to respect LayoutParams
This is needed when a Java widget gets measured from GTK
This commit is contained in:
committed by
Julian Winkler
parent
8b6de0e83a
commit
3c03223085
@@ -4,6 +4,7 @@
|
||||
#include "../util.h"
|
||||
|
||||
#include "../widgets/WrapperWidget.h"
|
||||
#include "../views/AndroidLayout.h"
|
||||
|
||||
#include "../generated_headers/android_view_View.h"
|
||||
|
||||
@@ -236,6 +237,10 @@ JNIEXPORT void JNICALL Java_android_view_View_native_1setLayoutParams(JNIEnv *en
|
||||
g_object_set(G_OBJECT(widget), "width-request", width, NULL);
|
||||
if(height > 0)
|
||||
g_object_set(G_OBJECT(widget), "height-request", height, NULL);
|
||||
|
||||
GtkLayoutManager *layout_manager = gtk_widget_get_layout_manager(WRAPPER_WIDGET(widget)->child);
|
||||
if (ATL_IS_ANDROID_LAYOUT(layout_manager))
|
||||
android_layout_set_params(ATL_ANDROID_LAYOUT(layout_manager), width, height);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_android_view_View_setVisibility(JNIEnv *env, jobject this, jint visibility) {
|
||||
|
||||
Reference in New Issue
Block a user