Package eltos.simpledialogfragment.color
Klasse SimpleColorDialog
java.lang.Object
androidx.fragment.app.Fragment
androidx.fragment.app.DialogFragment
eltos.simpledialogfragment.SimpleDialog<SimpleColorDialog>
eltos.simpledialogfragment.CustomViewDialog<SimpleColorDialog>
eltos.simpledialogfragment.list.CustomListDialog<SimpleColorDialog>
eltos.simpledialogfragment.color.SimpleColorDialog
- Alle implementierten Schnittstellen:
android.content.ComponentCallbacks,android.content.DialogInterface.OnCancelListener,android.content.DialogInterface.OnDismissListener,android.view.View.OnCreateContextMenuListener,android.widget.AdapterView.OnItemClickListener,android.widget.AdapterView.OnItemLongClickListener,androidx.activity.result.ActivityResultCaller,androidx.lifecycle.HasDefaultViewModelProviderFactory,androidx.lifecycle.LifecycleOwner,androidx.lifecycle.ViewModelStoreOwner,androidx.savedstate.SavedStateRegistryOwner,SimpleDialog.OnDialogResultListener
public class SimpleColorDialog
extends CustomListDialog<SimpleColorDialog>
implements SimpleDialog.OnDialogResultListener
A dialog that let's the user select a color
Result: COLOR int Selected color (rgb)
Created by eltos on 17.04.2016.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenVon Klasse geerbte verschachtelte Klassen/Schnittstellen eltos.simpledialogfragment.SimpleDialog
SimpleDialog.OnDialogResultListenerVon Klasse geerbte verschachtelte Klassen/Schnittstellen androidx.fragment.app.Fragment
androidx.fragment.app.Fragment.InstantiationException, androidx.fragment.app.Fragment.SavedState -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final intstatic final intstatic final Stringstatic final intstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final int[]static final intstatic final intstatic final intstatic final intprotected static final intprotected static final Stringstatic final StringVon Klasse geerbte Felder eltos.simpledialogfragment.list.CustomListDialog
CHOICE_MAX_COUNT, CHOICE_MIN_COUNT, CHOICE_MODE, INITIALLY_CHECKED_IDS, INITIALLY_CHECKED_POSITIONS, mAdapter, mFilterEditText, mListView, MULTI_CHOICE, NO_CHOICE, SELECTED_IDS, SELECTED_POSITIONS, SELECTED_SINGLE_ID, SELECTED_SINGLE_POSITION, SINGLE_CHOICE, SINGLE_CHOICE_DIRECTVon Klasse geerbte Felder eltos.simpledialogfragment.SimpleDialog
BUNDLE, CANCELABLE, FULLSCREEN, HTML, ICON_RESOURCE, MESSAGE, NEGATIVE_BUTTON_TEXT, NEUTRAL_BUTTON_TEXT, POSITIVE_BUTTON_TEXT, THEME, TITLEVon Klasse geerbte Felder androidx.fragment.app.DialogFragment
STYLE_NO_FRAME, STYLE_NO_INPUT, STYLE_NO_TITLE, STYLE_NORMALVon Klasse geerbte Felder androidx.fragment.app.Fragment
mPreviousWhoVon Schnittstelle geerbte Felder eltos.simpledialogfragment.SimpleDialog.OnDialogResultListener
BUTTON_NEGATIVE, BUTTON_NEUTRAL, BUTTON_POSITIVE, CANCELED -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected booleanOverwrite this method to catch positive button presses, e.g. if you need to verify input by the userallowCustom(boolean allow) Set this to true to show a field with a color picker optionstatic SimpleColorDialogbuild()colorNames(android.content.Context context, int colorNameArrayRes) Sets the color names for accessibility purposecolorNames(String[] colorNames) Sets the color names for accessibility purposecolorPreset(int color) Sets the initially selected colorcolors(int[] colors) Sets the colors to choose from Default is theDEFAULT_COLORSsetcolors(android.content.Context context, int colorArrayRes) Sets the color pallet to choose from May be one ofMATERIAL_COLOR_PALLET,MATERIAL_COLOR_PALLET_DARK,MATERIAL_COLOR_PALLET_LIGHT,BEIGE_COLOR_PALLETor a custom palletvoidonCreate(android.os.Bundle savedInstanceState) protected AdvancedAdapterOverwrite this method to provide a custom adaptervoidonItemClick(android.widget.AdapterView<?> parent, android.view.View view, int position, long id) Callback method to be invoked when an item in this AdapterView has been clicked.protected android.os.BundleonResult(int which) Overwrite this method to provide additional results from your custom view to be passed to theSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)booleanLet the hosting fragment or activity implement this interface to receive results from the dialogvoidonSaveInstanceState(android.os.Bundle outState) setupColorWheelAlpha(boolean alpha) ConfiguresSimpleColorWheelDialogfor custom color picking SeeSimpleColorWheelDialog.alpha(boolean)setupColorWheelHideHex(boolean hideHex) ConfiguresSimpleColorWheelDialogfor custom color picking SeeSimpleColorWheelDialog.hideHexInput(boolean)ConfiguresSimpleColorWheelDialogfor custom color picking SeeSimpleDialog.neut(CharSequence)ConfiguresSimpleColorWheelDialogfor custom color picking SeeSimpleDialog.pos(CharSequence)ConfiguresSimpleColorWheelDialogfor custom color picking SeeSimpleDialog.title(CharSequence)showOutline(int color) Add a colored outline to the color fields.Von Klasse geerbte Methoden eltos.simpledialogfragment.list.CustomListDialog
choiceIdPreset, choiceIdPreset, choiceIdPreset, choiceMax, choiceMin, choiceMode, choicePreset, choicePreset, choicePreset, divider, emptyText, emptyText, filterable, getListView, grid, gridColumnWidth, gridNumColumn, notifyDataSetChanged, onCreateContentView, onDialogShown, onItemLongClick, pos, pos, updatePosButtonVon Klasse geerbte Methoden eltos.simpledialogfragment.CustomViewDialog
callResultListener, extractContentView, inflate, inflate, onCreateDialog, onNegativeButtonClick, onNeutralButtonClick, onPositiveButtonClick, pressPositiveButton, setNegativeButtonEnabled, setNeutralButtonEnabled, setPositiveButtonEnabledVon Klasse geerbte Methoden eltos.simpledialogfragment.SimpleDialog
cancelable, extra, fullscreen, fullscreen, getArgs, getArgString, getContext, getExtras, getMessage, getTitle, icon, isCancelable, msg, msg, msgHtml, msgHtml, neg, neg, neg, neut, neut, neut, onCancel, onDestroyView, setArg, setArg, setArg, setArg, setButtonClickListener, setButtonEnabled, show, show, show, show, show, show, show, show, showKeyboard, theme, title, titleVon Klasse geerbte Methoden androidx.fragment.app.DialogFragment
dismiss, dismissAllowingStateLoss, dismissNow, getDialog, getShowsDialog, getTheme, onActivityCreated, onAttach, onDetach, onDismiss, onGetLayoutInflater, onStart, onStop, onViewStateRestored, requireDialog, setCancelable, setShowsDialog, setStyle, setupDialog, showNowVon Klasse geerbte Methoden androidx.fragment.app.Fragment
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getDefaultViewModelCreationExtras, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onCreateView, onDestroy, onDestroyOptionsMenu, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, onViewCreated, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
-
Felddetails
-
TAG
- Siehe auch:
-
COLOR
- Siehe auch:
-
COLORS
- Siehe auch:
-
MATERIAL_COLOR_PALLET
@ArrayRes public static final int MATERIAL_COLOR_PALLET -
MATERIAL_COLOR_PALLET_LIGHT
@ArrayRes public static final int MATERIAL_COLOR_PALLET_LIGHT -
MATERIAL_COLOR_PALLET_DARK
@ArrayRes public static final int MATERIAL_COLOR_PALLET_DARK -
BEIGE_COLOR_PALLET
@ArrayRes public static final int BEIGE_COLOR_PALLET -
COLORFUL_COLOR_PALLET
@ArrayRes public static final int COLORFUL_COLOR_PALLET -
NONE
public static final int NONE- Siehe auch:
-
AUTO
public static final int AUTO- Siehe auch:
-
DEFAULT_COLORS
@ColorInt public static final int[] DEFAULT_COLORS -
PICKER
protected static final int PICKER- Siehe auch:
-
PICKER_DIALOG_TAG
- Siehe auch:
-
CUSTOM
- Siehe auch:
-
CUSTOM_ALPHA
- Siehe auch:
-
CUSTOM_HIDE_HEX
- Siehe auch:
-
CUSTOM_TITLE
- Siehe auch:
-
CUSTOM_POS
- Siehe auch:
-
CUSTOM_NEUT
- Siehe auch:
-
-
Konstruktordetails
-
SimpleColorDialog
public SimpleColorDialog()
-
-
Methodendetails
-
build
-
colors
Sets the colors to choose from Default is theDEFAULT_COLORSset- Parameter:
colors- array of rgb-colors- Gibt zurück:
- this instance
-
colors
Sets the color pallet to choose from May be one ofMATERIAL_COLOR_PALLET,MATERIAL_COLOR_PALLET_DARK,MATERIAL_COLOR_PALLET_LIGHT,BEIGE_COLOR_PALLETor a custom pallet- Parameter:
context- a context to resolve the resourcecolorArrayRes- color array resource id- Gibt zurück:
- this instance
-
colorNames
Sets the color names for accessibility purpose- Parameter:
colorNames- array of names that match the colors defined viacolors(int[])- Gibt zurück:
- this instance
-
colorNames
public SimpleColorDialog colorNames(android.content.Context context, @ArrayRes int colorNameArrayRes) Sets the color names for accessibility purpose- Parameter:
context- a context to resolve the resourcecolorNameArrayRes- String array resource id- Gibt zurück:
- this instance
-
colorPreset
Sets the initially selected color- Parameter:
color- the selected color- Gibt zurück:
- this instance
-
allowCustom
Set this to true to show a field with a color picker option- Parameter:
allow- allow custom picked color if true- Gibt zurück:
- this instance
-
setupColorWheelAlpha
ConfiguresSimpleColorWheelDialogfor custom color picking SeeSimpleColorWheelDialog.alpha(boolean)- Parameter:
alpha- whether or not to allow transparency (alpha) adjustment- Gibt zurück:
- this instance
-
setupColorWheelHideHex
ConfiguresSimpleColorWheelDialogfor custom color picking SeeSimpleColorWheelDialog.hideHexInput(boolean)- Parameter:
hideHex- whether or not to hide the input field- Gibt zurück:
- this instance
-
setupColorWheelTitle
ConfiguresSimpleColorWheelDialogfor custom color picking SeeSimpleDialog.title(CharSequence)- Parameter:
text- the title for the color wheel dialog- Gibt zurück:
- this instance
-
setupColorWheelPosButton
ConfiguresSimpleColorWheelDialogfor custom color picking SeeSimpleDialog.pos(CharSequence)- Parameter:
text- the positive button text for the color wheel dialog- Gibt zurück:
- this instance
-
setupColorWheelNeutButton
ConfiguresSimpleColorWheelDialogfor custom color picking SeeSimpleDialog.neut(CharSequence)- Parameter:
text- the neutral button text for the color wheel dialog- Gibt zurück:
- this instance
-
showOutline
-
onCreate
public void onCreate(android.os.Bundle savedInstanceState) - Setzt außer Kraft:
onCreatein KlasseCustomViewDialog<SimpleColorDialog>
-
onCreateAdapter
Beschreibung aus Klasse kopiert:CustomListDialogOverwrite this method to provide a custom adapter- Angegeben von:
onCreateAdapterin KlasseCustomListDialog<SimpleColorDialog>- Gibt zurück:
- the ListAdapter to use
-
onSaveInstanceState
public void onSaveInstanceState(android.os.Bundle outState) - Setzt außer Kraft:
onSaveInstanceStatein KlasseCustomListDialog<SimpleColorDialog>
-
acceptsPositiveButtonPress
protected boolean acceptsPositiveButtonPress()Beschreibung aus Klasse kopiert:CustomViewDialogOverwrite this method to catch positive button presses, e.g. if you need to verify input by the userNote: do not call
CustomViewDialog.pressPositiveButton()here!- Setzt außer Kraft:
acceptsPositiveButtonPressin KlasseCustomViewDialog<SimpleColorDialog>- Gibt zurück:
- false to ignore the press, true to process normally
-
onItemClick
public void onItemClick(android.widget.AdapterView<?> parent, android.view.View view, int position, long id) Beschreibung aus Klasse kopiert:CustomListDialogCallback method to be invoked when an item in this AdapterView has been clicked. Implementers can call Adapter#getItem(position) if they need to access the data associated with the selected item.- Angegeben von:
onItemClickin Schnittstelleandroid.widget.AdapterView.OnItemClickListener- Setzt außer Kraft:
onItemClickin KlasseCustomListDialog<SimpleColorDialog>- Parameter:
parent- The AdapterView where the click happened.view- The view within the AdapterView that was clicked (this will be a view provided by the adapter)position- The position of the view in the adapter.id- The row id of the item that was clicked.
-
onResult
Beschreibung aus Schnittstelle kopiert:SimpleDialog.OnDialogResultListenerLet the hosting fragment or activity implement this interface to receive results from the dialog- Angegeben von:
onResultin SchnittstelleSimpleDialog.OnDialogResultListener- Parameter:
dialogTag- the tag passed toSimpleDialog.show(androidx.fragment.app.Fragment)which- result type, one ofSimpleDialog.OnDialogResultListener.BUTTON_POSITIVE,SimpleDialog.OnDialogResultListener.BUTTON_NEGATIVE,SimpleDialog.OnDialogResultListener.BUTTON_NEUTRALorSimpleDialog.OnDialogResultListener.CANCELEDextras- the extras passed toSimpleDialog.extra(Bundle)- Gibt zurück:
- true if the result was handled, false otherwise
-
onResult
protected android.os.Bundle onResult(int which) Beschreibung aus Klasse kopiert:CustomViewDialogOverwrite this method to provide additional results from your custom view to be passed to theSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)- Setzt außer Kraft:
onResultin KlasseCustomListDialog<SimpleColorDialog>- Parameter:
which- seeSimpleDialog.OnDialogResultListener- Gibt zurück:
- the bundle to merge with the results or null
-