Class DynamicMenuPopup
java.lang.Object
com.pranavpandey.android.dynamic.support.popup.base.DynamicPopup
com.pranavpandey.android.dynamic.support.popup.DynamicSimplePopup
com.pranavpandey.android.dynamic.support.popup.DynamicMenuPopup
- All Implemented Interfaces:
DynamicProductFlavor
A
DynamicSimplePopup
to display a list of items.
It will be used internally by the DynamicSpinnerPreference
but can be used by
the other views also.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.pranavpandey.android.dynamic.support.popup.base.DynamicPopup
DynamicPopup.Type
-
Field Summary
Fields inherited from class com.pranavpandey.android.dynamic.support.popup.DynamicSimplePopup
mAction, mActionDrawable, mActionOnClickListener, mMessage, mTitle
Fields inherited from class com.pranavpandey.android.dynamic.support.popup.base.DynamicPopup
mAnchor, mPopupWindowColor, mViewType
-
Constructor Summary
ConstructorDescriptionDynamicMenuPopup
(View anchor, int[] iconsRes, Drawable[] icons, CharSequence[] titles, CharSequence[] subtitles, boolean[] hasSubmenus, int selectedPosition, AdapterView.OnItemClickListener onItemClickListener, int viewType) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, int[] iconsRes, CharSequence[] titles, boolean[] hasSubmenus, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, int[] iconsRes, CharSequence[] titles, int selectedPosition, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, int[] iconsRes, CharSequence[] titles, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, int[] iconsRes, CharSequence[] titles, CharSequence[] subtitles, boolean[] hasSubmenus, int selectedPosition, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, int[] iconsRes, CharSequence[] titles, CharSequence[] subtitles, boolean[] hasSubmenus, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, int[] iconsRes, CharSequence[] titles, CharSequence[] subtitles, boolean[] hasSubmenus, AdapterView.OnItemClickListener onItemClickListener, int viewType) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, int[] iconsRes, CharSequence[] titles, CharSequence[] subtitles, int selectedPosition, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, int[] iconsRes, CharSequence[] titles, CharSequence[] subtitles, int selectedPosition, AdapterView.OnItemClickListener onItemClickListener, int viewType) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, Drawable[] icons, CharSequence[] titles, boolean[] hasSubmenus, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, Drawable[] icons, CharSequence[] titles, int selectedPosition, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, Drawable[] icons, CharSequence[] titles, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, Drawable[] icons, CharSequence[] titles, CharSequence[] subtitles, boolean[] hasSubmenus, int selectedPosition, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, Drawable[] icons, CharSequence[] titles, CharSequence[] subtitles, boolean[] hasSubmenus, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, Drawable[] icons, CharSequence[] titles, CharSequence[] subtitles, boolean[] hasSubmenus, AdapterView.OnItemClickListener onItemClickListener, int viewType) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, Drawable[] icons, CharSequence[] titles, CharSequence[] subtitles, int selectedPosition, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, Drawable[] icons, CharSequence[] titles, CharSequence[] subtitles, int selectedPosition, AdapterView.OnItemClickListener onItemClickListener, int viewType) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, CharSequence[] titles, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.DynamicMenuPopup
(View anchor, List<DynamicMenu> menus, int selectedPosition, AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build this popup and make it ready to show.boolean[]
Get the submenu states used by this popup.Drawable[]
getIcons()
Get the menu icons used by this popup.int[]
Get the menu icons used by this popup.Get the on click listener used by the list view.int
Get the selected position.Get the menu subtitles used by this popup.Get the menu titles used by this popup.protected View
getView()
This method will be called to return the content view for the popup.void
setHasSubmenus
(boolean[] hasSubmenus) Set the submenu states for this popup.void
Set the menu icons for this popup.void
setIconsRes
(int[] iconsRes) Set the menu icons for this popup.void
setOnItemClickListener
(AdapterView.OnItemClickListener onItemClickListener) Set the on click listener used by the list view.void
setSelectedPosition
(int selectedPosition) Set the selected position.void
setSubtitles
(CharSequence[] subtitles) Set the menu subtitles for this popup.void
setTitles
(CharSequence[] titles) Set the menu titles for this popup.Methods inherited from class com.pranavpandey.android.dynamic.support.popup.DynamicSimplePopup
getAction, getActionDrawable, getActionOnClickListener, getFooterView, getHeaderView, getMaxWidth, getMessage, getTitle, setAction, setActionDrawable, setActionOnClickListener, setMessage, setTitle
Methods inherited from class com.pranavpandey.android.dynamic.support.popup.base.DynamicPopup
dismiss, getAnchor, getLocationOffsetX, getLocationOffsetY, getPopupWindow, getPopupWindowColor, getProductFlavor, getSizeOffset, getViewRoot, getViewType, getWindowAnimationStyle, onCustomisePopup, setAnchor, setPopupWindowColor, setViewRoot, setViewType, show
-
Constructor Details
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @NonNull List<DynamicMenu> menus, int selectedPosition, @NonNull AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.menus
- The menu items for this popup.selectedPosition
- The selected menu position for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @NonNull CharSequence[] titles, @NonNull AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.titles
- The titles for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable int[] iconsRes, @Nullable CharSequence[] titles, @Nullable AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.iconsRes
- The icons for this popup.titles
- The titles for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable Drawable[] icons, @Nullable CharSequence[] titles, @Nullable AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.icons
- The icons for this popup.titles
- The titles for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable int[] iconsRes, @Nullable CharSequence[] titles, int selectedPosition, @Nullable AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.iconsRes
- The icons for this popup.titles
- The titles for this popup.selectedPosition
- The selected menu position for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable Drawable[] icons, @Nullable CharSequence[] titles, int selectedPosition, @Nullable AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.icons
- The icons for this popup.titles
- The titles for this popup.selectedPosition
- The selected menu position for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable int[] iconsRes, @Nullable CharSequence[] titles, @Nullable CharSequence[] subtitles, int selectedPosition, @Nullable AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.iconsRes
- The icons for this popup.titles
- The titles for this popup.subtitles
- The subtitles for this popup.selectedPosition
- The selected menu position for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable Drawable[] icons, @Nullable CharSequence[] titles, @Nullable CharSequence[] subtitles, int selectedPosition, @Nullable AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.icons
- The icons for this popup.titles
- The titles for this popup.subtitles
- The subtitles for this popup.selectedPosition
- The selected menu position for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable int[] iconsRes, @Nullable CharSequence[] titles, @Nullable CharSequence[] subtitles, int selectedPosition, @Nullable AdapterView.OnItemClickListener onItemClickListener, int viewType) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.iconsRes
- The icons for this popup.titles
- The titles for this popup.subtitles
- The subtitles for this popup.selectedPosition
- The selected menu position for this popup.onItemClickListener
- The on click listener for the list view.viewType
- The view type for the popup.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable Drawable[] icons, @Nullable CharSequence[] titles, @Nullable CharSequence[] subtitles, int selectedPosition, @Nullable AdapterView.OnItemClickListener onItemClickListener, int viewType) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.icons
- The icons for this popup.titles
- The titles for this popup.subtitles
- The subtitles for this popup.selectedPosition
- The selected menu position for this popup.onItemClickListener
- The on click listener for the list view.viewType
- The view type for the popup.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable int[] iconsRes, @Nullable CharSequence[] titles, @Nullable boolean[] hasSubmenus, @Nullable AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.iconsRes
- The icons for this popup.titles
- The titles for this popup.hasSubmenus
- The submenu states for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable Drawable[] icons, @Nullable CharSequence[] titles, @Nullable boolean[] hasSubmenus, @Nullable AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.icons
- The icons for this popup.titles
- The titles for this popup.hasSubmenus
- The submenu states for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable int[] iconsRes, @Nullable CharSequence[] titles, @Nullable CharSequence[] subtitles, @Nullable boolean[] hasSubmenus, @Nullable AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.iconsRes
- The icons for this popup.titles
- The titles for this popup.subtitles
- The subtitles for this popup.hasSubmenus
- The submenu states for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable Drawable[] icons, @Nullable CharSequence[] titles, @Nullable CharSequence[] subtitles, @Nullable boolean[] hasSubmenus, @Nullable AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.icons
- The icons for this popup.titles
- The titles for this popup.subtitles
- The subtitles for this popup.hasSubmenus
- The submenu states for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable int[] iconsRes, @Nullable CharSequence[] titles, @Nullable CharSequence[] subtitles, @Nullable boolean[] hasSubmenus, @Nullable AdapterView.OnItemClickListener onItemClickListener, int viewType) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.iconsRes
- The icons for this popup.titles
- The titles for this popup.subtitles
- The subtitles for this popup.hasSubmenus
- The submenu states for this popup.onItemClickListener
- The on click listener for the list view.viewType
- The view type for the popup.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable Drawable[] icons, @Nullable CharSequence[] titles, @Nullable CharSequence[] subtitles, @Nullable boolean[] hasSubmenus, @Nullable AdapterView.OnItemClickListener onItemClickListener, int viewType) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.icons
- The icons for this popup.titles
- The titles for this popup.subtitles
- The subtitles for this popup.hasSubmenus
- The submenu states for this popup.onItemClickListener
- The on click listener for the list view.viewType
- The view type for the popup.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable int[] iconsRes, @Nullable CharSequence[] titles, @Nullable CharSequence[] subtitles, @Nullable boolean[] hasSubmenus, int selectedPosition, @Nullable AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.iconsRes
- The icons for this popup.titles
- The titles for this popup.subtitles
- The subtitles for this popup.hasSubmenus
- The submenu states for this popup.selectedPosition
- The selected menu position for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable Drawable[] icons, @Nullable CharSequence[] titles, @Nullable CharSequence[] subtitles, @Nullable boolean[] hasSubmenus, int selectedPosition, @Nullable AdapterView.OnItemClickListener onItemClickListener) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.icons
- The icons for this popup.titles
- The titles for this popup.subtitles
- The subtitles for this popup.hasSubmenus
- The submenu states for this popup.selectedPosition
- The selected menu position for this popup.onItemClickListener
- The on click listener for the list view.
-
DynamicMenuPopup
public DynamicMenuPopup(@NonNull View anchor, @Nullable int[] iconsRes, @Nullable Drawable[] icons, @Nullable CharSequence[] titles, @Nullable CharSequence[] subtitles, @Nullable boolean[] hasSubmenus, int selectedPosition, @Nullable AdapterView.OnItemClickListener onItemClickListener, int viewType) Constructor to initialize an object of this class.- Parameters:
anchor
- The anchor view for this popup.iconsRes
- The icons for this popup.icons
- The icons for this popup.titles
- The titles for this popup.subtitles
- The subtitles for this popup.hasSubmenus
- The submenu states for this popup.selectedPosition
- The selected menu position for this popup.onItemClickListener
- The on click listener for the list view.viewType
- The view type for the popup.
-
-
Method Details
-
build
Description copied from class:DynamicPopup
Build this popup and make it ready to show.Please call
DynamicPopup.show()
method to show the popup.- Overrides:
build
in classDynamicSimplePopup
- Returns:
- The popup after building it according to the supplied parameters.
-
getView
Description copied from class:DynamicPopup
This method will be called to return the content view for the popup.- Overrides:
getView
in classDynamicSimplePopup
- Returns:
- The content view for the popup.
-
getIconsRes
Get the menu icons used by this popup.- Returns:
- The menu icons used by this popup.
-
setIconsRes
Set the menu icons for this popup.- Parameters:
iconsRes
- The menu icons to be set.
-
getIcons
Get the menu icons used by this popup.- Returns:
- The menu icons used by this popup.
-
setIcons
Set the menu icons for this popup.- Parameters:
icons
- The menu icons to be set.
-
getTitles
Get the menu titles used by this popup.- Returns:
- The menu titles used by this popup.
-
setTitles
Set the menu titles for this popup.- Parameters:
titles
- The menu titles to be set.
-
getSubtitles
Get the menu subtitles used by this popup.- Returns:
- The menu subtitles used by this popup.
-
setSubtitles
Set the menu subtitles for this popup.- Parameters:
subtitles
- The menu subtitles to be set.
-
getSelectedPosition
public int getSelectedPosition()Get the selected position.- Returns:
- The selected position.
-
setSelectedPosition
public void setSelectedPosition(int selectedPosition) Set the selected position.- Parameters:
selectedPosition
- The position to be selected.
-
getOnItemClickListener
Get the on click listener used by the list view.- Returns:
- The on click listener used by the list view.
-
setOnItemClickListener
Set the on click listener used by the list view.- Parameters:
onItemClickListener
- The listener to be set.
-