Package eltos.simpledialogfragment
Klasse SimpleDialog<This extends SimpleDialog<This>>
java.lang.Object
androidx.fragment.app.Fragment
androidx.fragment.app.DialogFragment
eltos.simpledialogfragment.SimpleDialog<This>
- Alle implementierten Schnittstellen:
android.content.ComponentCallbacks
,android.content.DialogInterface.OnCancelListener
,android.content.DialogInterface.OnDismissListener
,android.view.View.OnCreateContextMenuListener
,androidx.activity.result.ActivityResultCaller
,androidx.lifecycle.HasDefaultViewModelProviderFactory
,androidx.lifecycle.LifecycleOwner
,androidx.lifecycle.ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
- Bekannte direkte Unterklassen:
CustomViewDialog
public class SimpleDialog<This extends SimpleDialog<This>>
extends androidx.fragment.app.DialogFragment
An easy to use and extendable dialog fragment that displays a text message.
This is the base class of all dialogs in this library.
Created by eltos on 03.08.2015.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenVon Klasse geerbte verschachtelte Klassen/Schnittstellen androidx.fragment.app.Fragment
androidx.fragment.app.Fragment.InstantiationException, androidx.fragment.app.Fragment.SavedState
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected 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
protected static final String
protected static final String
static final String
protected static final String
protected static final String
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
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic SimpleDialog
build()
protected boolean
callResultListener
(int which, android.os.Bundle extras) cancelable
(boolean cancelable) Specifies whether this dialog may be canceled by pressing the back button or touching outside of the dialog.extra
(android.os.Bundle extras) Pass extras to the dialog to retain specific information across configuration changes.Set that this dialog is shown as fullscreen dialog.fullscreen
(boolean fullscreen) Specifies whether this dialog is shown as fullscreen or basic dialog.protected final android.os.Bundle
getArgs()
null-save method to get argumentsprotected final CharSequence
getArgString
(String key) android.content.Context
android.os.Bundle
Gets the extras bundle providedGets the string representation of the message setgetTitle()
Gets the string representation of the title seticon
(int iconResourceId) Sets this dialogs iconboolean
Return whether the dialog was set to be cancelable or notmsg
(int messageResourceId) Sets this dialogs messagemsg
(CharSequence message) Sets this dialogs messagemsgHtml
(int messageResourceId) Sets this dialogs message as html styled stringSets this dialogs message as html styled stringneg()
Sets this dialogs negative button text toR.string.no
neg
(int negativeButtonResourceId) Sets this dialogs negative button textneg
(CharSequence negativeButton) Sets this dialogs negative button textneut()
Sets this dialogs neutral button text toR.string.cancel
neut
(int neutralButtonResourceId) Sets this dialogs neutral button textneut
(CharSequence neutralButton) Sets this dialogs neutral button textvoid
onCancel
(android.content.DialogInterface dialog) void
onCreate
(android.os.Bundle savedInstanceState) android.app.Dialog
onCreateDialog
(android.os.Bundle savedInstanceState) void
pos
(int positiveButtonResourceId) Sets this dialogs positive button textpos
(CharSequence positiveButton) Sets this dialogs positive button textprotected final This
protected final This
protected final This
protected final This
setArg
(String key, CharSequence value) protected void
setButtonClickListener
(int whichButton, android.view.View.OnClickListener listener) Call this method to overwrite the click listener for a buttonprotected void
setButtonEnabled
(int whichButton, boolean enabled) Call this method to enable or disable a buttonvoid
show
(androidx.fragment.app.Fragment fragment) Shows the dialog.void
show
(androidx.fragment.app.FragmentActivity activity) Shows the dialog.void
Shows the dialog.void
Shows the dialog.void
Veraltet.void
Shows the dialog.void
Shows the dialog.int
Veraltet.void
showKeyboard
(android.view.View view) Helper for opening the soft keyboard on a specified viewtheme
(int theme) Set a custom theme.title
(int titleResourceId) Sets this dialogs titletitle
(CharSequence title) Sets this dialogs titleVon Klasse geerbte Methoden androidx.fragment.app.DialogFragment
dismiss, dismissAllowingStateLoss, dismissNow, getDialog, getShowsDialog, getTheme, onActivityCreated, onAttach, onDetach, onDismiss, onGetLayoutInflater, onSaveInstanceState, 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:
-
TITLE
- Siehe auch:
-
MESSAGE
- Siehe auch:
-
POSITIVE_BUTTON_TEXT
- Siehe auch:
-
NEGATIVE_BUTTON_TEXT
- Siehe auch:
-
NEUTRAL_BUTTON_TEXT
- Siehe auch:
-
ICON_RESOURCE
- Siehe auch:
-
CANCELABLE
- Siehe auch:
-
FULLSCREEN
- Siehe auch:
-
THEME
- Siehe auch:
-
HTML
- Siehe auch:
-
BUNDLE
- Siehe auch:
-
-
Konstruktordetails
-
SimpleDialog
public SimpleDialog()
-
-
Methodendetails
-
build
-
callResultListener
@CallSuper protected boolean callResultListener(int which, @Nullable android.os.Bundle extras) -
setArg
-
setArg
-
setArg
-
setArg
-
getArgString
-
getArgs
@NonNull protected final android.os.Bundle getArgs()null-save method to get arguments- Gibt zurück:
- dialog arguments bundle
-
title
Sets this dialogs title- Parameter:
title
- the title as string- Gibt zurück:
- this instance
-
title
Sets this dialogs title- Parameter:
titleResourceId
- the title as android string resource- Gibt zurück:
- this instance
-
getTitle
Gets the string representation of the title set- Gibt zurück:
- the dialog title
-
msg
Sets this dialogs message- Parameter:
message
- title as string- Gibt zurück:
- this instance
-
msg
Sets this dialogs message- Parameter:
messageResourceId
- the message as android string resource- Gibt zurück:
- this instance
-
msgHtml
Sets this dialogs message as html styled string- Parameter:
message
- title as html-string- Gibt zurück:
- this instance
-
msgHtml
Sets this dialogs message as html styled string- Parameter:
messageResourceId
- the message as html-styled android string resource- Gibt zurück:
- this instance
-
getMessage
Gets the string representation of the message set- Gibt zurück:
- the dialog message
-
pos
Sets this dialogs positive button text- Parameter:
positiveButton
- the text as string- Gibt zurück:
- this instance
-
pos
Sets this dialogs positive button text- Parameter:
positiveButtonResourceId
- the text as android string resource- Gibt zurück:
- this instance
-
neg
Sets this dialogs negative button text- Parameter:
negativeButton
- the text as string- Gibt zurück:
- this instance
-
neg
Sets this dialogs negative button text- Parameter:
negativeButtonResourceId
- the text as android string resource- Gibt zurück:
- this instance
-
neg
Sets this dialogs negative button text toR.string.no
- Gibt zurück:
- this instance
-
neut
Sets this dialogs neutral button text- Parameter:
neutralButton
- the text as string- Gibt zurück:
- this instance
-
neut
Sets this dialogs neutral button text- Parameter:
neutralButtonResourceId
- the text as android string resource- Gibt zurück:
- this instance
-
neut
Sets this dialogs neutral button text toR.string.cancel
- Gibt zurück:
- this instance
-
icon
Sets this dialogs icon- Parameter:
iconResourceId
- the icon as android drawable resource- Gibt zurück:
- this instance
-
cancelable
Specifies whether this dialog may be canceled by pressing the back button or touching outside of the dialog. The dialog may still be "canceled" by a neutral button.- Parameter:
cancelable
- whether this dialog may be canceled- Gibt zurück:
- this instance
-
isCancelable
public boolean isCancelable()Return whether the dialog was set to be cancelable or not- Setzt außer Kraft:
isCancelable
in Klasseandroidx.fragment.app.DialogFragment
- Gibt zurück:
- whether the dialog is cancelable
-
fullscreen
Specifies whether this dialog is shown as fullscreen or basic dialog.- Parameter:
fullscreen
- whether this dialog is fullscreen- Gibt zurück:
- this instance
-
fullscreen
Set that this dialog is shown as fullscreen dialog.- Gibt zurück:
- this instance
-
extra
Pass extras to the dialog to retain specific information across configuration changes. All extras supplied here will be contained in the extras bundle passed toSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Parameter:
extras
- a bundle of extras to store- Gibt zurück:
- this instance
-
getExtras
@NonNull public android.os.Bundle getExtras()Gets the extras bundle provided- Gibt zurück:
- the extras bundle (which may be empty)
-
theme
Set a custom theme. Default is using the theme defined by the 'simpleDialogTheme'-attribute or the 'alertDialogTheme'-attribute.- Parameter:
theme
- the android style resource id of the custom theme- Gibt zurück:
- this instance
-
show
public void show(androidx.fragment.app.Fragment fragment) Shows the dialog. TheSimpleDialog.OnDialogResultListener
won't be called.- Parameter:
fragment
- the hosting fragment
-
show
Shows the dialog. Results will be forwarded to the fragment supplied. The tag can be used to identify the dialog inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Parameter:
fragment
- the hosting fragmenttag
- the dialogs tag
-
show
Shows the dialog. Results will be forwarded to the fragment supplied. The tag can be used to identify the dialog inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
An optional argument can be used to remove a previously shown dialog with the tag given prior to showing this one.- Parameter:
fragment
- the hosting fragmenttag
- the dialogs tagreplaceTag
- removes the dialog with the given tag if specified
-
show
public void show(androidx.fragment.app.FragmentActivity activity) Shows the dialog. TheSimpleDialog.OnDialogResultListener
won't be called.- Parameter:
activity
- the hosting activity
-
show
Shows the dialog. Results will be forwarded to the activity supplied. The tag can be used to identify the dialog inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
- Parameter:
activity
- the hosting activitytag
- the dialogs tag
-
show
Shows the dialog. Results will be forwarded to the activity supplied. The tag can be used to identify the dialog inSimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
An optional argument can be used to remove a previously shown dialog with the tag given prior to showing this one.- Parameter:
activity
- the hosting activitytag
- the dialogs tagreplaceTag
- removes the dialog with the given tag if specified
-
onCreate
@CallSuper public void onCreate(android.os.Bundle savedInstanceState) - Setzt außer Kraft:
onCreate
in Klasseandroidx.fragment.app.DialogFragment
-
getContext
public android.content.Context getContext()- Setzt außer Kraft:
getContext
in Klasseandroidx.fragment.app.Fragment
-
onCreateDialog
@NonNull public android.app.Dialog onCreateDialog(android.os.Bundle savedInstanceState) - Setzt außer Kraft:
onCreateDialog
in Klasseandroidx.fragment.app.DialogFragment
-
setButtonEnabled
protected void setButtonEnabled(int whichButton, boolean enabled) Call this method to enable or disable a buttonNote: This method has no effect if the dialog is not yet shown
- Parameter:
enabled
- whether to en- or disable the button
-
setButtonClickListener
protected void setButtonClickListener(int whichButton, android.view.View.OnClickListener listener) Call this method to overwrite the click listener for a buttonNote: This method has no effect if the dialog is not yet shown
- Parameter:
listener
- the click listener
-
showKeyboard
public void showKeyboard(android.view.View view) Helper for opening the soft keyboard on a specified view- Parameter:
view
- the view to be focused and receive keyboard input
-
show
Veraltet.Deprecated, useshow(FragmentActivity)
orshow(Fragment)
instead- Setzt außer Kraft:
show
in Klasseandroidx.fragment.app.DialogFragment
-
show
@Deprecated public int show(@NonNull androidx.fragment.app.FragmentTransaction transaction, String tag) Veraltet.Deprecated, useshow(FragmentActivity, String)
orshow(Fragment, String)
instead- Setzt außer Kraft:
show
in Klasseandroidx.fragment.app.DialogFragment
-
onCancel
@CallSuper public void onCancel(@NonNull android.content.DialogInterface dialog) - Angegeben von:
onCancel
in Schnittstelleandroid.content.DialogInterface.OnCancelListener
- Setzt außer Kraft:
onCancel
in Klasseandroidx.fragment.app.DialogFragment
-
onDestroyView
@CallSuper public void onDestroyView()- Setzt außer Kraft:
onDestroyView
in Klasseandroidx.fragment.app.DialogFragment
-