Mercurial > dwindows
comparison 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 |
comparison
equal
deleted
inserted
replaced
2718:2987bf90c7c9 | 2719:6754e8f70142 |
---|---|
1983 * Returns: | 1983 * Returns: |
1984 * A handle to a scrollbar window or nullptr on failure. | 1984 * A handle to a scrollbar window or nullptr on failure. |
1985 */ | 1985 */ |
1986 HWND API dw_scrollbar_new(int vertical, ULONG cid) | 1986 HWND API dw_scrollbar_new(int vertical, ULONG cid) |
1987 { | 1987 { |
1988 return dw_slider_new(vertical, 100, cid); | 1988 JNIEnv *env; |
1989 | |
1990 if((env = (JNIEnv *)pthread_getspecific(_dw_env_key))) | |
1991 { | |
1992 // First get the class that contains the method you need to call | |
1993 jclass clazz = _dw_find_class(env, DW_CLASS_NAME); | |
1994 // Get the method that you want to call | |
1995 jmethodID scrollBarNew = env->GetMethodID(clazz, "scrollBarNew", "(II)Landroid/widget/SeekBar;"); | |
1996 // Call the method on the object | |
1997 jobject result = _dw_jni_check_result(env, env->CallObjectMethod(_dw_obj, scrollBarNew, vertical, (jint)cid), _DW_REFERENCE_WEAK); | |
1998 return result; | |
1999 } | |
2000 return nullptr; | |
1989 } | 2001 } |
1990 | 2002 |
1991 /* | 2003 /* |
1992 * Returns the position of the scrollbar. | 2004 * Returns the position of the scrollbar. |
1993 * Parameters: | 2005 * Parameters: |