danger.ui.photopicker
Class PhotoPicker

java.lang.Object
  extended by danger.app.Listener
      extended by danger.ui.View
          extended by danger.ui.Container
              extended by danger.ui.Window
                  extended by danger.ui.ScreenWindow
                      extended by danger.ui.photopicker.PhotoPicker


public abstract class PhotoPicker
extends ScreenWindow


Field Summary
 
Fields inherited from class danger.ui.Window
NO_FULL_SCREEN_MARQUEE, SHOW_FULL_SCREEN_MARQUEE, STATE_AUTO_HIDE_IF_IDLE, STATE_DROP_ORPHANED_EVENTS, STATE_FULLSCREEN, STATE_UNUSED1
 
Fields inherited from class danger.ui.View
DEFAULT_SCROLL_FOCUS_MARGIN, FOCUS_DEFAULT, FOCUS_DOWNWARD, FOCUS_FROM_NOWHERE, FOCUS_LEFTWARD, FOCUS_NONE, FOCUS_RIGHTWARD, FOCUS_UPWARD, HEIGHT_AUTO, HEIGHT_FILL_TO_BOTTOM, HEIGHT_FILL_TO_TOP, HEIGHT_MATCH_CONTROL, HEIGHT_PERCENTAGE, POSITION_ABOVE, POSITION_ALIGN_BASELINE, POSITION_ALIGN_BOTTOM, POSITION_ALIGN_HORIZONTALLY, POSITION_ALIGN_LEFT, POSITION_ALIGN_PARENT_BOTTOM, POSITION_ALIGN_PARENT_RIGHT, POSITION_ALIGN_PARENT_TOP, POSITION_ALIGN_RIGHT, POSITION_ALIGN_TOP, POSITION_ALIGN_VERTICALLY, POSITION_BELOW, POSITION_BELOW_GROUP_BOX_HEADING, POSITION_TO_LEFT, POSITION_TO_RIGHT, PREFER_DIRECTION_NONE, PREFER_HORIZONTAL_DIRECTION, PREFER_VERTICAL_DIRECTION, STATE_AT_AND_SPACE_PAGE, STATE_CAN_FOCUS, STATE_DEBUG_BOUNDS, STATE_ENABLED, STATE_FOCUSED, STATE_MAKE_DING, STATE_PARTIAL_FOCUS_OK, STATE_TRANSPARENT, STATE_VISIBLE, WIDTH_AUTO, WIDTH_FILL_TO_LEFT, WIDTH_FILL_TO_RIGHT, WIDTH_MATCH_CONTROL, WIDTH_PERCENTAGE
 
Constructor Summary
PhotoPicker()
           
 
Method Summary
static PhotoPicker createPicker()
          Deprecated.  
static PhotoPicker createPicker(boolean showPhotos, boolean showVideos)
          Obtain a reference to the PhotoPicker instance.
abstract  long getMaxSelectionByteCount()
          Returns the maximum # of selectable bytes photos in the PhotoPicker.
abstract  int getMaxSelectionCount()
          Returns the maximum # of selectable photos in the PhotoPicker.
abstract  boolean getShowPhotos()
          Returns whether or not photos are visible in the gallery.
abstract  boolean getShowVideos()
          Returns whether or not videos are visible in the gallery.
abstract  void setEvent(Listener listener, int type)
          Define the return event sent to the caller when PhotoPicker is done.
abstract  void setEvent(Listener listener, int type, int what, int data)
          Define the return event sent to the caller when PhotoPicker is done.
abstract  void setMaxSelectionByteCount(long byteCount)
          Set the maximum # of bytes of selectable photos in the PhotoPicker.
abstract  void setMaxSelectionCount(int count)
          Set the maximum # of selectable photos in the PhotoPicker.
abstract  void setStartInCaptureView(boolean start)
          Indicate whether the PhotoPicker should start in photo capture mode.
 
Methods inherited from class danger.ui.ScreenWindow
aboutToHideMenu, aboutToShowMenu, adjustActionMenuState, eventKeyUp, eventShortcut, eventWidgetDown, eventWidgetUp, getActionMenu, getIcon, getSubTitle, getSubTitleFont, getSubTitleSequence, getTitle, getTitleFont, getTitleSequence, isActionMenuVisible, onScreenWindowActivate, onScreenWindowDeactivate, onShortcut, removeAllChildren, setFullScreen, setIcon, setSubTitle, setSubTitle, setSubTitle, setSubTitle, setTitle, setTitle, setTitle, setTitle, wantsHelpMenuItem
 
Methods inherited from class danger.ui.Window
addTranslucentRegion, addTranslucentRegion, advanceFocus, autoHide, autoHideIfIdle, autoHideIfIdle, blocksAutomaticKeyGuard, blocksBackButton, blocksChooser, blocksFloatingControls, blocksKeyGuard, blocksVolumeButtons, centerHorizontal, centerOnScreen, centerUnderTitleBar, centerVertical, disableControlWithID, dropOrphanedEvents, enableControlWithID, forwardQueuedEvents, getApplication, getContentRect, getDefaultFocus, getDefaultListener, getDescendantWithID, getEffectiveWindow, getIDOfChild, getListener, getWindowBelow, hide, hideActiveMenu, hideControlWithID, incrementMaxChildID, invalidate, isFullScreen, isUnresponsive, onActivate, onDeactivate, onPeriodicPulse, onWindowPaint, receiveMessage, removeTranslucentRegions, reverseFocus, setDefaultFocus, setDefaultListener, setEventArgForControlWithID, setEventForControlWithID, setMaxChildID, setMaxControlID, setPosition, setShowFullScreenMarquee, setSize, setTitled, setTitleFormatDate, setTitleFormatText, setTitleFormatText, setTitleFormatText, setTitleFormatText, setTitleFormatText, setTransparent, shouldDropEvent, show, showControlWithID, startQueueingEvents, wantsEndButton, wantsMenuTrackball, wantsSendButton, willPassEventToWindow
 
Methods inherited from class danger.ui.Container
addChild, addChild, addChildAt, addChildAt, addFromContainerResource, addFromContainerResource, addFromContainerResource, addFromDialogResource, addFromDialogResource, advanceFocusInWindow, childCount, childIsOnScreen, disable, enable, eventKeyDown, eventKeyHeld, eventKeyRepeat, eventPeriodicPulse, eventRawKeyDown, eventRawKeyHeld, eventRawKeyRepeat, eventRawKeyUp, eventWidgetHeld, focusedDescendantIsValid, getBottomChild, getBottomChild, getChildAt, getChildIndex, getChildWithID, getControlWithID, getFirstChild, getFirstFocusableChild, getFocusableChildInWindow, getFocusedChild, getFocusedLeaf, getInterestingRect, getLastChild, getLastFocusableChild, getLeftMostChild, getNextFocusableChild, getNextFocusableChild, getPageHeight, getPrevFocusableChild, getPrevFocusableChild, getRightMostChild, getRightMostChild, handleButtonShortcut, hideAllChildren, isDescendant, keepRectInView, loseFocus, moveChildToIndex, onChildPositionChanged, onChildSizeChanged, onChildVisibilityChanged, pageToEnd, pageToHome, paint, paintChildren, receiveEvent, reflowChildren, removeChild, setFocusedChild, setFocusedChild, setFocusedChild, setFocusedDescendant, setFocusedDescendant, setFocusedDescendant, setFocusToFirstDescendant, setFormatDateForControlWithID, setFormatDateForTextControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setListenerForAllControls, setReflowAdjustHeight, setWindow, showAllChildren, snapHeightToChildren, snapHeightToChildren, snapToChildren, snapWidthToChildren, snapWidthToChildren, takeFocus, willFocusWithin, willFocusWithin
 
Methods inherited from class danger.ui.View
boundsIntersect, boundsIntersect, canLoseFocus, clear, clear, copyStyle, getAcceptFocus, getBackgroundColor, getBottom, getBounds, getBounds, getData, getFocusTraversalDirection, getFocusTraversalFrom, getFocusTraversalPolicy, getFrame, getFrame, getGlobalBottom, getGlobalLeft, getGlobalRight, getGlobalTop, getHeight, getID, getInterestingRect, getLabelFont, getLabelFont, getLeft, getOrigin, getOrigin, getOriginX, getOriginY, getParent, getParentContainer, getPartialFocusOK, getRight, getScrollFocusMargin, getSibling, getState, getStyle, getStyleColor, getStyleFont, getTop, getWidth, getWindow, globalToLocal, globalToLocalH, globalToLocalV, invalidate, invalidate, invalidateIndependentOfOrigin, invalidateIndependentOfOrigin, isEnabled, isFocusable, isFocused, isObscured, isOnScreen, isTransparent, isVisible, isVisibleInHierarchy, isVisibleOnScreen, justSetVisible, localToGlobal, localToGlobal, localToGlobalH, localToGlobalV, localToWindow, moveBy, notifyWhenFocusChanges, notifyWhenObscurityChanges, notifyWhenParentSizeChanges, notifyWhenPositionChanges, notifyWhenSizeChanges, notifyWhenVisibilityChanges, offsetOrigin, offsetOrigin, onAddedToParent, onDecoded, onEnabledStateChanged, onHide, onPositionChanged, onRemovedFromParent, onShortcut, onShortcutConsumed, onShow, onSizeChanged, onStyleChanged, onSystemFontChanged, onViewFocusChanged, onViewObscurityChanged, onViewPositionChanged, onViewSizeChanged, onViewVisibilityChanged, playLimitSound, receiveEventInternal, resetOrigin, sendEventToWindow, setAcceptFocus, setAtAndSpacePage, setBackground, setBackgroundColor, setBottom, setData, setDebugBounds, setDynamicHeight, setDynamicPosition, setDynamicWidth, setEnabled, setFocusTraversalDirection, setFocusTraversalFrom, setFocusTraversalPolicy, setFrame, setHeight, setKeyedValue, setLabelFont, setLeft, setMakeLimitNoise, setOrigin, setOrigin, setPartialFocusOK, setPreferredDirection, setRight, setScrollFocusMargin, setStyle, setStyleColor, setStyleFont, setStyleFrameColor, setTop, setVisible, setWidth, showContextMenu, styleIsDefault, swapStyleColors, windowToLocal
 
Methods inherited from class danger.app.Listener
cancelEvents, childEventPump, childEventPumpDone, eventProblem, isDispatchingThread, sendEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendLowPriorityEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhotoPicker

public PhotoPicker()
Method Detail

createPicker

public static final PhotoPicker createPicker()
Deprecated. 

Obtain a reference to the PhotoPicker instance. PhotoPickers created with this instance will be Photo-only and will return PhotoRecordIPCPayload objects. This exists for legacy compatibility. Use createPicker(boolean showPhotos, boolean showVideos) instead.

Returns:
PhotoPicker instance.

createPicker

public static final PhotoPicker createPicker(boolean showPhotos,
                                             boolean showVideos)
Obtain a reference to the PhotoPicker instance. PhotoPickers created with this method can be specified to deal with only photos, only videos, or both photos and videos. Regardless of this setting, it will return GalleryItem objects in a GalleryItemIPCPayload. This should be used instead of createPicker().

Parameters:
showPhotos - Enable the showing of photos in the PhotoPicker.
showVideos - Enable the showing of videos in the PhotoPicker.
Returns:
PhotoPicker instance.
Since:
4.5

setEvent

public abstract void setEvent(Listener listener,
                              int type,
                              int what,
                              int data)
Define the return event sent to the caller when PhotoPicker is done.


setEvent

public abstract void setEvent(Listener listener,
                              int type)
Define the return event sent to the caller when PhotoPicker is done.


setStartInCaptureView

public abstract void setStartInCaptureView(boolean start)
Indicate whether the PhotoPicker should start in photo capture mode.

Parameters:
start - if true, start PhotoPicker in photo capture mode.

setMaxSelectionCount

public abstract void setMaxSelectionCount(int count)
Set the maximum # of selectable photos in the PhotoPicker.

Parameters:
count - maximum # of selectable photos.

getMaxSelectionCount

public abstract int getMaxSelectionCount()
Returns the maximum # of selectable photos in the PhotoPicker. By default, any # of photos may be selected.

Returns:
maximum # of selectable photos.

setMaxSelectionByteCount

public abstract void setMaxSelectionByteCount(long byteCount)
Set the maximum # of bytes of selectable photos in the PhotoPicker.

Parameters:
byteCount - maximum # of selectable bytes of photos.

getMaxSelectionByteCount

public abstract long getMaxSelectionByteCount()
Returns the maximum # of selectable bytes photos in the PhotoPicker. By default, any # of bytes of photos may be selected.

Returns:
maximum # of selectable bytes of photos.

getShowPhotos

public abstract boolean getShowPhotos()
Returns whether or not photos are visible in the gallery.

Returns:
whether or not photos are visible in the gallery.
Since:
4.5

getShowVideos

public abstract boolean getShowVideos()
Returns whether or not videos are visible in the gallery.

Returns:
whether or not videos are visible in the gallery.
Since:
4.5