Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit e22797b

Browse files
committed
Cherry picking fix for NestedScrollingEnabled
from: c1cc08e
1 parent 26bc741 commit e22797b

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

support-core-ui/source/Additions/Additions.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,37 @@ public unsafe void SetEnabled (bool enabled)
4242

4343
}
4444
}
45+
46+
47+
private static IntPtr id_isNestedScrollingEnabled = IntPtr.Zero;
48+
private static IntPtr id_setNestedScrollingEnabled = IntPtr.Zero;
49+
50+
public unsafe virtual bool NestedScrollingEnabled {
51+
[Register("isNestedScrollingEnabled", "()Z", "GetIsNestedScrollingEnabledHandler")]
52+
get {
53+
if (id_isNestedScrollingEnabled == IntPtr.Zero) {
54+
id_isNestedScrollingEnabled = JNIEnv.GetMethodID(class_ref, "isNestedScrollingEnabled", "()Z");
55+
}
56+
if (base.GetType() == ThresholdType) {
57+
return JNIEnv.CallBooleanMethod(base.Handle, id_isNestedScrollingEnabled);
58+
}
59+
return JNIEnv.CallNonvirtualBooleanMethod(base.Handle, ThresholdClass, JNIEnv.GetMethodID(ThresholdClass, "isNestedScrollingEnabled", "()Z"));
60+
}
61+
62+
[Register("setNestedScrollingEnabled", "(Z)V", "GetSetNestedScrollingEnabledHandler")]
63+
set {
64+
if (id_setNestedScrollingEnabled == IntPtr.Zero) {
65+
id_setNestedScrollingEnabled = JNIEnv.GetMethodID(class_ref, "setNestedScrollingEnabled", "(Z)V");
66+
}
67+
JValue* ptr = stackalloc JValue[1];
68+
*ptr = new JValue(value);
69+
if (base.GetType() == ThresholdType) {
70+
JNIEnv.CallVoidMethod(base.Handle, id_setNestedScrollingEnabled, ptr);
71+
return;
72+
}
73+
JNIEnv.CallNonvirtualVoidMethod(base.Handle, ThresholdClass, JNIEnv.GetMethodID(ThresholdClass, "setNestedScrollingEnabled", "(Z)V"), ptr);
74+
}
75+
}
4576
}
4677
}
4778

0 commit comments

Comments
 (0)