copy android.widget.Scroller from AOSP and implement missing scroll APIs

This is needed to make ViewPager functional
This commit is contained in:
Julian Winkler
2023-09-01 12:13:24 +02:00
parent eac22aaa64
commit fb1a07967e
8 changed files with 614 additions and 17 deletions

View File

@@ -45,7 +45,13 @@ static void android_layout_allocate(GtkLayoutManager *layout_manager, GtkWidget
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
(*env)->CallVoidMethod(env, layout->view, handle_cache.view.onLayout, TRUE, 0, 0, width, height);
(*env)->CallVoidMethod(env, layout->view, handle_cache.view.computeScroll);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
int scroll_x = (*env)->CallIntMethod(env, layout->view, handle_cache.view.getScrollX);
int scroll_y = (*env)->CallIntMethod(env, layout->view, handle_cache.view.getScrollY);
(*env)->CallVoidMethod(env, layout->view, handle_cache.view.onLayout, TRUE, scroll_x, scroll_y, width, height);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
}