platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java in rhodes-2.0.3 vs platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java in rhodes-2.1.0

- old
+ new

@@ -24,25 +24,25 @@ import android.content.Intent; import com.rhomobile.rhodes.Capabilities; import com.rhomobile.rhodes.Logger; -import com.rhomobile.rhodes.Rhodes; -import com.rhomobile.rhodes.RhodesInstance; +import com.rhomobile.rhodes.RhodesService; +import com.rhomobile.rhodes.util.PerformOnUiThread; public class Camera { private static final String TAG = "Camera"; - public static final String INTENT_EXTRA_PREFIX = Rhodes.INTENT_EXTRA_PREFIX + "camera."; + public static final String INTENT_EXTRA_PREFIX = RhodesService.INTENT_EXTRA_PREFIX + "camera."; private static void reportFail(String name, Exception e) { Logger.E(TAG, "Call of \"" + name + "\" failed: " + e.getMessage()); } private static void init() { - File f = new File(Rhodes.getBlobPath()); + File f = new File(RhodesService.getBlobPath()); if (!f.exists()) f.mkdirs(); } private static class CameraDisabled implements Runnable { @@ -68,30 +68,30 @@ klass = c; } public void run() { init(); - Rhodes r = RhodesInstance.getInstance(); - Intent intent = new Intent(r, klass); + RhodesService r = RhodesService.getInstance(); + Intent intent = new Intent(r.getContext(), klass); intent.putExtra(INTENT_EXTRA_PREFIX + "callback", url); r.startActivity(intent); } }; public static void takePicture(String url) { try { Runnable runnable = Capabilities.CAMERA_ENABLED ? new Picture(url, ImageCapture.class) : new CameraDisabled(url); - Rhodes.performOnUiThread(runnable, false); + PerformOnUiThread.exec(runnable, false); } catch (Exception e) { reportFail("takePicture", e); } } public static void choosePicture(String url) { try { - Rhodes.performOnUiThread(new Picture(url, FileList.class), false); + PerformOnUiThread.exec(new Picture(url, FileList.class), false); } catch (Exception e) { reportFail("choosePicture", e); } }