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.OnDialogResultListener
Von 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 int
static final int
static final String
static final int
static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
static final int[]
static final int
static final int
static final int
static final int
protected static final int
protected static final String
static final String
Von 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_DIRECT
Von Klasse geerbte Felder eltos.simpledialogfragment.SimpleDialog
BUNDLE, CANCELABLE, FULLSCREEN, HTML, ICON_RESOURCE, MESSAGE, NEGATIVE_BUTTON_TEXT, NEUTRAL_BUTTON_TEXT, POSITIVE_BUTTON_TEXT, THEME, TITLE
Von Klasse geerbte Felder androidx.fragment.app.DialogFragment
STYLE_NO_FRAME, STYLE_NO_INPUT, STYLE_NO_TITLE, STYLE_NORMAL
Von Klasse geerbte Felder androidx.fragment.app.Fragment
mPreviousWho
Von Schnittstelle geerbte Felder eltos.simpledialogfragment.SimpleDialog.OnDialogResultListener
BUTTON_NEGATIVE, BUTTON_NEUTRAL, BUTTON_POSITIVE, CANCELED
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected boolean
Overwrite 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 SimpleColorDialog
build()
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_COLORS
setcolors
(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_PALLET
or a custom palletvoid
onCreate
(android.os.Bundle savedInstanceState) protected AdvancedAdapter
Overwrite this method to provide a custom adaptervoid
onItemClick
(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.Bundle
onResult
(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)
boolean
Let the hosting fragment or activity implement this interface to receive results from the dialogvoid
onSaveInstanceState
(android.os.Bundle outState) setupColorWheelAlpha
(boolean alpha) ConfiguresSimpleColorWheelDialog
for custom color picking SeeSimpleColorWheelDialog.alpha(boolean)
setupColorWheelHideHex
(boolean hideHex) ConfiguresSimpleColorWheelDialog
for custom color picking SeeSimpleColorWheelDialog.hideHexInput(boolean)
ConfiguresSimpleColorWheelDialog
for custom color picking SeeSimpleDialog.neut(CharSequence)
ConfiguresSimpleColorWheelDialog
for custom color picking SeeSimpleDialog.pos(CharSequence)
ConfiguresSimpleColorWheelDialog
for 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, updatePosButton
Von Klasse geerbte Methoden eltos.simpledialogfragment.CustomViewDialog
callResultListener, extractContentView, inflate, inflate, onCreateDialog, onNegativeButtonClick, onNeutralButtonClick, onPositiveButtonClick, pressPositiveButton, setNegativeButtonEnabled, setNeutralButtonEnabled, setPositiveButtonEnabled
Von 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, title
Von 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, showNow
Von 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_COLORS
set- 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_PALLET
or 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
ConfiguresSimpleColorWheelDialog
for custom color picking SeeSimpleColorWheelDialog.alpha(boolean)
- Parameter:
alpha
- whether or not to allow transparency (alpha) adjustment- Gibt zurück:
- this instance
-
setupColorWheelHideHex
ConfiguresSimpleColorWheelDialog
for custom color picking SeeSimpleColorWheelDialog.hideHexInput(boolean)
- Parameter:
hideHex
- whether or not to hide the input field- Gibt zurück:
- this instance
-
setupColorWheelTitle
ConfiguresSimpleColorWheelDialog
for custom color picking SeeSimpleDialog.title(CharSequence)
- Parameter:
text
- the title for the color wheel dialog- Gibt zurück:
- this instance
-
setupColorWheelPosButton
ConfiguresSimpleColorWheelDialog
for custom color picking SeeSimpleDialog.pos(CharSequence)
- Parameter:
text
- the positive button text for the color wheel dialog- Gibt zurück:
- this instance
-
setupColorWheelNeutButton
ConfiguresSimpleColorWheelDialog
for 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:
onCreate
in KlasseCustomViewDialog<SimpleColorDialog>
-
onCreateAdapter
Beschreibung aus Klasse kopiert:CustomListDialog
Overwrite this method to provide a custom adapter- Angegeben von:
onCreateAdapter
in KlasseCustomListDialog<SimpleColorDialog>
- Gibt zurück:
- the ListAdapter to use
-
onSaveInstanceState
public void onSaveInstanceState(android.os.Bundle outState) - Setzt außer Kraft:
onSaveInstanceState
in KlasseCustomListDialog<SimpleColorDialog>
-
acceptsPositiveButtonPress
protected boolean acceptsPositiveButtonPress()Beschreibung aus Klasse kopiert:CustomViewDialog
Overwrite 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:
acceptsPositiveButtonPress
in 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:CustomListDialog
Callback 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:
onItemClick
in Schnittstelleandroid.widget.AdapterView.OnItemClickListener
- Setzt außer Kraft:
onItemClick
in 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.OnDialogResultListener
Let the hosting fragment or activity implement this interface to receive results from the dialog- Angegeben von:
onResult
in 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_NEUTRAL
orSimpleDialog.OnDialogResultListener.CANCELED
extras
- 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:CustomViewDialog
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)
- Setzt außer Kraft:
onResult
in KlasseCustomListDialog<SimpleColorDialog>
- Parameter:
which
- seeSimpleDialog.OnDialogResultListener
- Gibt zurück:
- the bundle to merge with the results or null
-