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
get rid of launcher script requirement; fix app data dir being hardcoded; update documentation; remove prebuilt dalvik (NOTE - purged from history at this point, so is not part of the diff)
This commit is contained in:
@@ -112,7 +112,7 @@ public class Activity extends Context {
|
||||
public void setContentView(int layoutResID) throws Exception {
|
||||
System.out.println("- setContentView - yay!");
|
||||
|
||||
String layout_xml_file = "data/" + getString(layoutResID);
|
||||
String layout_xml_file = android.os.Environment.getExternalStorageDirectory().getPath() + "/" + getString(layoutResID);
|
||||
|
||||
System.out.println("loading layout from: " + layout_xml_file);
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ public class Context extends Object {
|
||||
|
||||
private File getDataDirFile() {
|
||||
if(data_dir == null) {
|
||||
data_dir = new File("data/");
|
||||
data_dir = android.os.Environment.getExternalStorageDirectory();
|
||||
}
|
||||
return data_dir;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ public class Context extends Object {
|
||||
|
||||
public FileOutputStream openFileOutput(String name, int mode) throws java.io.FileNotFoundException {
|
||||
System.out.println("openFileOutput called for: '"+name+"'");
|
||||
return new FileOutputStream("data/files/" + name);
|
||||
return new FileOutputStream(android.os.Environment.getExternalStorageDirectory().getPath() + "/files/" + name);
|
||||
}
|
||||
|
||||
public int checkCallingOrSelfPermission(String permission) {
|
||||
|
||||
@@ -467,7 +467,7 @@ public final class AssetManager {
|
||||
factory.setNamespaceAware(true);
|
||||
XmlPullParser xpp = factory.newPullParser();
|
||||
|
||||
xpp.setInput( new FileReader("data/" + fileName) );
|
||||
xpp.setInput( new FileReader(android.os.Environment.getExternalStorageDirectory().getPath() + "/" + fileName) );
|
||||
|
||||
return (XmlResourceParser)xpp;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public final class Bitmap {
|
||||
} // FIXME
|
||||
|
||||
Bitmap(String path) {
|
||||
pixbuf = native_bitmap_from_path("data/"+path);
|
||||
pixbuf = native_bitmap_from_path(android.os.Environment.getExternalStorageDirectory().getPath() + "/" + path);
|
||||
|
||||
mIsMutable = false;
|
||||
mIsPremultiplied = false;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -91,7 +91,7 @@ public class LayoutInflater {
|
||||
|
||||
public View inflate(int layoutResID, ViewGroup root, boolean attachToRoot) throws Exception {
|
||||
|
||||
String layout_xml_file = "data/" + Context.this_application.getString(layoutResID);
|
||||
String layout_xml_file = android.os.Environment.getExternalStorageDirectory().getPath() + "/" + Context.this_application.getString(layoutResID);
|
||||
|
||||
System.out.println("loading layout from: " + layout_xml_file);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user