incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Becky Gibson <gibson.be...@gmail.com>
Subject Yet another Camera option (for iOS)
Date Wed, 23 May 2012 21:55:22 GMT
I'd like to fix this open ticket about the placement of the popover used to
pick images from an album on ipad:
https://issues.apache.org/jira/browse/CB-56

Background:  When picking images from the album on an iPad a
popoverController is required.  We currently place that popover at a fixed
location on the screen and let iOS place the arrow appropriately. This has
caused some apps to get rejected from the appStore due to poor placement of
the popover and the arrow (see the ticket for an example).   In order to
fix this we need to allow the developer to specify the placement of the
popover and the direction of the arrow.  Thus I am proposing yet another
option to camera.getPicture.  I don't like adding more options but it seems
necessary for proper iPad development.

The popover options object would be added to the current camera options.
 In the getPicture(win,fail, options) JavaScript implementation each of the
values in the options parameter  are passed to the exec function via the
parameters array.  The iOS exec function is still set up to pass any
objects found in the parameter array as a dictionary object.   So adding
the popoverOptions object requires minimal changes to the getPicture()
implementation:

*var popoverOptions = null;*
*    if (typeof options.popoverOptions == "object") {*
*    popoverOptions = options.popoverOptions;*
*    }*

    exec(successCallback, errorCallback, "Camera", "takePicture", [quality,
destinationType, sourceType, targetWidth, targetHeight, encodingType,
mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, *popoverOptions*
]);

Here is a quick proposal for the popoveroptions:

 var PopoverOptions =  function(x,y,width,height, direction) {
   this.x = (x !== undefined ? x : 0);
   this.y = (y!== undefined ? y : 32);
   this.width = (width !== undefined ? width :  320);
   this.height = (height !== undefined ? height : 480);
   this.arrowDir = (direction !== undefined ? direction :
PopoverOptions.DIRECTION_ANY);
 }

PopoverOptions.ARROW_DIRECTION_UP= 1;
PopoverOptions.ARROW_DIRECTION_DOWN=2;
PopoverOptions.ARROW_DIRECTION_LEFT=4;
PopoverOptions.ARROW_DIRECTION_RIGHT=8;
PopoverOptions.ARROW_DIRECTION_ANY=15;

Any objections to adding this?

thanks,
-becky

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message