com.esri.android.map
Class PopupContainer

java.lang.Object
  extended by android.view.View
      extended by android.view.ViewGroup
          extended by android.widget.LinearLayout
              extended by com.esri.android.map.PopupContainer
All Implemented Interfaces:
android.graphics.drawable.Drawable.Callback, android.view.accessibility.AccessibilityEventSource, android.view.KeyEvent.Callback, android.view.ViewManager, android.view.ViewParent

public class PopupContainer
extends android.widget.LinearLayout

The PopupContainer class provides the basic user interface (UI) and behavior for displaying and editing information about graphics in a popup. It holds and manages one or more PopupView objects to provide UI for attribute editing, media displaying, attachment managing, and etc. It also manages the transitions between PopupViews.

Since:
1.0

Nested Class Summary
static class PopupContainer.PopupEditButton
          Enumeration defining the edit buttons in the editing toolbar of a PopupContainer.
 
Nested classes/interfaces inherited from class android.widget.LinearLayout
android.widget.LinearLayout.LayoutParams
 
Nested classes/interfaces inherited from class android.view.ViewGroup
android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
 
Nested classes/interfaces inherited from class android.view.View
android.view.View.BaseSavedState, android.view.View.MeasureSpec, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnFocusChangeListener, android.view.View.OnKeyListener, android.view.View.OnLongClickListener, android.view.View.OnTouchListener
 
Field Summary
static int DEFAULT_FILL_COLOR
          The Constant DEFAULT_FILL_COLOR.
static int DEFAULT_POPUP_BACKGROUND_COLOR
          The default popup background color.
static int DEFAULT_POPUP_TEXT_COLOR
          The default popup text color.
static int DEFAULT_PRESSED_FILL_COLOR
          The Constant DEFAULT_PRESSED_FILL_COLOR.
static int DEFAULT_PRESSED_STROKE_COLOR
          The Constant DEFAULT_PRESSED_STROKE_COLOR.
static int DEFAULT_SELECTION_COLOR
          The default popup icon selection (fill) color.
static int DEFAULT_STROKE_COLOR
          The Constant DEFAULT_STROKE_COLOR.
 
Fields inherited from class android.widget.LinearLayout
HORIZONTAL, VERTICAL
 
Fields inherited from class android.view.ViewGroup
CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
 
Fields inherited from class android.view.View
DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, INVISIBLE, KEEP_SCREEN_ON, NO_ID, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET
 
Constructor Summary
PopupContainer(android.content.Context context)
          This constructor is used if you are instantiating a PopupContainer that saves downloaded attachments to a default directory.

Use the PopupContainer(Context, File) constructor if persistent attachment storage is desired.
PopupContainer(android.content.Context context, File attachmentDownloadDirectory)
          This constructor is used if you are instantiating a PopupContainer that saves downloaded attachments to a developer chosen directory.

Use the PopupContainer(Context) constructor if the default temporary attachment storage is desired.
 
Method Summary
 PopupView addPopupView(PopupInfo popUpInfo, Graphic graphic)
          Add a single PopupView to this PopupContainer.
 void addPopupViews(PopupView[] popupViews)
          Add a list of PopupViews to be shown in the PopupContainer.
 void cancelEditing()
          Cancels the editing session of the currently displayed PopupView.
 int getPopupCount()
          Returns the number of PopupViews hosted in this PopupContainer.
 PopupView getSelectedPopup()
          Returns the PopupView currently being shown in this PopupContainer.
 int getSelection()
          Returns the index of the the PopupView currently being shown in this PopupContainer.
 boolean isEditing()
          Returns true if the PopupView currently being shown in this PopupContainer is being edited, false otherwise.
 void setEditingMode(boolean isEditMode)
          Sets the popup into editing mode.
 void setPopupBackgroundColor(int backgroundColor)
          Sets the background color for this PopupContainer.
 void setPopupEditButtonEnabled(PopupContainer.PopupEditButton button, boolean enabled)
          Gives the ability to disable or enable specific buttons in this PopupContainer's editing toolbar.
 void setPopupEditButtonVisibility(PopupContainer.PopupEditButton button, int visibility)
          Set the visibility of the specific buttons in this PopupContainer's editing toolbar.
 void setPopupEditingListener(PopupEditingListener popupEditingListener)
          Sets the PopupEditingListener for this PopupContainer.
 void setPopupSelectorColors(int defaultStrokeColor, int defaultFillColor, int pressedStrokeColor, int pressedFillColor)
          Sets the selector colors for the PopupContainer.
 void setPopupTextColor(int textColor)
          Sets the text color for the PopupContainer.
 void setPopupToolbar(android.view.ViewGroup popupToolbar)
          Sets the custom toolbar shown at the top of the PopupContainer.
 void setSelection(int pos)
          Sets the the PopupView that should be shown in this PopupContainer from it's index.
 
Methods inherited from class android.widget.LinearLayout
checkLayoutParams, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getBaseline, getBaselineAlignedChildIndex, getOrientation, getWeightSum, isBaselineAligned, onLayout, onMeasure, setBaselineAligned, setBaselineAlignedChildIndex, setGravity, setHorizontalGravity, setOrientation, setVerticalGravity, setWeightSum
 
Methods inherited from class android.view.ViewGroup
addFocusables, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDraw, dispatchFreezeSelfOnly, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetPressed, dispatchSetSelected, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, findFocus, fitSystemWindows, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getPersistentDrawingCache, hasFocus, hasFocusable, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, measureChild, measureChildren, measureChildWithMargins, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onCreateDrawableState, onInterceptTouchEvent, onRequestFocusInDescendants, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setOnHierarchyChangeListener, setPadding, setPersistentDrawingCache, setStaticTransformationsEnabled, showContextMenuForChild, startLayoutAnimation, updateViewLayout
 
Methods inherited from class android.view.View
awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, cancelLongPress, checkInputConnectionProxy, clearAnimation, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createContextMenu, destroyDrawingCache, draw, findViewById, findViewWithTag, focusSearch, forceLayout, getAnimation, getApplicationWindowToken, getBackground, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getKeepScreenOn, getKeyDispatcherState, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMeasuredHeight, getMeasuredWidth, getNextFocusDownId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getTag, getTag, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getVerticalFadingEdgeLength, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isClickable, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPressed, isSaveEnabled, isScrollbarFadingEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAttachedToWindow, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDetachedFromWindow, onDisplayHint, onDraw, onDrawScrollBars, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onRestoreInstanceState, onSaveInstanceState, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowVisibilityChanged, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAnimation, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setId, setKeepScreenOn, setLayoutParams, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnFocusChangeListener, setOnKeyListener, setOnLongClickListener, setOnTouchListener, setPressed, setSaveEnabled, setScrollbarFadingEnabled, setScrollBarStyle, setScrollContainer, setSelected, setSoundEffectsEnabled, setTag, setTag, setTouchDelegate, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVisibility, setWillNotCacheDrawing, setWillNotDraw, showContextMenu, startAnimation, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface android.view.ViewParent
createContextMenu, getParent, isLayoutRequested, requestLayout
 

Field Detail

DEFAULT_POPUP_BACKGROUND_COLOR

public static final int DEFAULT_POPUP_BACKGROUND_COLOR
The default popup background color.

See Also:
Constant Field Values

DEFAULT_POPUP_TEXT_COLOR

public static final int DEFAULT_POPUP_TEXT_COLOR
The default popup text color.

See Also:
Constant Field Values

DEFAULT_SELECTION_COLOR

public static final int DEFAULT_SELECTION_COLOR
The default popup icon selection (fill) color.

See Also:
Constant Field Values

DEFAULT_STROKE_COLOR

public static final int DEFAULT_STROKE_COLOR
The Constant DEFAULT_STROKE_COLOR.

See Also:
Constant Field Values

DEFAULT_FILL_COLOR

public static final int DEFAULT_FILL_COLOR
The Constant DEFAULT_FILL_COLOR.

See Also:
Constant Field Values

DEFAULT_PRESSED_STROKE_COLOR

public static final int DEFAULT_PRESSED_STROKE_COLOR
The Constant DEFAULT_PRESSED_STROKE_COLOR.

See Also:
Constant Field Values

DEFAULT_PRESSED_FILL_COLOR

public static final int DEFAULT_PRESSED_FILL_COLOR
The Constant DEFAULT_PRESSED_FILL_COLOR.

See Also:
Constant Field Values
Constructor Detail

PopupContainer

public PopupContainer(android.content.Context context)
This constructor is used if you are instantiating a PopupContainer that saves downloaded attachments to a default directory.

Use the PopupContainer(Context, File) constructor if persistent attachment storage is desired.

Parameters:
context - The Context the view is running in, through which it can access the current theme, resources, and so on.
Since:
1.0

PopupContainer

public PopupContainer(android.content.Context context,
                      File attachmentDownloadDirectory)
This constructor is used if you are instantiating a PopupContainer that saves downloaded attachments to a developer chosen directory.

Use the PopupContainer(Context) constructor if the default temporary attachment storage is desired.

Parameters:
context - The Context the view is running in, through which it can access the current theme, resources, and so on.
attachmentDownloadDirectory - The directory to set as the attachment download directory.
Since:
1.0
Method Detail

setPopupToolbar

public void setPopupToolbar(android.view.ViewGroup popupToolbar)
Sets the custom toolbar shown at the top of the PopupContainer. Overwrites the default toolbar.

Parameters:
popupToolbar - A ViewGroup to be shown in place of the default toolbar
Since:
1.0

addPopupViews

public void addPopupViews(PopupView[] popupViews)
Add a list of PopupViews to be shown in the PopupContainer.

Parameters:
popupViews - An array of PopupViews to be added
Since:
1.0

addPopupView

public PopupView addPopupView(PopupInfo popUpInfo,
                              Graphic graphic)
Add a single PopupView to this PopupContainer.

Parameters:
popUpInfo - The PopupInfo of the feature
graphic - The Graphic of the feature
Returns:
popupView
Since:
1.0

getPopupCount

public int getPopupCount()
Returns the number of PopupViews hosted in this PopupContainer.

Returns:
count
Since:
1.0

getSelectedPopup

public PopupView getSelectedPopup()
Returns the PopupView currently being shown in this PopupContainer.

Returns:
popupView
Since:
1.0

getSelection

public int getSelection()
Returns the index of the the PopupView currently being shown in this PopupContainer.

Returns:
index
Since:
1.0

setSelection

public void setSelection(int pos)
Sets the the PopupView that should be shown in this PopupContainer from it's index.

Parameters:
pos - The index of the PopupView to be shown.
Since:
1.0

setEditingMode

public void setEditingMode(boolean isEditMode)
Sets the popup into editing mode. When set to true and the map layer of the current displayed PopupView is editable, a UI that allow users to edit all editable attributes will be shown. This method should be run on the UI thread.

Parameters:
isEditMode - - true if the popup should be put into edit mode or false to take it out of edit mode.
Since:
1.0

isEditing

public boolean isEditing()
Returns true if the PopupView currently being shown in this PopupContainer is being edited, false otherwise.

Returns:
true if the PopupView currently being shown in this PopupContainer is being edited, false otherwise
Since:
1.0

setPopupEditingListener

public void setPopupEditingListener(PopupEditingListener popupEditingListener)
Sets the PopupEditingListener for this PopupContainer.

Parameters:
popupEditingListener - A PopupEditingListener
Since:
1.0

setPopupBackgroundColor

public void setPopupBackgroundColor(int backgroundColor)
Sets the background color for this PopupContainer. Otherwise DEFAULT_POPUP_BACKGROUND_COLOR will be used.

Parameters:
backgroundColor - An int representing the background color
Since:
1.0

setPopupTextColor

public void setPopupTextColor(int textColor)
Sets the text color for the PopupContainer. Otherwise DEFAULT_POPUP_TEXT_COLOR will be used.

Parameters:
textColor - An int representing the text color
Since:
1.0

setPopupSelectorColors

public void setPopupSelectorColors(int defaultStrokeColor,
                                   int defaultFillColor,
                                   int pressedStrokeColor,
                                   int pressedFillColor)
Sets the selector colors for the PopupContainer. Otherwise DEFAULT_FILL_COLOR, DEFAULT_STROKE_COLOR, DEFAULT_PRESSED_FILL_COLOR, and DEFAULT_PRESSED_STROKE_COLOR will be used.

These should be valid colors.

Parameters:
defaultStrokeColor - An int representing the stroke color
defaultFillColor - An int representing the fill color
pressedStrokeColor - An int representing the pressed stroke color
pressedFillColor - An int representing the pressed fill color
Since:
1.0

setPopupEditButtonEnabled

public void setPopupEditButtonEnabled(PopupContainer.PopupEditButton button,
                                      boolean enabled)
Gives the ability to disable or enable specific buttons in this PopupContainer's editing toolbar.

Parameters:
button - A PopupContainer.PopupEditButton
enabled - True if the button should be enabled, false otherwise
Since:
1.0

setPopupEditButtonVisibility

public void setPopupEditButtonVisibility(PopupContainer.PopupEditButton button,
                                         int visibility)
Set the visibility of the specific buttons in this PopupContainer's editing toolbar.

Parameters:
button - The button to be changed.
visibility - One of View.VISIBLE, View.INVISIBLE, or View.GONE.
Since:
1.0

cancelEditing

public void cancelEditing()
Cancels the editing session of the currently displayed PopupView. This method is called when the Cancel button on a PopupContainer is pressed. You may also call it directly in your application.

This method will:

Since:
1.0


Copyright © 2010. All Rights Reserved.