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.


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
           
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
           
static int DEFAULT_PRESSED_STROKE_COLOR
           
static int DEFAULT_SELECTION_COLOR
          The default popup icon selection (fill) color.
static int DEFAULT_STROKE_COLOR
           
 
Fields inherited from class android.widget.LinearLayout
HORIZONTAL, VERTICAL
 
Fields inherited from class android.view.ViewGroup
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, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, GONE, HAPTIC_FEEDBACK_ENABLED, INVISIBLE, KEEP_SCREEN_ON, NO_ID, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SOUND_EFFECTS_ENABLED, VISIBLE
 
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
generateLayoutParams, getBaseline, getBaselineAlignedChildIndex, getOrientation, getWeightSum, isBaselineAligned, setBaselineAligned, setBaselineAlignedChildIndex, setGravity, setHorizontalGravity, setOrientation, setVerticalGravity, setWeightSum
 
Methods inherited from class android.view.ViewGroup
addFocusables, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, bringChildToFront, childDrawableStateChanged, clearChildFocus, clearDisappearingChildren, clearFocus, dispatchConfigurationChanged, dispatchDisplayHint, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchSetSelected, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, findFocus, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildMeasureSpec, getChildVisibleRect, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getPersistentDrawingCache, hasFocus, hasFocusable, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onInterceptTouchEvent, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setOnHierarchyChangeListener, setPadding, setPersistentDrawingCache, showContextMenuForChild, startLayoutAnimation, updateViewLayout
 
Methods inherited from class android.view.View
bringToFront, buildDrawingCache, buildDrawingCache, cancelLongPress, checkInputConnectionProxy, clearAnimation, computeScroll, createContextMenu, destroyDrawingCache, draw, findViewById, findViewWithTag, focusSearch, forceLayout, getAnimation, getApplicationWindowToken, getBackground, getBottom, getContentDescription, getContext, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getId, getKeepScreenOn, getKeyDispatcherState, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMeasuredHeight, getMeasuredWidth, getNextFocusDownId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getResources, getRight, getRootView, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getTag, getTag, getTop, getTouchables, getTouchDelegate, getVerticalFadingEdgeLength, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, isClickable, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPressed, isSaveEnabled, isScrollbarFadingEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, offsetLeftAndRight, offsetTopAndBottom, onCheckIsTextEditor, onCreateInputConnection, onFinishTemporaryDetach, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onWindowFocusChanged, 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, 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, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
equals, 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
See Also:
Constant Field Values

DEFAULT_FILL_COLOR

public static final int DEFAULT_FILL_COLOR
See Also:
Constant Field Values

DEFAULT_PRESSED_STROKE_COLOR

public static final int DEFAULT_PRESSED_STROKE_COLOR
See Also:
Constant Field Values

DEFAULT_PRESSED_FILL_COLOR

public static final int 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.

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.
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

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

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

getPopupCount

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

Returns:
count

getSelectedPopup

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

Returns:
popupView

getSelection

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

Returns:
index

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.

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.

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

setPopupEditingListener

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

Parameters:
popupEditingListener - A PopupEditingListener

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

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

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

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

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.

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:



Copyright © 2012. All Rights Reserved.