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
View: relayout on visibility changes
This commit is contained in:
@@ -297,11 +297,11 @@ JNIEXPORT void JNICALL Java_android_view_View_setBackgroundColor
|
||||
|
||||
/*
|
||||
* Class: android_view_View
|
||||
* Method: setVisibility
|
||||
* Signature: (I)V
|
||||
* Method: native_setVisibility
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_android_view_View_setVisibility
|
||||
(JNIEnv *, jobject, jint);
|
||||
JNIEXPORT void JNICALL Java_android_view_View_native_1setVisibility
|
||||
(JNIEnv *, jobject, jlong, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -239,8 +239,8 @@ JNIEXPORT void JNICALL Java_android_view_View_native_1setLayoutParams(JNIEnv *en
|
||||
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) {
|
||||
GtkWidget *widget = gtk_widget_get_parent(GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget"))));
|
||||
JNIEXPORT void JNICALL Java_android_view_View_native_1setVisibility(JNIEnv *env, jobject this, jlong widget_ptr, jint visibility) {
|
||||
GtkWidget *widget = gtk_widget_get_parent(GTK_WIDGET(_PTR(widget_ptr)));
|
||||
|
||||
switch (visibility) {
|
||||
case android_view_View_VISIBLE:
|
||||
|
||||
@@ -984,7 +984,11 @@ public class View extends Object {
|
||||
private static native void nativeInvalidate(long widget);
|
||||
|
||||
public native void setBackgroundColor(int color);
|
||||
public native void setVisibility(int visibility);
|
||||
public native void native_setVisibility(long widget, int visibility);
|
||||
public void setVisibility(int visibility) {
|
||||
native_setVisibility(widget, visibility);
|
||||
requestLayout();
|
||||
}
|
||||
public void setPadding(int left, int top, int right, int bottom) {}
|
||||
public void setBackgroundResource(int resid) {
|
||||
// Slog.w(TAG, "*** setBackgroundResource: " + getString(resid));
|
||||
|
||||
Reference in New Issue
Block a user