Skip to content

Commit

Permalink
Merge pull request #5567 from hieupham007/timob-13998
Browse files Browse the repository at this point in the history
timob-13998: change 'flashmode' to 'cameraFlashMode' for parity purposes
  • Loading branch information
vishalduggal committed Apr 12, 2014
2 parents 0d9f170 + 3157f5a commit 0c776e9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.appcelerator.titanium.TiContext;


@Kroll.proxy(creatableInModule = MediaModule.class, propertyAccessors = { TiC.PROPERTY_FLASH_MODE })
@Kroll.proxy(creatableInModule = MediaModule.class)
public class CameraProxy extends KrollProxy
{
private static TiCamera camera = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public void showCamera(@SuppressWarnings("rawtypes") HashMap options)
saveToPhotoGallery = TiConvert.toBoolean(saveToPhotoGalleryOption);
}

Object cameraFlashModeOption = options.get(TiC.PROPERTY_FLASH_MODE);
Object cameraFlashModeOption = options.get(TiC.PROPERTY_CAMERA_FLASH_MODE);
if (cameraFlashModeOption != null) {
flashMode = TiConvert.toInt(cameraFlashModeOption);
}
Expand Down Expand Up @@ -691,14 +691,14 @@ public void onError(Activity activity, int requestCode, Exception e) {

@Kroll.method
@Kroll.setProperty
public void setFlashMode(int flashMode)
public void setCameraFlashMode(int flashMode)
{
TiCameraActivity.setFlashMode(flashMode);
}

@Kroll.method
@Kroll.getProperty
public int getFlashMode()
public int getCameraFlashMode()
{
return TiCameraActivity.cameraFlashMode;
}
Expand Down
11 changes: 6 additions & 5 deletions android/titanium/src/java/org/appcelerator/titanium/TiC.java
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,11 @@ public class TiC
* @module.api
*/
public static final String PROPERTY_CALENDAR_VIEW_SHOWN = "calendarViewShown";

/**
* @module.api
*/
public static final String PROPERTY_CAMERA_FLASH_MODE = "cameraFlashMode";

/**
* @module.api
Expand Down Expand Up @@ -1153,11 +1158,7 @@ public class TiC
* @module.api
*/
public static final String PROPERTY_FLAGS = "flags";

/**
* @module.api
*/
public static final String PROPERTY_FLASH_MODE = "flashMode";


/**
* @module.api
Expand Down
4 changes: 2 additions & 2 deletions apidoc/Titanium/Media/Media.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1119,11 +1119,11 @@ properties:
overlay is not set, the default Android Camera Activity is used, which is only
capable of reporting back the results of one taken photo, making `autohide`
meaningless in that context.
- name: flashMode
- name: cameraFlashMode
summary: set camera flash on or off for custom overlays.
type: Boolean
default: false
platforms: [android]
platforms: [android, iphone, ipad]
since: {android: "3.3.0"}
- name: animated
summary: Specifies if the dialog should be animated upon showing and hiding.
Expand Down

0 comments on commit 0c776e9

Please sign in to comment.