diff android/dw.cpp @ 2719:6754e8f70142

Android: Split out scrollbar to a separate implementation. Scrollbar and Sliders are essentially the same, just visually different. Hide the track like we did on iOS using progress(Background)TintList. Both were rotated too far and were actually upside down.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 08 Dec 2021 12:54:25 +0000
parents e9ad53d2271b
children 9ce1649b0fbd
line wrap: on
line diff
--- a/android/dw.cpp	Wed Dec 08 11:36:31 2021 +0000
+++ b/android/dw.cpp	Wed Dec 08 12:54:25 2021 +0000
@@ -1985,7 +1985,19 @@
  */
 HWND API dw_scrollbar_new(int vertical, ULONG cid)
 {
-    return dw_slider_new(vertical, 100, cid);
+    JNIEnv *env;
+
+    if((env = (JNIEnv *)pthread_getspecific(_dw_env_key)))
+    {
+        // First get the class that contains the method you need to call
+        jclass clazz = _dw_find_class(env, DW_CLASS_NAME);
+        // Get the method that you want to call
+        jmethodID scrollBarNew = env->GetMethodID(clazz, "scrollBarNew", "(II)Landroid/widget/SeekBar;");
+        // Call the method on the object
+        jobject result = _dw_jni_check_result(env, env->CallObjectMethod(_dw_obj, scrollBarNew, vertical, (jint)cid), _DW_REFERENCE_WEAK);
+        return result;
+    }
+    return nullptr;
 }
 
 /*