Class DynamicSystemActivity
- All Implemented Interfaces:
ComponentCallbacks
,ComponentCallbacks2
,SharedPreferences.OnSharedPreferenceChangeListener
,KeyEvent.Callback
,LayoutInflater.Factory
,LayoutInflater.Factory2
,View.OnCreateContextMenuListener
,Window.Callback
,ContextAware
,FullyDrawnReporterOwner
,OnBackPressedDispatcherOwner
,ActivityResultCaller
,ActivityResultRegistryOwner
,ActionBarDrawerToggle.DelegateProvider
,AppCompatCallback
,ActivityCompat.OnRequestPermissionsResultCallback
,ActivityCompat.RequestPermissionsRequestCodeValidator
,OnMultiWindowModeChangedProvider
,OnNewIntentProvider
,OnPictureInPictureModeChangedProvider
,TaskStackBuilder.SupportParentable
,OnConfigurationChangedProvider
,OnTrimMemoryProvider
,KeyEventDispatcher.Component
,MenuHost
,HasDefaultViewModelProviderFactory
,LifecycleOwner
,ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
,DynamicLocale
,DynamicListener
,DynamicTransitionListener
,DynamicProductFlavor
- Direct Known Subclasses:
DynamicSplashActivity
,DynamicStateActivity
,DynamicTutorialActivity
AppCompatActivity
to perform all the system UI related tasks like setting the
status and navigation bar colors, theme, etc. It heavily depends on the DynamicTheme
that can be customised by implementing the corresponding methods.
Extend this activity and implement the various methods according to the requirements.
-
Nested Class Summary
Nested classes/interfaces inherited from class androidx.core.app.ComponentActivity
ComponentActivity.ExtraData
Nested classes/interfaces inherited from class android.app.Activity
Activity.ScreenCaptureCallback
Nested classes/interfaces inherited from class android.content.Context
Context.BindServiceFlags
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
Default background color for the system UI elements like status and navigation bar.protected static final int
Default overlay color for the system UI elements like status and navigation bar.protected static final int
Default tint color for the system UI elements like snackbars, etc.protected static final String
Background color key to maintain its state.protected static final String
Dynamic theme key to maintain its state.protected static final String
Navigation bar color key to maintain its state.protected static final String
Paused state key to maintain its state.protected static final String
Shared element map key to maintain its state.protected static final String
Status bar color key to maintain its state.protected static final String
Transition position key to maintain its state.protected static final String
Transition result code key to maintain its state.protected int
Applied navigation bar color.protected int
Background color used by the activity window.protected Context
Dynamic context used by this activity.protected Locale
Current locale used by this activity.protected AppCompatDelegate
App compat delegate used by this activity.protected final Runnable
Runnable to change the dynamic theme on resume.protected final Runnable
Runnable to finish the activity.protected int
Current navigation bar color.protected boolean
true
if navigation bar theme is applied.protected int
Current status bar color.Fields inherited from class android.app.Activity
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, FULLSCREEN_MODE_REQUEST_ENTER, FULLSCREEN_MODE_REQUEST_EXIT, OVERRIDE_TRANSITION_CLOSE, OVERRIDE_TRANSITION_OPEN, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK
Fields inherited from class android.content.Context
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, APP_SEARCH_SERVICE, APPWIDGET_SERVICE, AUDIO_SERVICE, BATTERY_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_ACTIVITY_STARTS, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_EXTERNAL_SERVICE, BIND_EXTERNAL_SERVICE_LONG, BIND_IMPORTANT, BIND_INCLUDE_CAPABILITIES, BIND_NOT_FOREGROUND, BIND_NOT_PERCEPTIBLE, BIND_PACKAGE_ISOLATED_PROCESS, BIND_SHARED_ISOLATED_PROCESS, BIND_WAIVE_PRIORITY, BIOMETRIC_SERVICE, BLOB_STORE_SERVICE, BLUETOOTH_SERVICE, BUGREPORT_SERVICE, CAMERA_SERVICE, CAPTIONING_SERVICE, CARRIER_CONFIG_SERVICE, CLIPBOARD_SERVICE, COMPANION_DEVICE_SERVICE, CONNECTIVITY_DIAGNOSTICS_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTACT_KEYS_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, CREDENTIAL_SERVICE, CROSS_PROFILE_APPS_SERVICE, DEVICE_ID_DEFAULT, DEVICE_ID_INVALID, DEVICE_LOCK_SERVICE, DEVICE_POLICY_SERVICE, DISPLAY_HASH_SERVICE, DISPLAY_SERVICE, DOMAIN_VERIFICATION_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, EUICC_SERVICE, FILE_INTEGRITY_SERVICE, FINGERPRINT_SERVICE, GAME_SERVICE, GRAMMATICAL_INFLECTION_SERVICE, HARDWARE_PROPERTIES_SERVICE, HEALTHCONNECT_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, IPSEC_SERVICE, JOB_SCHEDULER_SERVICE, KEYGUARD_SERVICE, LAUNCHER_APPS_SERVICE, LAYOUT_INFLATER_SERVICE, LOCALE_SERVICE, LOCATION_SERVICE, MEDIA_COMMUNICATION_SERVICE, MEDIA_METRICS_SERVICE, MEDIA_PROJECTION_SERVICE, MEDIA_ROUTER_SERVICE, MEDIA_SESSION_SERVICE, MIDI_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_NO_LOCALIZED_COLLATORS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NETWORK_STATS_SERVICE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, OVERLAY_SERVICE, PEOPLE_SERVICE, PERFORMANCE_HINT_SERVICE, PERSISTENT_DATA_BLOCK_SERVICE, POWER_SERVICE, PRINT_SERVICE, PROFILING_SERVICE, RECEIVER_EXPORTED, RECEIVER_NOT_EXPORTED, RECEIVER_VISIBLE_TO_INSTANT_APPS, RESTRICTIONS_SERVICE, ROLE_SERVICE, SEARCH_SERVICE, SECURITY_STATE_SERVICE, SENSOR_SERVICE, SHORTCUT_SERVICE, STATUS_BAR_SERVICE, STORAGE_SERVICE, STORAGE_STATS_SERVICE, SYSTEM_HEALTH_SERVICE, TELECOM_SERVICE, TELEPHONY_IMS_SERVICE, TELEPHONY_SERVICE, TELEPHONY_SUBSCRIPTION_SERVICE, TEXT_CLASSIFICATION_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, TV_INPUT_SERVICE, TV_INTERACTIVE_APP_SERVICE, UI_MODE_SERVICE, USAGE_STATS_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_MANAGER_SERVICE, VIBRATOR_SERVICE, VIRTUAL_DEVICE_SERVICE, VPN_MANAGEMENT_SERVICE, WALLPAPER_SERVICE, WIFI_AWARE_SERVICE, WIFI_P2P_SERVICE, WIFI_RTT_RANGING_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
Fields inherited from interface android.content.ComponentCallbacks2
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
Fields inherited from interface com.pranavpandey.android.dynamic.locale.DynamicLocale
HINDI, INDONESIA, PORTUGUESE, RUSSIAN, SPANISH, SPLIT, SYSTEM, TURKISH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkForThemeIntent
(Intent intent) Checks for the valid dynamic theme intent.void
commitFragmentTransaction
(FragmentTransaction fragmentTransaction) Commit the fragment transaction.createConfigurationContext
(Configuration overrideConfiguration) void
finish()
void
Finish the activity properly after checking the shared element transition.int
Get the applied navigation bar color.int
Returns the default background color for this activity.abstract View
Returns the parent content view used by this activity.Returns the context used by this listener.Returns the coordinator layout used by this activity.Get the current locale used by this activity.int
getDefaultColor
(int colorType) This method will be called to resolve the default color according to it's type.getDefaultLocale
(Context context) Fix for app compat 1.2.0.Returns the enter transition used by his listener.Returns the exit transition used by his listener.AppTheme<?>
Returns the dynamic app theme received from the intent.protected LayoutInflater.Factory2
Returns a layout inflater factory for this activity.Returns the reenter transition used by his listener.Returns the return transition used by his listener.AppTheme<?>
This method will be called to return the dynamic app theme for this listener.Returns the dynamic transition listener used by this activity.Returns the view to apply edge-to-edge window insets.Returns the bottom view to apply edge-to-edge window insets.float
int
Get the current (original) navigation bar color.This method will be called to postpone the transition until the returned view is laid.int
This method will be called to get the intended theme styles version for this listener.Get the current saved instance state for this activity.Returns the callback for the shared element transition.Returns the shared element transition.int
Get the current status bar color.String[]
int
This method will be called to return the theme style resource for this listener.int
getThemeRes
(AppTheme<?> theme) This method will be called to return the theme style resource for this listener.int
Returns the transition position of the shared element.int
Returns the transition result code for this activity.boolean
Returns whether to apply edge-to-edge window insets.boolean
Returns whether to apply footer window insets.boolean
Returns whether to apply the dynamic colors for this listener.boolean
Returns whether the dynamic colors are enabled for this listener.boolean
Checks whether to enable edge-to-edge content.boolean
Returns whether to force menu icons for this activity.boolean
Checks whether this activity is launched from the history.boolean
Returns whether the navigation bar theme is applied for this activity.boolean
isNightMode
(boolean resolve) Checks whether the night mode is enabled for this listener.boolean
Returns whether to register a shared preferences listener for this listener.boolean
isPaused()
Checks whether the activity was paused before.boolean
Checks whether this activity should be finished after the transition.boolean
Returns whether the dynamic colors should be extracted from the system for this listener.protected boolean
Returns whether this activity can handle theme intents.boolean
Returns whether the dynamic colors should be extracted from the wallpaper for this listener.protected void
This method will be called after the navigation bar theme has been changed.protected void
This method will be called to adjust elevation of the components like app bar, bottom app bar, etc.onAdjustEnterReturnTransition
(Object transition, boolean enter) This method will be called to optionally to adjust the enter and return transitions before applying.onAdjustExitReenterTransition
(Object transition, boolean exit) This method will be called to optionally to adjust the exit and reenter transitions before applying.void
onApplyTransitions
(boolean exit) This method will be called on applying transitions.protected void
This method will be called after the theme has been changed.void
onAutoThemeChanged
(boolean context) This method will be called when the auto theme change event occurs according to the time.void
protected void
This method will be called to configure on back pressed callback to support API 33 and above.protected void
protected void
This method will be called just before theonCreate(Bundle)
after applying the theme.void
void
onDynamicChanged
(boolean context, boolean recreate) This method will be called when the dynamic change event occurs (like theme, locale, etc.).void
onDynamicColorsChanged
(DynamicColors colors, boolean context) This method will be called when the dynamic color change event occurs according to the wallpaper.void
onDynamicConfigurationChanged
(boolean locale, boolean fontScale, boolean orientation, boolean uiMode, boolean density) This method will be called when the dynamic configuration change event occurs (like locale, font scale, orientation, ui mode, etc.).onFindView
(int resultCode, int position, String transition, int viewId) This method will be called to find the view according to the transition name or resource id.protected void
Setup the shared element transition callbacks to manage it's position on configuration change.void
This method will be called when the navigation bar theme has been changed.protected void
onNewIntent
(Intent intent) protected void
onNewIntent
(Intent intent, boolean newIntent) Setup content according to the intent.void
onPause()
protected void
onPostCreate
(Bundle savedInstanceState) void
onPowerSaveModeChanged
(boolean powerSaveMode) This method will be called when the power save mode has been changed.boolean
onPrepareOptionsMenu
(Menu menu) void
onResume()
void
onSaveInstanceState
(Bundle outState) protected void
This method will be called on setting the fallback activity options on unsupported API levels like overriding a pending transition on API 15 and below.protected void
Setup the shared element transition fot this activity.void
onSharedPreferenceChanged
(SharedPreferences sharedPreferences, String key) protected void
onStartActivityException
(Exception exception) This method will be called when there is an exception on starting the activity from this activity.protected void
onThemeIntent
(String data, String name) This method will be called on successfully verifying the dynamic theme intent.protected void
onUpdateIntent
(Intent intent, boolean newIntent) Update content according to the intent.protected void
Resets the shared element transition.void
setDynamicTransitionListener
(DynamicTransitionListener dynamicTransitionListener) Sets the dynamic transition listener for this activity.void
setNavigationBarColor
(int color) Set the navigation bar color.void
setNavigationBarColorRes
(int colorRes) Set the navigation bar color resource.boolean
Sets whether the navigation bar theme should be applied for this activity.protected boolean
Sets whether the navigation bar theme should be applied for this activity in landscape mode.void
setRootBackground
(int color) Sets the root background color.void
setSharedElementCallback
(SharedElementCallback sharedElementCallback) Sets the callback for the shared element transition.void
setSharedElementTransition
(Transition sharedElementTransition) Sets the shared element transition.void
setStatusBarColor
(int color) Set the status bar color.void
setStatusBarColorRes
(int colorRes) Set the status bar color resource.void
setTransitionPosition
(int transitionPosition) Sets the transition position of the shared element.void
setTransitionResultCode
(int transitionResultCode) Sets the transition result code for this activity.void
Set the translucent navigation bar flag, useful in case of to show the layout behind the navigation bar.void
Set the translucent status bar flag, useful in case ofCollapsingToolbarLayout
.void
setWindowBackground
(int color) Sets the window background color.protected void
setWindowStatusBarColor
(int color) Set the status bar color.void
startActivity
(Intent intent) void
startActivity
(Intent intent, Bundle options) void
startActivityForResult
(Intent intent, int requestCode) void
startActivityForResult
(Intent intent, int requestCode, Bundle options) void
startActivityFromFragment
(Fragment fragment, Intent intent, int requestCode, Bundle options) void
startMotionActivity
(Intent intent, Bundle options) CallstartActivity(Intent, Bundle)
for this activity.void
startMotionActivity
(Intent intent, Bundle options, boolean finish, boolean afterTransition) CallstartActivity(Intent, Bundle)
for this activity.void
startMotionActivity
(Intent intent, Bundle options, boolean motion, boolean finish, boolean afterTransition) CallstartActivity(Intent, Bundle)
for this activity.void
startMotionActivityForResult
(Intent intent, int requestCode, Bundle options) CallstartActivityForResult(Intent, int, Bundle)
for this activity.void
startMotionActivityForResult
(Intent intent, int requestCode, Bundle options, boolean finish, boolean afterTransition) CallstartActivityForResult(Intent, int, Bundle)
for this activity.void
startMotionActivityForResult
(Intent intent, int requestCode, Bundle options, boolean motion, boolean finish, boolean afterTransition) CallstartActivityForResult(Intent, int, Bundle)
for this activity.void
startMotionActivityFromFragment
(Fragment fragment, Intent intent, int requestCode, Bundle options) Called by Fragment.startActivityForResult() to implement its behavior.void
startMotionActivityFromFragment
(Fragment fragment, Intent intent, int requestCode, Bundle options, boolean finish, boolean afterTransition) Called by Fragment.startActivityForResult() to implement its behavior.void
startMotionActivityFromFragment
(Fragment fragment, Intent intent, int requestCode, Bundle options, boolean motion, boolean finish, boolean afterTransition) Called by Fragment.startActivityForResult() to implement its behavior.void
void
protected void
Update navigation bar color according to the supplied parameters.protected void
Update status bar color according to the supplied parameters.protected void
updateTaskDescription
(int color) Update the task description on API 21 and above to match it with the theme color.Methods inherited from class androidx.appcompat.app.AppCompatActivity
addContentView, attachBaseContext, closeOptionsMenu, dispatchKeyEvent, findViewById, getDrawerToggleDelegate, getMenuInflater, getResources, getSupportActionBar, getSupportParentActivityIntent, invalidateOptionsMenu, onConfigurationChanged, onContentChanged, onCreateSupportNavigateUpTaskStack, onKeyDown, onLocalesChanged, onMenuItemSelected, onMenuOpened, onNightModeChanged, onPanelClosed, onPostResume, onPrepareSupportNavigateUpTaskStack, onStart, onStop, onSupportActionModeFinished, onSupportActionModeStarted, onSupportContentChanged, onSupportNavigateUp, onTitleChanged, onWindowStartingSupportActionMode, openOptionsMenu, setContentView, setContentView, setContentView, setSupportActionBar, setSupportProgress, setSupportProgressBarIndeterminate, setSupportProgressBarIndeterminateVisibility, setSupportProgressBarVisibility, setTheme, startSupportActionMode, supportInvalidateOptionsMenu, supportNavigateUpTo, supportRequestWindowFeature, supportShouldUpRecreateTask
Methods inherited from class androidx.fragment.app.FragmentActivity
dump, getSupportFragmentManager, getSupportLoaderManager, onActivityResult, onAttachFragment, onCreateView, onCreateView, onRequestPermissionsResult, onResumeFragments, onStateNotSaved, setEnterSharedElementCallback, setExitSharedElementCallback, startActivityFromFragment, startIntentSenderFromFragment, supportPostponeEnterTransition, validateRequestPermissionsRequestCode
Methods inherited from class androidx.activity.ComponentActivity
addMenuProvider, addMenuProvider, addMenuProvider, addOnConfigurationChangedListener, addOnContextAvailableListener, addOnMultiWindowModeChangedListener, addOnNewIntentListener, addOnPictureInPictureModeChangedListener, addOnTrimMemoryListener, getActivityResultRegistry, getDefaultViewModelCreationExtras, getDefaultViewModelProviderFactory, getFullyDrawnReporter, getLastCustomNonConfigurationInstance, getLifecycle, getOnBackPressedDispatcher, getSavedStateRegistry, getViewModelStore, initializeViewTreeOwners, invalidateMenu, onCreatePanelMenu, onMultiWindowModeChanged, onMultiWindowModeChanged, onPictureInPictureModeChanged, onPictureInPictureModeChanged, onPreparePanel, onRetainCustomNonConfigurationInstance, onRetainNonConfigurationInstance, onTrimMemory, peekAvailableContext, registerForActivityResult, registerForActivityResult, removeMenuProvider, removeOnConfigurationChangedListener, removeOnContextAvailableListener, removeOnMultiWindowModeChangedListener, removeOnNewIntentListener, removeOnPictureInPictureModeChangedListener, removeOnTrimMemoryListener, reportFullyDrawn, startIntentSenderForResult, startIntentSenderForResult
Methods inherited from class androidx.core.app.ComponentActivity
dispatchKeyShortcutEvent, getExtraData, putExtraData, shouldDumpInternalState, superDispatchKeyEvent
Methods inherited from class android.app.Activity
clearOverrideActivityTransition, closeContextMenu, createPendingResult, dismissDialog, dismissKeyboardShortcutsHelper, dispatchGenericMotionEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, enterPictureInPictureMode, enterPictureInPictureMode, finishActivity, finishActivityFromChild, finishAffinity, finishAfterTransition, finishAndRemoveTask, finishFromChild, getActionBar, getApplication, getCaller, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getContentScene, getContentTransitionManager, getCurrentCaller, getCurrentFocus, getFragmentManager, getInitialCaller, getIntent, getLastNonConfigurationInstance, getLaunchedFromPackage, getLaunchedFromUid, getLayoutInflater, getLoaderManager, getLocalClassName, getMaxNumPictureInPictureActions, getMediaController, getOnBackInvokedDispatcher, getParent, getParentActivityIntent, getPreferences, getReferrer, getRequestedOrientation, getSearchEvent, getSplashScreen, getSystemService, getTaskId, getTitle, getTitleColor, getVoiceInteractor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, isActivityTransitionRunning, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isInMultiWindowMode, isInPictureInPictureMode, isLaunchedFromBubble, isLocalVoiceInteractionSupported, isTaskRoot, isVoiceInteraction, isVoiceInteractionRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onActivityReenter, onActivityResult, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onChildTitleChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, onCreateOptionsMenu, onCreatePanelView, onCreateThumbnail, onDetachedFromWindow, onEnterAnimationComplete, onGenericMotionEvent, onGetDirectActions, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLocalVoiceInteractionStarted, onLocalVoiceInteractionStopped, onLowMemory, onNavigateUp, onNavigateUpFromChild, onNewIntent, onOptionsItemSelected, onOptionsMenuClosed, onPerformDirectAction, onPictureInPictureRequested, onPictureInPictureUiStateChanged, onPostCreate, onPrepareDialog, onPrepareDialog, onPrepareNavigateUpTaskStack, onProvideAssistContent, onProvideAssistData, onProvideKeyboardShortcuts, onProvideReferrer, onRequestPermissionsResult, onRestart, onRestoreInstanceState, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onTopResumedActivityChanged, onTouchEvent, onTrackballEvent, onUserInteraction, onUserLeaveHint, onVisibleBehindCanceled, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, overrideActivityTransition, overrideActivityTransition, overridePendingTransition, overridePendingTransition, postponeEnterTransition, recreate, registerActivityLifecycleCallbacks, registerComponentCallbacks, registerForContextMenu, registerScreenCaptureCallback, releaseInstance, removeDialog, requestDragAndDropPermissions, requestFullscreenMode, requestPermissions, requestPermissions, requestShowKeyboardShortcuts, requestVisibleBehind, requestWindowFeature, requireViewById, runOnUiThread, setActionBar, setAllowCrossUidActivitySwitchFromBelow, setContentTransitionManager, setDefaultKeyMode, setEnterSharedElementCallback, setExitSharedElementCallback, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setInheritShowWhenLocked, setIntent, setIntent, setLocusContext, setMediaController, setPictureInPictureParams, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRecentsScreenshotEnabled, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setShouldDockBigOverlays, setShowWhenLocked, setTaskDescription, setTitle, setTitle, setTitleColor, setTranslucent, setTurnScreenOn, setVisible, setVolumeControlStream, setVrModeEnabled, shouldDockBigOverlays, shouldShowRequestPermissionRationale, shouldShowRequestPermissionRationale, shouldUpRecreateTask, showAssist, showDialog, showDialog, showLockTaskEscapeMessage, startActionMode, startActionMode, startActivities, startActivities, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderFromChild, startIntentSenderFromChild, startLocalVoiceInteraction, startLockTask, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startPostponedEnterTransition, startSearch, stopLocalVoiceInteraction, stopLockTask, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterActivityLifecycleCallbacks, unregisterComponentCallbacks, unregisterForContextMenu, unregisterScreenCaptureCallback
Methods inherited from class android.view.ContextThemeWrapper
applyOverrideConfiguration, getAssets, getTheme, setTheme
Methods inherited from class android.content.ContextWrapper
bindIsolatedService, bindService, bindService, bindService, bindService, bindServiceAsUser, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingOrSelfUriPermissions, checkCallingPermission, checkCallingUriPermission, checkCallingUriPermissions, checkContentUriPermissionFull, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermission, checkUriPermissions, clearWallpaper, createAttributionContext, createContext, createContextForSplit, createDeviceContext, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, createWindowContext, createWindowContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAttributionSource, getAttributionTag, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDatabasePath, getDataDir, getDeviceId, getDir, getDisplay, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFilesDir, getFileStreamPath, getMainExecutor, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getParams, getSharedPreferences, getSystemServiceName, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, isUiContext, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerDeviceIdChangeListener, registerReceiver, registerReceiver, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeSelfPermissionsOnKill, revokeUriPermission, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, setWallpaper, startForegroundService, startInstrumentation, startService, stopService, unbindService, unregisterDeviceIdChangeListener, unregisterReceiver, updateServiceGroup
Methods inherited from class android.content.Context
bindIsolatedService, getColor, getColorStateList, getDrawable, getString, getString, getSystemService, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, revokeSelfPermissionOnKill, sendBroadcastWithMultiplePermissions
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface android.view.Window.Callback
onPointerCaptureChanged
-
Field Details
-
ADS_STATE_DYNAMIC_THEME
Dynamic theme key to maintain its state.- See Also:
-
ADS_STATE_BACKGROUND_COLOR
Background color key to maintain its state.- See Also:
-
ADS_STATE_STATUS_BAR_COLOR
Status bar color key to maintain its state.- See Also:
-
ADS_STATE_NAVIGATION_BAR_COLOR
Navigation bar color key to maintain its state.- See Also:
-
ADS_STATE_SHARED_ELEMENT_MAP
Shared element map key to maintain its state.- See Also:
-
ADS_STATE_TRANSITION_RESULT_CODE
Transition result code key to maintain its state.- See Also:
-
ADS_STATE_TRANSITION_POSITION
Transition position key to maintain its state.- See Also:
-
ADS_STATE_PAUSED
Paused state key to maintain its state.- See Also:
-
ADS_DEFAULT_SYSTEM_UI_COLOR
Default tint color for the system UI elements like snackbars, etc. -
ADS_DEFAULT_SYSTEM_BG_COLOR
Default background color for the system UI elements like status and navigation bar. -
ADS_DEFAULT_SYSTEM_OVERLAY_COLOR
Default overlay color for the system UI elements like status and navigation bar. -
mDynamicDelegate
App compat delegate used by this activity. -
mContext
Dynamic context used by this activity. -
mCurrentLocale
Current locale used by this activity. -
mBackgroundColor
Background color used by the activity window. -
mStatusBarColor
Current status bar color. -
mDynamicRunnable
Runnable to change the dynamic theme on resume. -
mFinishRunnable
Runnable to finish the activity.
-
-
Constructor Details
-
DynamicSystemActivity
public DynamicSystemActivity()
-
-
Method Details
-
getDelegate
Fix for app compat 1.2.0. Use custom delegate to fix activity configurations (locale, font scale, etc.) when using along with the application configuration.- Overrides:
getDelegate
in classAppCompatActivity
-
createConfigurationContext
- Overrides:
createConfigurationContext
in classContextWrapper
-
onCreate
- Overrides:
onCreate
in classFragmentActivity
-
onPostCreate
- Overrides:
onPostCreate
in classAppCompatActivity
-
onNewIntent
- Overrides:
onNewIntent
in classComponentActivity
-
onConfigureOnBackPressedDispatcher
protected void onConfigureOnBackPressedDispatcher()This method will be called to configure on back pressed callback to support API 33 and above. -
onNewIntent
Setup content according to the intent.- Parameters:
intent
- The received intent.newIntent
-true
if updating from the new intent.
-
onUpdateIntent
Update content according to the intent.- Parameters:
intent
- The received intent.newIntent
-true
if updating from the new intent.
-
isThemeActivity
protected boolean isThemeActivity()Returns whether this activity can handle theme intents.- Returns:
true
if this activity can handle theme intents.- See Also:
-
checkForThemeIntent
Checks for the valid dynamic theme intent.- Parameters:
intent
- The intent to be checked.- See Also:
-
onThemeIntent
This method will be called on successfully verifying the dynamic theme intent.- Parameters:
data
- The theme data retrieved from the intent.name
- The theme or file name retrieved from the intent.- See Also:
-
onApplyTransitions
public void onApplyTransitions(boolean exit) Description copied from interface:DynamicTransitionListener
This method will be called on applying transitions.It is recommended to do any shared element adjustments here like postponing the transition.
- Specified by:
onApplyTransitions
in interfaceDynamicTransitionListener
- Parameters:
exit
-true
if the activity is exiting.
-
getDynamicEnterTransition
Description copied from interface:DynamicTransitionListener
Returns the enter transition used by his listener.- Specified by:
getDynamicEnterTransition
in interfaceDynamicTransitionListener
- Returns:
- The enter transition used by his listener.
- See Also:
-
getDynamicReturnTransition
Description copied from interface:DynamicTransitionListener
Returns the return transition used by his listener.- Specified by:
getDynamicReturnTransition
in interfaceDynamicTransitionListener
- Returns:
- The return transition transition used by his listener.
- See Also:
-
getDynamicExitTransition
Description copied from interface:DynamicTransitionListener
Returns the exit transition used by his listener.- Specified by:
getDynamicExitTransition
in interfaceDynamicTransitionListener
- Returns:
- The exit transition used by his listener.
- See Also:
-
getDynamicReenterTransition
Description copied from interface:DynamicTransitionListener
Returns the reenter transition used by his listener.- Specified by:
getDynamicReenterTransition
in interfaceDynamicTransitionListener
- Returns:
- The reenter transition used by his listener.
- See Also:
-
onAdjustEnterReturnTransition
Description copied from interface:DynamicTransitionListener
This method will be called to optionally to adjust the enter and return transitions before applying.- Specified by:
onAdjustEnterReturnTransition
in interfaceDynamicTransitionListener
- Parameters:
transition
- The transition to be adjusted.enter
-true
if enter transition, otherwise return transition.- Returns:
- The adjusted enter or return transition before applying.
- See Also:
-
onAdjustExitReenterTransition
Description copied from interface:DynamicTransitionListener
This method will be called to optionally to adjust the exit and reenter transitions before applying.- Specified by:
onAdjustExitReenterTransition
in interfaceDynamicTransitionListener
- Parameters:
transition
- The transition to be adjusted.exit
-true
if exit transition, otherwise reenter transition.- Returns:
- The adjusted exit or reenter transition before applying.
- See Also:
-
getPostponeTransitionView
Description copied from interface:DynamicTransitionListener
This method will be called to postpone the transition until the returned view is laid.It will be called only on API 21 and above.
- Specified by:
getPostponeTransitionView
in interfaceDynamicTransitionListener
- Returns:
- The view to postpone the transition.
-
onFindView
@Nullable public View onFindView(int resultCode, int position, @NonNull String transition, @IdRes int viewId) Description copied from interface:DynamicTransitionListener
This method will be called to find the view according to the transition name or resource id.It will be called only on API 21 and above.
- Specified by:
onFindView
in interfaceDynamicTransitionListener
- Parameters:
resultCode
- The transition result code.position
- The position of the shared element.transition
- The transition name of the view.viewId
- The id resource to find the view by id.- Returns:
- The view according to the view id.
-
commitFragmentTransaction
Commit the fragment transaction.- Parameters:
fragmentTransaction
- The fragment transaction to be committed.
-
onSaveInstanceState
- Overrides:
onSaveInstanceState
in classComponentActivity
-
getSupportedLocales
- Specified by:
getSupportedLocales
in interfaceDynamicLocale
-
getDefaultLocale
- Specified by:
getDefaultLocale
in interfaceDynamicLocale
-
getLocale
- Specified by:
getLocale
in interfaceDynamicLocale
-
setLocale
- Specified by:
setLocale
in interfaceDynamicLocale
-
getFontScale
public float getFontScale()- Specified by:
getFontScale
in interfaceDynamicLocale
-
onCustomiseTheme
protected void onCustomiseTheme()This method will be called just before theonCreate(Bundle)
after applying the theme.Override this method to customise the theme further.
-
onAdjustElevation
protected void onAdjustElevation()This method will be called to adjust elevation of the components like app bar, bottom app bar, etc. -
getDynamicLayoutInflater
Returns a layout inflater factory for this activity.It will be used to replace the app compat widgets with their dynamic counterparts to provide the support for dynamic theme.
Override this method to provide a custom layout inflater.
- Returns:
- The layout inflater factory for this activity.
-
getContentView
Returns the parent content view used by this activity.- Returns:
- The parent content view used by this activity.
-
getCurrentLocale
Get the current locale used by this activity.- Returns:
- The current locale used by this activity.
-
getSavedInstanceState
Get the current saved instance state for this activity.- Returns:
- The current saved instance state for this activity.
-
getDynamicIntentTheme
Returns the dynamic app theme received from the intent.- Returns:
- The dynamic app theme received from the intent.
-
getTransitionResultCode
public int getTransitionResultCode()Returns the transition result code for this activity.- Returns:
- The transition result code for this activity.
-
setTransitionResultCode
public void setTransitionResultCode(int transitionResultCode) Sets the transition result code for this activity.- Parameters:
transitionResultCode
- The transition result code to be set.
-
getTransitionPosition
public int getTransitionPosition()Returns the transition position of the shared element.- Returns:
- The transition position of the shared element.
-
setTransitionPosition
public void setTransitionPosition(int transitionPosition) Sets the transition position of the shared element.- Parameters:
transitionPosition
- The transition position to be set.
-
getDynamicTransitionListener
Returns the dynamic transition listener used by this activity.- Returns:
- The dynamic transition listener used by this activity.
-
isLaunchedFromHistory
public boolean isLaunchedFromHistory()Checks whether this activity is launched from the history.- Returns:
true
if this activity is launched from the history.
-
onAppThemeChange
protected void onAppThemeChange()This method will be called after the theme has been changed.Override this method to perform operations after the theme has been changed like re-initialize the
DynamicTheme
with new colors, etc. -
getBackgroundColor
Returns the default background color for this activity.- Returns:
- The default background color for this activity.
-
setWindowBackground
Sets the window background color.- Parameters:
color
- The window background color to be set.- See Also:
-
setRootBackground
Sets the root background color.- Parameters:
color
- The root background color to be set.- See Also:
-
R.id.ads_activity_root
Dynamic.setRootBackground(Object, int)
-
setWindowStatusBarColor
Set the status bar color.It will be applied only on the API 21 and above.
- Parameters:
color
- Color to be applied on the status bar.
-
setStatusBarColor
Set the status bar color.It will be applied only on the API 21 and above.
- Parameters:
color
- The color to be applied.
-
setStatusBarColorRes
Set the status bar color resource.It will be applied only on the API 21 and above.
- Parameters:
colorRes
- The color resource to be applied.
-
setTranslucentStatusBar
public void setTranslucentStatusBar()Set the translucent status bar flag, useful in case ofCollapsingToolbarLayout
.It will be applied only on the API 21 and above.
-
updateStatusBar
protected void updateStatusBar()Update status bar color according to the supplied parameters. It will automatically check for the light or dark color and will change the status bar icons or background accordingly so that the icons will always be visible. -
isEdgeToEdgeContent
public boolean isEdgeToEdgeContent()Checks whether to enable edge-to-edge content.Override this method to provide your own implementation.
- Returns:
true
to enable edge-to-edge content.
-
getEdgeToEdgeView
Returns the view to apply edge-to-edge window insets.- Returns:
- The view to apply edge-to-edge window insets.
- See Also:
-
isApplyEdgeToEdgeInsets
public boolean isApplyEdgeToEdgeInsets()Returns whether to apply edge-to-edge window insets.- Returns:
true
to apply edge-to-edge window insets.- See Also:
-
getEdgeToEdgeViewBottom
Returns the bottom view to apply edge-to-edge window insets.- Returns:
- The bottom view to apply edge-to-edge window insets.
- See Also:
-
getCoordinatorLayout
Returns the coordinator layout used by this activity.- Returns:
- The coordinator layout used by this activity.
-
getStatusBarColor
Get the current status bar color.- Returns:
- The current status bar color.
-
startActivity
- Overrides:
startActivity
in classActivity
-
startActivity
- Overrides:
startActivity
in classActivity
-
startActivityForResult
- Overrides:
startActivityForResult
in classComponentActivity
-
startActivityForResult
- Overrides:
startActivityForResult
in classComponentActivity
-
startActivityFromFragment
public void startActivityFromFragment(@NonNull Fragment fragment, Intent intent, int requestCode, @Nullable Bundle options) - Overrides:
startActivityFromFragment
in classFragmentActivity
-
startMotionActivity
public void startMotionActivity(Intent intent, @Nullable Bundle options, boolean motion, boolean finish, boolean afterTransition) CallstartActivity(Intent, Bundle)
for this activity.It will allow
Bundle
options ifDynamicMotion.isMotion()
is enabled.- Parameters:
intent
- The intent to be used.options
- The intent to be set.motion
-true
if motion is enabled.finish
-true
to finish calling activity.afterTransition
-true
to finish the calling activity after transition.
-
startMotionActivity
public void startMotionActivity(Intent intent, @Nullable Bundle options, boolean finish, boolean afterTransition) CallstartActivity(Intent, Bundle)
for this activity.It will allow
Bundle
options ifDynamicMotion.isMotion()
is enabled.- Parameters:
intent
- The intent to be used.options
- The intent to be set.finish
-true
to finish calling activity.afterTransition
-true
to finish the calling activity after transition.- See Also:
-
startMotionActivityForResult
public void startMotionActivityForResult(Intent intent, int requestCode, @Nullable Bundle options, boolean motion, boolean finish, boolean afterTransition) CallstartActivityForResult(Intent, int, Bundle)
for this activity.It will allow
Bundle
options ifDynamicMotion.isMotion()
is enabled.- Parameters:
intent
- The intent to be used.requestCode
- The request code to be set.options
- The intent to be set.motion
-true
if motion is enabled.finish
-true
to finish calling activity.afterTransition
-true
to finish the calling activity after transition.
-
startMotionActivityForResult
public void startMotionActivityForResult(Intent intent, int requestCode, @Nullable Bundle options, boolean finish, boolean afterTransition) CallstartActivityForResult(Intent, int, Bundle)
for this activity.It will allow
Bundle
options ifDynamicMotion.isMotion()
is enabled.- Parameters:
intent
- The intent to be used.requestCode
- The request code to be set.options
- The intent to be set.finish
-true
to finish calling activity.afterTransition
-true
to finish the calling activity after transition.- See Also:
-
startMotionActivityForResult
CallstartActivityForResult(Intent, int, Bundle)
for this activity.It will allow
Bundle
options ifDynamicMotion.isMotion()
is enabled.- Parameters:
intent
- The intent to be used.requestCode
- The request code to be set.options
- The intent to be set.
-
startMotionActivity
CallstartActivity(Intent, Bundle)
for this activity.It will allow
Bundle
options ifDynamicMotion.isMotion()
is enabled.- Parameters:
intent
- The intent to be used.options
- The intent to be set.
-
startMotionActivityFromFragment
public void startMotionActivityFromFragment(@NonNull Fragment fragment, Intent intent, int requestCode, @Nullable Bundle options, boolean motion, boolean finish, boolean afterTransition) Called by Fragment.startActivityForResult() to implement its behavior.It will allow
Bundle
options ifDynamicMotion.isMotion()
is enabled.- Parameters:
fragment
- The calling fragment.intent
- The intent to be used.requestCode
- The request code to be set.options
- The intent to be set.motion
-true
if motion is enabled.finish
-true
to finish calling activity.afterTransition
-true
to finish the calling activity after transition.
-
startMotionActivityFromFragment
public void startMotionActivityFromFragment(@NonNull Fragment fragment, Intent intent, int requestCode, @Nullable Bundle options, boolean finish, boolean afterTransition) Called by Fragment.startActivityForResult() to implement its behavior.It will allow
Bundle
options ifDynamicMotion.isMotion()
is enabled.- Parameters:
fragment
- The calling fragment.intent
- The intent to be used.requestCode
- The request code to be set.options
- The intent to be set.finish
-true
to finish calling activity.afterTransition
-true
to finish the calling activity after transition.- See Also:
-
startMotionActivityFromFragment
public void startMotionActivityFromFragment(@NonNull Fragment fragment, Intent intent, int requestCode, @Nullable Bundle options) Called by Fragment.startActivityForResult() to implement its behavior.It will allow
Bundle
options ifDynamicMotion.isMotion()
is enabled.- Parameters:
fragment
- The calling fragment.intent
- The intent to be used.requestCode
- The request code to be set.options
- The intent to be set.
-
onStartActivityException
This method will be called when there is an exception on starting the activity from this activity.- Parameters:
exception
- The exception occurred.- See Also:
-
isForceMenuIcons
public boolean isForceMenuIcons()Returns whether to force menu icons for this activity.- Returns:
true
if force menu icons for this activity.- See Also:
-
onPrepareOptionsMenu
- Overrides:
onPrepareOptionsMenu
in classActivity
-
onResume
public void onResume()- Overrides:
onResume
in classFragmentActivity
-
onPause
public void onPause()- Overrides:
onPause
in classFragmentActivity
-
onDestroy
public void onDestroy()- Overrides:
onDestroy
in classAppCompatActivity
-
getProductFlavor
- Specified by:
getProductFlavor
in interfaceDynamicProductFlavor
-
getContext
Description copied from interface:DynamicListener
Returns the context used by this listener.- Specified by:
getContext
in interfaceDynamicListener
- Returns:
- The context used by this listener.
-
getRequiredThemeVersion
public int getRequiredThemeVersion()Description copied from interface:DynamicListener
This method will be called to get the intended theme styles version for this listener.- Specified by:
getRequiredThemeVersion
in interfaceDynamicListener
- Returns:
- The intended theme styles version for this listener.
-
isNightMode
public boolean isNightMode(boolean resolve) Description copied from interface:DynamicListener
Checks whether the night mode is enabled for this listener.- Specified by:
isNightMode
in interfaceDynamicListener
- Parameters:
resolve
-true
to resolve based on the theme data.- Returns:
true
if the night mode is enabled for this listener.
-
getThemeRes
Description copied from interface:DynamicListener
This method will be called to return the theme style resource for this listener.Override this method to supply your own customised style.
- Specified by:
getThemeRes
in interfaceDynamicListener
- Returns:
- The theme style resource for this listener.
- See Also:
-
getDynamicTheme
Description copied from interface:DynamicListener
This method will be called to return the dynamic app theme for this listener.Override this method to supply your own customised theme.
- Specified by:
getDynamicTheme
in interfaceDynamicListener
- Returns:
- The dynamic app theme for this listener.
-
isDynamicColors
public boolean isDynamicColors()Description copied from interface:DynamicListener
Returns whether the dynamic colors are enabled for this listener.- Specified by:
isDynamicColors
in interfaceDynamicListener
- Returns:
true
if the dynamic colors are enabled for this listener.
-
isDynamicColor
public boolean isDynamicColor()Description copied from interface:DynamicListener
Returns whether to apply the dynamic colors for this listener.- Specified by:
isDynamicColor
in interfaceDynamicListener
- Returns:
true
if the dynamic colors should be applied for this listener.
-
isSystemColor
public boolean isSystemColor()Description copied from interface:DynamicListener
Returns whether the dynamic colors should be extracted from the system for this listener.- Specified by:
isSystemColor
in interfaceDynamicListener
- Returns:
true
if the dynamic colors should be extracted from the system for this listener
-
isWallpaperColor
public boolean isWallpaperColor()Description copied from interface:DynamicListener
Returns whether the dynamic colors should be extracted from the wallpaper for this listener.- Specified by:
isWallpaperColor
in interfaceDynamicListener
- Returns:
true
if the dynamic colors should be extracted from the wallpaper for this listener
-
getDefaultColor
Description copied from interface:DynamicListener
This method will be called to resolve the default color according to it's type.It is useful in resolving the color if the default theme also has auto values.
- Specified by:
getDefaultColor
in interfaceDynamicListener
- Parameters:
colorType
- The color type to be resolved.- Returns:
- The resolved default color according to the color type.
- See Also:
-
onDynamicChanged
public void onDynamicChanged(boolean context, boolean recreate) Description copied from interface:DynamicListener
This method will be called when the dynamic change event occurs (like theme, locale, etc.).Recreate the activity or application here to adapt changes.
- Specified by:
onDynamicChanged
in interfaceDynamicListener
- Parameters:
context
-true
if there is a context change and it must be reinitialized.recreate
-true
if listener must be recreated to adapt the changes.
-
onDynamicConfigurationChanged
public void onDynamicConfigurationChanged(boolean locale, boolean fontScale, boolean orientation, boolean uiMode, boolean density) Description copied from interface:DynamicListener
This method will be called when the dynamic configuration change event occurs (like locale, font scale, orientation, ui mode, etc.).It will provide more control on
DynamicListener.onDynamicChanged(boolean, boolean)
method call.- Specified by:
onDynamicConfigurationChanged
in interfaceDynamicListener
- Parameters:
locale
-true
if locale is changed.fontScale
-true
if font scale is changed.orientation
-true
if there is an orientation change.uiMode
-true
if ui mode is changed.density
-true
if configuration density is changed.- See Also:
-
onAutoThemeChanged
public void onAutoThemeChanged(boolean context) Description copied from interface:DynamicListener
This method will be called when the auto theme change event occurs according to the time.Recreate the activity or application here to adapt changes.
- Specified by:
onAutoThemeChanged
in interfaceDynamicListener
- Parameters:
context
-true
if there is a context change and it must be reinitialized.
-
onPowerSaveModeChanged
public void onPowerSaveModeChanged(boolean powerSaveMode) Description copied from interface:DynamicListener
This method will be called when the power save mode has been changed.It will be called only on API 21 and above.
- Specified by:
onPowerSaveModeChanged
in interfaceDynamicListener
- Parameters:
powerSaveMode
-true
if the device is in power save mode.
-
updateTaskDescription
Update the task description on API 21 and above to match it with the theme color.- Parameters:
color
- The color to be set.
-
onBackPressed
public void onBackPressed()- Overrides:
onBackPressed
in classComponentActivity
-
finish
public void finish() -
supportStartPostponedEnterTransition
public void supportStartPostponedEnterTransition()- Overrides:
supportStartPostponedEnterTransition
in classFragmentActivity
-
supportFinishAfterTransition
public void supportFinishAfterTransition()- Overrides:
supportFinishAfterTransition
in classFragmentActivity
-
onSetFallbackActivityOptions
protected void onSetFallbackActivityOptions()This method will be called on setting the fallback activity options on unsupported API levels like overriding a pending transition on API 15 and below. -
isSupportFinishAfterTransition
public boolean isSupportFinishAfterTransition()Checks whether this activity should be finished after the transition.- Returns:
- Returns
true
if this activity should be finished after the transition. - See Also:
-
isPaused
public boolean isPaused()Checks whether the activity was paused before.- Returns:
true
if the activity was paused before.
-
finishActivity
public void finishActivity()Finish the activity properly after checking the shared element transition.
-