add scrollbar, improve presets, other small fixes
This commit is contained in:
@@ -269,6 +269,7 @@ JNIEXPORT void JNICALL Java_com_omixlab_panopainter_MainActivity_pickExternalCal
|
||||
|
||||
LOG("data_path %s", file_path.c_str());
|
||||
App::I.data_path = file_path;
|
||||
App::I.work_path = file_path;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,22 +33,22 @@ public class MainActivity extends NativeActivity {
|
||||
|
||||
public void setRootPath()
|
||||
{
|
||||
Log.v("MainActivity", "permission granted");
|
||||
Log.v("PanoPainterJava", "permission granted");
|
||||
File d = Environment.getExternalStorageDirectory();
|
||||
File pano_dir = new File(d, "PanoPainter");
|
||||
|
||||
if (!pano_dir.exists())
|
||||
{
|
||||
if (pano_dir.mkdirs())
|
||||
Log.v("MainActivity", "create path " + pano_dir.getAbsolutePath());
|
||||
Log.v("PanoPainterJava", "create path " + pano_dir.getAbsolutePath());
|
||||
else
|
||||
Log.v("MainActivity", "create path failed");
|
||||
Log.v("PanoPainterJava", "create path failed");
|
||||
|
||||
}
|
||||
pickExternalCallback(pano_dir.getAbsolutePath());
|
||||
}
|
||||
public void checkPermissionReadStorage(){
|
||||
Log.v("MainActivity", "permission checking");
|
||||
Log.v("PanoPainterJava", "permission checking");
|
||||
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.M) {
|
||||
setRootPath();
|
||||
} else {
|
||||
@@ -68,14 +68,14 @@ public class MainActivity extends NativeActivity {
|
||||
// No explanation needed, we can request the permission.
|
||||
|
||||
requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
|
||||
Log.v("MainActivity", "permission request");
|
||||
Log.v("PanoPainterJava", "permission request");
|
||||
|
||||
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
|
||||
// app-defined int constant. The callback method gets the
|
||||
// result of the request.
|
||||
// }
|
||||
} else {
|
||||
Log.v("MainActivity", "permission already granted");
|
||||
Log.v("PanoPainterJava", "permission already granted");
|
||||
setRootPath();
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ public class MainActivity extends NativeActivity {
|
||||
// contacts-related task you need to do.
|
||||
setRootPath();
|
||||
} else {
|
||||
Log.v("MainActivity", "permission denied");
|
||||
Log.v("PanoPainterJava", "permission denied");
|
||||
|
||||
// permission denied, boo! Disable the
|
||||
// functionality that depends on this permission.
|
||||
@@ -123,7 +123,7 @@ public class MainActivity extends NativeActivity {
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("*/*");
|
||||
startActivityForResult(Intent.createChooser(intent, "Select a file"), 1);
|
||||
Log.v("PICK", "start");
|
||||
Log.v("PanoPainterJava", "pick start");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -136,7 +136,7 @@ public class MainActivity extends NativeActivity {
|
||||
String path = null;
|
||||
try {
|
||||
path = PathUtil.getPath(this, uri);
|
||||
Log.v("PICK", "selected " + path);
|
||||
Log.v("PanoPainterJava", "pick selected " + path);
|
||||
pickFileCallback(path);
|
||||
} catch (URISyntaxException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user