[android] jni high level binding refactor
This commit is contained in:
committed by
Ivo van Dongen
parent
7d9018093a
commit
465c949153
20
platform/android/src/graphics/pointf.cpp
Normal file
20
platform/android/src/graphics/pointf.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "pointf.hpp"
|
||||
|
||||
namespace mbgl {
|
||||
namespace android {
|
||||
|
||||
jni::Object<PointF> PointF::New(jni::JNIEnv& env, float x, float y) {
|
||||
static auto constructor = PointF::javaClass.GetConstructor<float, float>(env);
|
||||
return PointF::javaClass.New(env, constructor, x, y);
|
||||
}
|
||||
|
||||
void PointF::registerNative(jni::JNIEnv& env) {
|
||||
// Lookup the class
|
||||
PointF::javaClass = *jni::Class<PointF>::Find(env).NewGlobalRef(env).release();
|
||||
}
|
||||
|
||||
jni::Class<PointF> PointF::javaClass;
|
||||
|
||||
|
||||
} // namespace android
|
||||
} // namespace mbgl
|
||||
Reference in New Issue
Block a user