handle overwritten onDraw function in WrapperWidget

This makes it easy to support for example ImageView with custom
onDraw function
This commit is contained in:
Julian Winkler
2023-07-14 17:53:12 +02:00
parent 22dcaf45e8
commit def91a688d
7 changed files with 80 additions and 48 deletions

View File

@@ -104,6 +104,8 @@ void set_up_handle_cache(JNIEnv *env, char *apk_main_activity_class)
handle_cache.view.setLayoutParams = _METHOD(handle_cache.view.class, "setLayoutParams", "(Landroid/view/ViewGroup$LayoutParams;)V");
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
handle_cache.view.onDraw = _METHOD(handle_cache.view.class, "onDraw", "(Landroid/graphics/Canvas;)V");
handle_cache.view.onMeasure = _METHOD(handle_cache.view.class, "onMeasure", "(II)V");
handle_cache.asset_manager.class = _REF((*env)->FindClass(env, "android/content/res/AssetManager"));
handle_cache.asset_manager.extractFromAPK = _STATIC_METHOD(handle_cache.asset_manager.class, "extractFromAPK", "(Ljava/lang/String;Ljava/lang/String;)V");