Class DynamicIntent
java.lang.Object
com.pranavpandey.android.dynamic.support.intent.DynamicIntent
Helper class to manage the intent and extras.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Settings action constant for the accessibility settings.static final String
Settings action constant for the ignore battery optimization.static final String
Settings action constant for the overlay settings.static final String
Constant for the permissions action.static final String
Settings action constant for request to ignore battery optimizations.static final String
Constant for the dynamic theme action.static final String
Constant for the dynamic remote theme action.static final String
Constant for the dynamic theme share action.static final String
Settings action constant for the usage access settings.static final String
Settings action constant for the write system settings.static final String
Intent extra constant for the fragment argument key.static final String
Intent extra constant for the permissions.static final String
Intent extra constant for permissions action to perform it when all the permissions are granted.static final String
Intent extra constant for permissions to perform it when all the permissions are granted.static final String
Intent extra constant for the preview.static final String
Intent extra constant for the show fragment arguments.static final String
Intent extra constant for the text.static final String
Intent extra constant for the dynamic theme.static final String
Intent extra constant for the theme bitmap URI.static final String
Intent extra constant for the default dynamic theme.static final String
Intent extra constant to show the theme presets.static final boolean
Default value for the intent extra constant to show the theme presets.static final String
Intent extra constant for the dynamic theme type.static final String
Intent extra constant for the theme URL.static final String
Intent extra constant for the URI.static final String
Intent extra constant for updating the app widget.static final int
Constant for dynamic permission request.static final int
Constant to request the preview location.static final int
Constant to request the custom preview location.static final int
Constant for dynamic theme request.static final int
Constant for dynamic day theme request.static final int
Constant to edit the dynamic theme.static final int
Constant for dynamic night theme request.static final int
Constant for dynamic remote theme request.static final int
Constant to save the dynamic theme. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
captureTheme
(Context context, LifecycleOwner owner, int requestCode, String theme) Returns an intent to edit or show the dynamic theme.static boolean
editAppTheme
(Context context, Class<?> clazz, int requestCode, String theme, String defaultTheme, String text, View sharedElement) Try to launch an intent to edit or show the dynamic app theme.static boolean
editRemoteTheme
(Context context, Class<?> clazz, int requestCode, String theme, String defaultTheme, String text, View sharedElement) Try to launch an intent to edit or show the dynamic remote theme.static boolean
editTheme
(Context context, LifecycleOwner owner, Class<?> clazz, String action, int requestCode, String theme, String defaultTheme, String text, View sharedElement) Try to launch an intent to edit or show the dynamic theme.static boolean
editTheme
(Context context, LifecycleOwner owner, String action, int requestCode, String theme) Try to launch an intent to edit or show the dynamic theme.static boolean
editTheme
(Context context, Class<?> clazz, String action, int requestCode, String theme, String defaultTheme, String text, View sharedElement) Try to launch an intent to edit or show the dynamic theme.static boolean
Try to launch an intent to edit or show the dynamic theme.static Intent
getThemeIntent
(Context context, Class<?> clazz, String action, String theme, String defaultTheme, String text) Returns an intent to edit or show the dynamic theme.static Intent
getThemeIntent
(Context context, String action, String theme) Returns an intent to edit or show the dynamic theme.static Intent
getThemeShareIntent
(Context context, Class<?> clazz, String action, String theme, int themeType, String themeUrl, Uri bitmapUri) Returns an intent to share the dynamic theme with a bitmap (code) URI.static Intent
getThemeShareIntent
(Context context, Class<?> clazz, String action, String theme, int themeType, String themeUrl, Uri bitmapUri, String text) Returns an intent to share the dynamic theme with a bitmap (code) URI.
-
Field Details
-
ACTION_PERMISSIONS
Constant for the permissions action.- See Also:
-
ACTION_THEME
Constant for the dynamic theme action.- See Also:
-
ACTION_THEME_REMOTE
Constant for the dynamic remote theme action.- See Also:
-
ACTION_THEME_SHARE
Constant for the dynamic theme share action.- See Also:
-
REQUEST_PERMISSIONS
public static final int REQUEST_PERMISSIONSConstant for dynamic permission request.- See Also:
-
REQUEST_THEME
public static final int REQUEST_THEMEConstant for dynamic theme request.- See Also:
-
REQUEST_THEME_DAY
public static final int REQUEST_THEME_DAYConstant for dynamic day theme request.- See Also:
-
REQUEST_THEME_NIGHT
public static final int REQUEST_THEME_NIGHTConstant for dynamic night theme request.- See Also:
-
REQUEST_THEME_REMOTE
public static final int REQUEST_THEME_REMOTEConstant for dynamic remote theme request.- See Also:
-
REQUEST_THEME_EDIT
public static final int REQUEST_THEME_EDITConstant to edit the dynamic theme.- See Also:
-
REQUEST_THEME_SAVE
public static final int REQUEST_THEME_SAVEConstant to save the dynamic theme.- See Also:
-
REQUEST_PREVIEW_LOCATION
public static final int REQUEST_PREVIEW_LOCATIONConstant to request the preview location.- See Also:
-
REQUEST_PREVIEW_LOCATION_ALT
public static final int REQUEST_PREVIEW_LOCATION_ALTConstant to request the custom preview location.- See Also:
-
ACTION_WRITE_SYSTEM_SETTINGS
Settings action constant for the write system settings. -
ACTION_OVERLAY_SETTINGS
Settings action constant for the overlay settings. -
ACTION_USAGE_ACCESS_SETTINGS
Settings action constant for the usage access settings. -
ACTION_ACCESSIBILITY_SETTINGS
Settings action constant for the accessibility settings. -
ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS
Settings action constant for the ignore battery optimization. -
ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
Settings action constant for request to ignore battery optimizations. -
EXTRA_FRAGMENT_ARG_KEY
Intent extra constant for the fragment argument key.- See Also:
-
EXTRA_SHOW_FRAGMENT_ARGUMENTS
Intent extra constant for the show fragment arguments.- See Also:
-
EXTRA_URI
Intent extra constant for the URI.- See Also:
-
EXTRA_TEXT
Intent extra constant for the text.- See Also:
-
EXTRA_THEME
Intent extra constant for the dynamic theme.- See Also:
-
EXTRA_THEME_TYPE
Intent extra constant for the dynamic theme type.- See Also:
-
EXTRA_THEME_DEFAULT
Intent extra constant for the default dynamic theme.- See Also:
-
EXTRA_THEME_URL
Intent extra constant for the theme URL.- See Also:
-
EXTRA_THEME_BITMAP_URI
Intent extra constant for the theme bitmap URI.- See Also:
-
EXTRA_THEME_SHOW_PRESETS
Intent extra constant to show the theme presets.- See Also:
-
EXTRA_PREVIEW
Intent extra constant for the preview.- See Also:
-
EXTRA_PERMISSIONS
Intent extra constant for the permissions.- See Also:
-
EXTRA_PERMISSIONS_INTENT
Intent extra constant for permissions to perform it when all the permissions are granted.- See Also:
-
EXTRA_PERMISSIONS_ACTION
Intent extra constant for permissions action to perform it when all the permissions are granted.- See Also:
-
EXTRA_WIDGET_UPDATE
Intent extra constant for updating the app widget.- See Also:
-
EXTRA_THEME_SHOW_PRESETS_DEFAULT
public static final boolean EXTRA_THEME_SHOW_PRESETS_DEFAULTDefault value for the intent extra constant to show the theme presets.- See Also:
-
-
Constructor Details
-
DynamicIntent
public DynamicIntent()
-
-
Method Details
-
getThemeIntent
@NonNull public static Intent getThemeIntent(@NonNull Context context, @Nullable Class<?> clazz, @NonNull String action, @Nullable String theme, @Nullable String defaultTheme, @Nullable String text) Returns an intent to edit or show the dynamic theme.- Parameters:
context
- The context to create the intent.clazz
- The theme activity class to create the intent.action
- The action for the intent.theme
- The dynamic app theme extra for the intent.defaultTheme
- The optional dynamic app theme default extra for the intent.text
- The optional text extra for the intent.- Returns:
- The intent to edit or show the dynamic theme.
- See Also:
-
getThemeIntent
@NonNull public static Intent getThemeIntent(@NonNull Context context, @NonNull String action, @Nullable String theme) Returns an intent to edit or show the dynamic theme.- Parameters:
context
- The context to create the intent.action
- The action for the intent.theme
- The dynamic app theme extra for the intent.- Returns:
- The intent to edit or show the dynamic theme.
- See Also:
-
editTheme
public static boolean editTheme(@Nullable Context context, @Nullable LifecycleOwner owner, @Nullable Class<?> clazz, @NonNull String action, int requestCode, @Nullable String theme, @Nullable String defaultTheme, @Nullable String text, @Nullable View sharedElement) Try to launch an intent to edit or show the dynamic theme.- Parameters:
context
- The context to create the intent.owner
- The requesting owner for the intent.clazz
- The theme activity class to create the intent.action
- The action for the intent.requestCode
- The request code for the intent.theme
- The dynamic app theme extra for the intent.defaultTheme
- The optional dynamic app theme default extra for the intent.text
- The optional text extra for the intent.sharedElement
- The optional view for the shared element transition.- Returns:
true
on successful operation.- See Also:
-
editTheme
public static boolean editTheme(@Nullable Context context, @Nullable Class<?> clazz, @NonNull String action, int requestCode, @Nullable String theme, @Nullable String defaultTheme, @Nullable String text, @Nullable View sharedElement) Try to launch an intent to edit or show the dynamic theme.- Parameters:
context
- The context to create the intent.clazz
- The theme activity class to create the intent.action
- The action for the intent.requestCode
- The request code for the intent.theme
- The dynamic app theme extra for the intent.defaultTheme
- The optional dynamic app theme default extra for the intent.text
- The optional text extra for the intent.sharedElement
- The optional view for the shared element transition.- Returns:
true
on successful operation.- See Also:
-
editTheme
public static boolean editTheme(@Nullable Context context, @Nullable LifecycleOwner owner, @NonNull String action, int requestCode, @Nullable String theme) Try to launch an intent to edit or show the dynamic theme.- Parameters:
context
- The context to create the intent.owner
- The requesting owner for the intent.action
- The action for the intent.requestCode
- The request code for the intent.theme
- The dynamic app theme extra for the intent.- Returns:
true
on successful operation.- See Also:
-
editTheme
public static boolean editTheme(@Nullable Context context, @NonNull String action, int requestCode, @Nullable String theme) Try to launch an intent to edit or show the dynamic theme.- Parameters:
context
- The context to create the intent.action
- The action for the intent.requestCode
- The request code for the intent.theme
- The dynamic app theme extra for the intent.- Returns:
true
on successful operation.- See Also:
-
editAppTheme
public static boolean editAppTheme(@Nullable Context context, @NonNull Class<?> clazz, int requestCode, @Nullable String theme, @Nullable String defaultTheme, @Nullable String text, @Nullable View sharedElement) Try to launch an intent to edit or show the dynamic app theme.- Parameters:
context
- The context to create the intent.clazz
- The theme activity class to create the intent.requestCode
- The request code for the intent.theme
- The dynamic app theme extra for the intent.defaultTheme
- The optional dynamic app theme default extra for the intent.text
- The optional text extra for the intent.sharedElement
- The optional view for the shared element transition.- Returns:
true
on successful operation.- See Also:
-
editRemoteTheme
public static boolean editRemoteTheme(@Nullable Context context, @NonNull Class<?> clazz, int requestCode, @Nullable String theme, @Nullable String defaultTheme, @Nullable String text, @Nullable View sharedElement) Try to launch an intent to edit or show the dynamic remote theme.- Parameters:
context
- The context to create the intent.clazz
- The theme activity class to create the intent.requestCode
- The request code for the intent.theme
- The dynamic app theme extra for the intent.defaultTheme
- The optional dynamic app theme default extra for the intent.text
- The optional text extra for the intent.sharedElement
- The optional view for the shared element transition.- Returns:
true
on successful operation.- See Also:
-
captureTheme
public static boolean captureTheme(@Nullable Context context, @Nullable LifecycleOwner owner, int requestCode, @Nullable String theme) Returns an intent to edit or show the dynamic theme.- Parameters:
context
- The context to create the intent.owner
- The requesting owner for the intent.requestCode
- The request code for the intent.theme
- The dynamic app theme extra for the intent.- Returns:
true
on successful operation.- See Also:
-