You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
add AssetManager.getArrayIntResource and Context.getString
This commit is contained in:
@@ -345,14 +345,6 @@ JNIEXPORT jobjectArray JNICALL Java_android_content_res_AssetManager_getArrayStr
|
||||
JNIEXPORT jintArray JNICALL Java_android_content_res_AssetManager_getArrayStringInfo
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: android_content_res_AssetManager
|
||||
* Method: getArrayIntResource
|
||||
* Signature: (I)[I
|
||||
*/
|
||||
JNIEXPORT jintArray JNICALL Java_android_content_res_AssetManager_getArrayIntResource
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: android_content_res_AssetManager
|
||||
* Method: destroy
|
||||
|
||||
@@ -167,6 +167,10 @@ public class Context extends Object {
|
||||
return r.getString(resId);
|
||||
}
|
||||
|
||||
public final String getString (int resId, Object... formatArgs) {
|
||||
return r.getString(resId, formatArgs);
|
||||
}
|
||||
|
||||
public PackageManager getPackageManager() {
|
||||
return new PackageManager();
|
||||
}
|
||||
|
||||
@@ -822,7 +822,14 @@ public final class AssetManager {
|
||||
|
||||
private native final String[] getArrayStringResource(int arrayRes);
|
||||
private native final int[] getArrayStringInfo(int arrayRes);
|
||||
/*package*/ native final int[] getArrayIntResource(int arrayRes);
|
||||
/*package*/ final int[] getArrayIntResource(int arrayRes) {
|
||||
ResValueMap children[] = tableBlock.search(arrayRes).pickOne().getResValueMapArray().getChildes();
|
||||
int values[] = new int[children.length];
|
||||
for (int i = 0; i < children.length; i++) {
|
||||
values[i] = children[i].getData();
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
private /* native */ final void init() {}
|
||||
private native final void destroy();
|
||||
|
||||
Reference in New Issue
Block a user