use of android.annotation.AttrRes in project robolectric by robolectric.
the class ShadowArscAssetManager9 method nativeGetStyleAttributes.
// static jintArray NativeGetStyleAttributes(JNIEnv* env, jclass /*clazz*/, jlong ptr, jint resid)
// {
@Implementation(minSdk = P)
@Nullable
@AttrRes
protected static int[] nativeGetStyleAttributes(long ptr, @StyleRes int resid) {
CppAssetManager2 assetmanager = AssetManagerFromLong(ptr);
ResolvedBag bag = assetmanager.GetBag(resid);
if (bag == null) {
return null;
}
int[] array = new int[bag.entry_count];
for (int i = 0; i < bag.entry_count; i++) {
int attr_resid = bag.entries[i].key;
// env.SetIntArrayRegion(array, i, 1, &attr_resid);
array[i] = attr_resid;
}
return array;
}
use of android.annotation.AttrRes in project robolectric by robolectric.
the class ShadowArscAssetManager10 method nativeGetStyleAttributes.
// static jintArray NativeGetStyleAttributes(JNIEnv* env, jclass /*clazz*/, jlong ptr, jint resid)
// {
@Implementation(minSdk = P)
@Nullable
@AttrRes
protected static int[] nativeGetStyleAttributes(long ptr, @StyleRes int resid) {
CppAssetManager2 assetmanager = AssetManagerFromLong(ptr);
ResolvedBag bag = assetmanager.GetBag(resid);
if (bag == null) {
return null;
}
int[] array = new int[bag.entry_count];
for (int i = 0; i < bag.entry_count; i++) {
int attr_resid = bag.entries[i].key;
// env.SetIntArrayRegion(array, i, 1, &attr_resid);
array[i] = attr_resid;
}
return array;
}
Aggregations