Package eltos.simpledialogfragment
Class SimpleImageDialog
java.lang.Object
androidx.fragment.app.Fragment
androidx.fragment.app.DialogFragment
eltos.simpledialogfragment.SimpleDialog<This>
eltos.simpledialogfragment.CustomViewDialog<SimpleImageDialog>
eltos.simpledialogfragment.SimpleImageDialog
- All Implemented Interfaces:
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
A dialog that displays an image
Created by eltos on 13.02.17.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
static enum
Nested classes/interfaces inherited from class eltos.simpledialogfragment.SimpleDialog
SimpleDialog.OnDialogResultListener
Nested classes/interfaces inherited from class androidx.fragment.app.Fragment
androidx.fragment.app.Fragment.InstantiationException, androidx.fragment.app.Fragment.SavedState
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
static final String
Fields inherited from class eltos.simpledialogfragment.SimpleDialog
BUNDLE, CANCELABLE, FULLSCREEN, HTML, ICON_RESOURCE, MESSAGE, NEGATIVE_BUTTON_TEXT, NEUTRAL_BUTTON_TEXT, POSITIVE_BUTTON_TEXT, THEME, TITLE
Fields inherited from class androidx.fragment.app.DialogFragment
STYLE_NO_FRAME, STYLE_NO_INPUT, STYLE_NO_TITLE, STYLE_NORMAL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SimpleImageDialog
build()
image
(int resourceId) Sets the image drawable to be displayedimage
(android.graphics.Bitmap image) Deprecated.image
(android.net.Uri imageUri) Sets the image uri to be displayedSets a Creator that can be used to create the image.protected android.view.View
onCreateContentView
(android.os.Bundle savedInstanceState) Inflate your custom view here.android.app.Dialog
onCreateDialog
(android.os.Bundle savedInstanceState) scaleType
(SimpleImageDialog.Scale scale) Sets the images scale and scroll type to one ofSimpleImageDialog.Scale
theme
(int theme) Set a custom theme.Methods inherited from class eltos.simpledialogfragment.CustomViewDialog
acceptsPositiveButtonPress, callResultListener, extractContentView, inflate, inflate, onCreate, onDialogShown, onNegativeButtonClick, onNeutralButtonClick, onPositiveButtonClick, onResult, pressPositiveButton, setNegativeButtonEnabled, setNeutralButtonEnabled, setPositiveButtonEnabled
Methods inherited from class 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, pos, pos, setArg, setArg, setArg, setArg, setButtonClickListener, setButtonEnabled, show, show, show, show, show, show, show, show, showKeyboard, title, title
Methods inherited from class androidx.fragment.app.DialogFragment
dismiss, dismissAllowingStateLoss, getDialog, getShowsDialog, getTheme, onAttach, onDetach, onDismiss, onGetLayoutInflater, onSaveInstanceState, onStart, onStop, onViewStateRestored, requireDialog, setCancelable, setShowsDialog, setStyle, setupDialog, showNow
Methods inherited from class androidx.fragment.app.Fragment
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, 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, onActivityCreated, 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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface androidx.lifecycle.HasDefaultViewModelProviderFactory
getDefaultViewModelCreationExtras
-
Field Details
-
TAG
- See Also:
-
DRAWABLE_RESOURCE
- See Also:
-
BITMAP
- See Also:
-
IMAGE_URI
- See Also:
-
SCALE_TYPE
- See Also:
-
-
Constructor Details
-
SimpleImageDialog
public SimpleImageDialog()
-
-
Method Details
-
build
-
image
Sets the image drawable to be displayed- Parameters:
resourceId
- the android resource id of the drawable- Returns:
- this instance
-
image
Deprecated.Sets the bitmap to be displayed Deprecated: To avoidTransactionTooLargeException
, use any of the following (save the bitmap to the app's private storage if needed) –image(int)
–image(Uri)
–image(Class)
- Parameters:
image
- the bitmap to display- Returns:
- this instance
-
image
public SimpleImageDialog image(Class<? extends eltos.simpledialogfragment.SimpleImageDialog.Creator> builderClass) Sets a Creator that can be used to create the image.- Parameters:
builderClass
- A class implementing one ofSimpleImageDialog.BitmapCreator
,SimpleImageDialog.DrawableCreator
orSimpleImageDialog.IconCreator
- Returns:
- this instance
-
image
Sets the image uri to be displayed- Parameters:
imageUri
- Uri of the image- Returns:
- this instance
-
scaleType
Sets the images scale and scroll type to one ofSimpleImageDialog.Scale
- Parameters:
scale
- the scale type used for scaling- Returns:
- this instance
-
theme
Description copied from class:SimpleDialog
Set a custom theme. Default is using the theme defined by the 'simpleDialogTheme'-attribute or the 'alertDialogTheme'-attribute.- Overrides:
theme
in classSimpleDialog<SimpleImageDialog>
- Parameters:
theme
- the android style resource id of the custom theme- Returns:
- this instance
-
onCreateDialog
@NonNull public android.app.Dialog onCreateDialog(android.os.Bundle savedInstanceState) - Overrides:
onCreateDialog
in classCustomViewDialog<SimpleImageDialog>
-
onCreateContentView
protected android.view.View onCreateContentView(android.os.Bundle savedInstanceState) Description copied from class:CustomViewDialog
Inflate your custom view here.- Specified by:
onCreateContentView
in classCustomViewDialog<SimpleImageDialog>
- Parameters:
savedInstanceState
- The last saved instance state of the Fragment, or null if this fragment is created for the first time.- Returns:
- Return a new View to be displayed by the Fragment.
-