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.ExtraDataNested classes/interfaces inherited from class android.app.Activity
Activity.ScreenCaptureCallbackNested classes/interfaces inherited from class android.content.Context
Context.BindServiceFlags -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intDefault background color for the system UI elements like status and navigation bar.protected static final intDefault overlay color for the system UI elements like status and navigation bar.protected static final intDefault tint color for the system UI elements like snackbars, etc.protected static final StringBackground color key to maintain its state.protected static final StringDynamic theme key to maintain its state.protected static final StringNavigation bar color key to maintain its state.protected static final StringPaused state key to maintain its state.protected static final StringShared element map key to maintain its state.protected static final StringStatus bar color key to maintain its state.protected static final StringTransition position key to maintain its state.protected static final StringTransition result code key to maintain its state.protected intApplied navigation bar color.protected intBackground color used by the activity window.protected ContextDynamic context used by this activity.protected LocaleCurrent locale used by this activity.protected AppCompatDelegateApp compat delegate used by this activity.protected final RunnableRunnable to change the dynamic theme on resume.protected final RunnableRunnable to finish the activity.protected intCurrent navigation bar color.protected booleantrueif navigation bar theme is applied.protected intCurrent 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_OKFields 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_SERVICEFields 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_HIDDENFields inherited from interface com.pranavpandey.android.dynamic.locale.DynamicLocale
HINDI, INDONESIA, PORTUGUESE, RUSSIAN, SPANISH, SPLIT, SYSTEM, TURKISH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckForThemeIntent(Intent intent) Checks for the valid dynamic theme intent.voidcommitFragmentTransaction(FragmentTransaction fragmentTransaction) Commit the fragment transaction.createConfigurationContext(Configuration overrideConfiguration) voidfinish()voidFinish the activity properly after checking the shared element transition.intGet the applied navigation bar color.intReturns the default background color for this activity.abstract ViewReturns 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.intgetDefaultColor(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.Factory2Returns 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.floatintGet the current (original) navigation bar color.This method will be called to postpone the transition until the returned view is laid.intThis 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.intGet the current status bar color.String[]intThis method will be called to return the theme style resource for this listener.intgetThemeRes(AppTheme<?> theme) This method will be called to return the theme style resource for this listener.intReturns the transition position of the shared element.intReturns the transition result code for this activity.booleanReturns whether to apply edge-to-edge window insets.booleanReturns whether to apply footer window insets.booleanReturns whether to apply the dynamic colors for this listener.booleanReturns whether the dynamic colors are enabled for this listener.booleanChecks whether to enable edge-to-edge content.booleanReturns whether to force menu icons for this activity.booleanChecks whether this activity is launched from the history.booleanReturns whether the navigation bar theme is applied for this activity.booleanisNightMode(boolean resolve) Checks whether the night mode is enabled for this listener.booleanReturns whether to register a shared preferences listener for this listener.booleanisPaused()Checks whether the activity was paused before.booleanChecks whether this activity should be finished after the transition.booleanReturns whether the dynamic colors should be extracted from the system for this listener.protected booleanReturns whether this activity can handle theme intents.booleanReturns whether the dynamic colors should be extracted from the wallpaper for this listener.protected voidThis method will be called after the navigation bar theme has been changed.protected voidThis 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.voidonApplyTransitions(boolean exit) This method will be called on applying transitions.protected voidThis method will be called after the theme has been changed.voidonAutoThemeChanged(boolean context) This method will be called when the auto theme change event occurs according to the time.voidprotected voidThis method will be called to configure on back pressed callback to support API 33 and above.protected voidprotected voidThis method will be called just before theonCreate(Bundle)after applying the theme.voidvoidonDynamicChanged(boolean context, boolean recreate) This method will be called when the dynamic change event occurs (like theme, locale, etc.).voidonDynamicColorsChanged(DynamicColors colors, boolean context) This method will be called when the dynamic color change event occurs according to the wallpaper.voidonDynamicConfigurationChanged(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 voidSetup the shared element transition callbacks to manage it's position on configuration change.voidThis method will be called when the navigation bar theme has been changed.protected voidonNewIntent(Intent intent) protected voidonNewIntent(Intent intent, boolean newIntent) Setup content according to the intent.voidonPause()protected voidonPostCreate(Bundle savedInstanceState) voidonPowerSaveModeChanged(boolean powerSaveMode) This method will be called when the power save mode has been changed.booleanonPrepareOptionsMenu(Menu menu) voidonResume()voidonSaveInstanceState(Bundle outState) protected voidThis 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 voidSetup the shared element transition fot this activity.voidonSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) protected voidonStartActivityException(Exception exception) This method will be called when there is an exception on starting the activity from this activity.protected voidonThemeIntent(String data, String name) This method will be called on successfully verifying the dynamic theme intent.protected voidonUpdateIntent(Intent intent, boolean newIntent) Update content according to the intent.protected voidResets the shared element transition.voidsetDynamicTransitionListener(DynamicTransitionListener dynamicTransitionListener) Sets the dynamic transition listener for this activity.voidsetNavigationBarColor(int color) Set the navigation bar color.voidsetNavigationBarColorRes(int colorRes) Set the navigation bar color resource.booleanSets whether the navigation bar theme should be applied for this activity.protected booleanSets whether the navigation bar theme should be applied for this activity in landscape mode.voidsetRootBackground(int color) Sets the root background color.voidsetSharedElementCallback(SharedElementCallback sharedElementCallback) Sets the callback for the shared element transition.voidsetSharedElementTransition(Transition sharedElementTransition) Sets the shared element transition.voidsetStatusBarColor(int color) Set the status bar color.voidsetStatusBarColorRes(int colorRes) Set the status bar color resource.voidsetTransitionPosition(int transitionPosition) Sets the transition position of the shared element.voidsetTransitionResultCode(int transitionResultCode) Sets the transition result code for this activity.voidSet the translucent navigation bar flag, useful in case of to show the layout behind the navigation bar.voidSet the translucent status bar flag, useful in case ofCollapsingToolbarLayout.voidsetWindowBackground(int color) Sets the window background color.protected voidsetWindowStatusBarColor(int color) Set the status bar color.voidstartActivity(Intent intent) voidstartActivity(Intent intent, Bundle options) voidstartActivityForResult(Intent intent, int requestCode) voidstartActivityForResult(Intent intent, int requestCode, Bundle options) voidstartActivityFromFragment(Fragment fragment, Intent intent, int requestCode, Bundle options) voidstartMotionActivity(Intent intent, Bundle options) CallstartActivity(Intent, Bundle)for this activity.voidstartMotionActivity(Intent intent, Bundle options, boolean finish, boolean afterTransition) CallstartActivity(Intent, Bundle)for this activity.voidstartMotionActivity(Intent intent, Bundle options, boolean motion, boolean finish, boolean afterTransition) CallstartActivity(Intent, Bundle)for this activity.voidstartMotionActivityForResult(Intent intent, int requestCode, Bundle options) CallstartActivityForResult(Intent, int, Bundle)for this activity.voidstartMotionActivityForResult(Intent intent, int requestCode, Bundle options, boolean finish, boolean afterTransition) CallstartActivityForResult(Intent, int, Bundle)for this activity.voidstartMotionActivityForResult(Intent intent, int requestCode, Bundle options, boolean motion, boolean finish, boolean afterTransition) CallstartActivityForResult(Intent, int, Bundle)for this activity.voidstartMotionActivityFromFragment(Fragment fragment, Intent intent, int requestCode, Bundle options) Called by Fragment.startActivityForResult() to implement its behavior.voidstartMotionActivityFromFragment(Fragment fragment, Intent intent, int requestCode, Bundle options, boolean finish, boolean afterTransition) Called by Fragment.startActivityForResult() to implement its behavior.voidstartMotionActivityFromFragment(Fragment fragment, Intent intent, int requestCode, Bundle options, boolean motion, boolean finish, boolean afterTransition) Called by Fragment.startActivityForResult() to implement its behavior.voidvoidprotected voidUpdate navigation bar color according to the supplied parameters.protected voidUpdate status bar color according to the supplied parameters.protected voidupdateTaskDescription(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, supportShouldUpRecreateTaskMethods inherited from class androidx.fragment.app.FragmentActivity
dump, getSupportFragmentManager, getSupportLoaderManager, onActivityResult, onAttachFragment, onCreateView, onCreateView, onRequestPermissionsResult, onResumeFragments, onStateNotSaved, setEnterSharedElementCallback, setExitSharedElementCallback, startActivityFromFragment, startIntentSenderFromFragment, supportPostponeEnterTransition, validateRequestPermissionsRequestCodeMethods 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, startIntentSenderForResultMethods inherited from class androidx.core.app.ComponentActivity
dispatchKeyShortcutEvent, getExtraData, putExtraData, shouldDumpInternalState, superDispatchKeyEventMethods 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, unregisterScreenCaptureCallbackMethods inherited from class android.view.ContextThemeWrapper
applyOverrideConfiguration, getAssets, getTheme, setThemeMethods 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, updateServiceGroupMethods inherited from class android.content.Context
bindIsolatedService, getColor, getColorStateList, getDrawable, getString, getString, getSystemService, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, revokeSelfPermissionOnKill, sendBroadcastWithMultiplePermissionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getDelegatein classAppCompatActivity
-
createConfigurationContext
- Overrides:
createConfigurationContextin classContextWrapper
-
onCreate
- Overrides:
onCreatein classFragmentActivity
-
onPostCreate
- Overrides:
onPostCreatein classAppCompatActivity
-
onNewIntent
- Overrides:
onNewIntentin 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-trueif updating from the new intent.
-
onUpdateIntent
Update content according to the intent.- Parameters:
intent- The received intent.newIntent-trueif updating from the new intent.
-
isThemeActivity
protected boolean isThemeActivity()Returns whether this activity can handle theme intents.- Returns:
trueif 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:DynamicTransitionListenerThis method will be called on applying transitions.It is recommended to do any shared element adjustments here like postponing the transition.
- Specified by:
onApplyTransitionsin interfaceDynamicTransitionListener- Parameters:
exit-trueif the activity is exiting.
-
getDynamicEnterTransition
Description copied from interface:DynamicTransitionListenerReturns the enter transition used by his listener.- Specified by:
getDynamicEnterTransitionin interfaceDynamicTransitionListener- Returns:
- The enter transition used by his listener.
- See Also:
-
getDynamicReturnTransition
Description copied from interface:DynamicTransitionListenerReturns the return transition used by his listener.- Specified by:
getDynamicReturnTransitionin interfaceDynamicTransitionListener- Returns:
- The return transition transition used by his listener.
- See Also:
-
getDynamicExitTransition
Description copied from interface:DynamicTransitionListenerReturns the exit transition used by his listener.- Specified by:
getDynamicExitTransitionin interfaceDynamicTransitionListener- Returns:
- The exit transition used by his listener.
- See Also:
-
getDynamicReenterTransition
Description copied from interface:DynamicTransitionListenerReturns the reenter transition used by his listener.- Specified by:
getDynamicReenterTransitionin interfaceDynamicTransitionListener- Returns:
- The reenter transition used by his listener.
- See Also:
-
onAdjustEnterReturnTransition
Description copied from interface:DynamicTransitionListenerThis method will be called to optionally to adjust the enter and return transitions before applying.- Specified by:
onAdjustEnterReturnTransitionin interfaceDynamicTransitionListener- Parameters:
transition- The transition to be adjusted.enter-trueif enter transition, otherwise return transition.- Returns:
- The adjusted enter or return transition before applying.
- See Also:
-
onAdjustExitReenterTransition
Description copied from interface:DynamicTransitionListenerThis method will be called to optionally to adjust the exit and reenter transitions before applying.- Specified by:
onAdjustExitReenterTransitionin interfaceDynamicTransitionListener- Parameters:
transition- The transition to be adjusted.exit-trueif exit transition, otherwise reenter transition.- Returns:
- The adjusted exit or reenter transition before applying.
- See Also:
-
getPostponeTransitionView
Description copied from interface:DynamicTransitionListenerThis 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:
getPostponeTransitionViewin 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:DynamicTransitionListenerThis 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:
onFindViewin 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:
onSaveInstanceStatein classComponentActivity
-
getSupportedLocales
- Specified by:
getSupportedLocalesin interfaceDynamicLocale
-
getDefaultLocale
- Specified by:
getDefaultLocalein interfaceDynamicLocale
-
getLocale
- Specified by:
getLocalein interfaceDynamicLocale
-
setLocale
- Specified by:
setLocalein interfaceDynamicLocale
-
getFontScale
public float getFontScale()- Specified by:
getFontScalein 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:
trueif 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
DynamicThemewith 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_rootDynamic.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:
trueto 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:
trueto 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:
startActivityin classActivity
-
startActivity
- Overrides:
startActivityin classActivity
-
startActivityForResult
- Overrides:
startActivityForResultin classComponentActivity
-
startActivityForResult
- Overrides:
startActivityForResultin classComponentActivity
-
startActivityFromFragment
public void startActivityFromFragment(@NonNull Fragment fragment, Intent intent, int requestCode, @Nullable Bundle options) - Overrides:
startActivityFromFragmentin 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
Bundleoptions ifDynamicMotion.isMotion()is enabled.- Parameters:
intent- The intent to be used.options- The intent to be set.motion-trueif motion is enabled.finish-trueto finish calling activity.afterTransition-trueto 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
Bundleoptions ifDynamicMotion.isMotion()is enabled.- Parameters:
intent- The intent to be used.options- The intent to be set.finish-trueto finish calling activity.afterTransition-trueto 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
Bundleoptions 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-trueif motion is enabled.finish-trueto finish calling activity.afterTransition-trueto 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
Bundleoptions 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-trueto finish calling activity.afterTransition-trueto finish the calling activity after transition.- See Also:
-
startMotionActivityForResult
CallstartActivityForResult(Intent, int, Bundle)for this activity.It will allow
Bundleoptions 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
Bundleoptions 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
Bundleoptions 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-trueif motion is enabled.finish-trueto finish calling activity.afterTransition-trueto 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
Bundleoptions 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-trueto finish calling activity.afterTransition-trueto 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
Bundleoptions 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:
trueif force menu icons for this activity.- See Also:
-
onPrepareOptionsMenu
- Overrides:
onPrepareOptionsMenuin classActivity
-
onResume
public void onResume()- Overrides:
onResumein classFragmentActivity
-
onPause
public void onPause()- Overrides:
onPausein classFragmentActivity
-
onDestroy
public void onDestroy()- Overrides:
onDestroyin classAppCompatActivity
-
getProductFlavor
- Specified by:
getProductFlavorin interfaceDynamicProductFlavor
-
getContext
Description copied from interface:DynamicListenerReturns the context used by this listener.- Specified by:
getContextin interfaceDynamicListener- Returns:
- The context used by this listener.
-
getRequiredThemeVersion
public int getRequiredThemeVersion()Description copied from interface:DynamicListenerThis method will be called to get the intended theme styles version for this listener.- Specified by:
getRequiredThemeVersionin interfaceDynamicListener- Returns:
- The intended theme styles version for this listener.
-
isNightMode
public boolean isNightMode(boolean resolve) Description copied from interface:DynamicListenerChecks whether the night mode is enabled for this listener.- Specified by:
isNightModein interfaceDynamicListener- Parameters:
resolve-trueto resolve based on the theme data.- Returns:
trueif the night mode is enabled for this listener.
-
getThemeRes
Description copied from interface:DynamicListenerThis method will be called to return the theme style resource for this listener.Override this method to supply your own customised style.
- Specified by:
getThemeResin interfaceDynamicListener- Returns:
- The theme style resource for this listener.
- See Also:
-
getDynamicTheme
Description copied from interface:DynamicListenerThis method will be called to return the dynamic app theme for this listener.Override this method to supply your own customised theme.
- Specified by:
getDynamicThemein interfaceDynamicListener- Returns:
- The dynamic app theme for this listener.
-
isDynamicColors
public boolean isDynamicColors()Description copied from interface:DynamicListenerReturns whether the dynamic colors are enabled for this listener.- Specified by:
isDynamicColorsin interfaceDynamicListener- Returns:
trueif the dynamic colors are enabled for this listener.
-
isDynamicColor
public boolean isDynamicColor()Description copied from interface:DynamicListenerReturns whether to apply the dynamic colors for this listener.- Specified by:
isDynamicColorin interfaceDynamicListener- Returns:
trueif the dynamic colors should be applied for this listener.
-
isSystemColor
public boolean isSystemColor()Description copied from interface:DynamicListenerReturns whether the dynamic colors should be extracted from the system for this listener.- Specified by:
isSystemColorin interfaceDynamicListener- Returns:
trueif the dynamic colors should be extracted from the system for this listener
-
isWallpaperColor
public boolean isWallpaperColor()Description copied from interface:DynamicListenerReturns whether the dynamic colors should be extracted from the wallpaper for this listener.- Specified by:
isWallpaperColorin interfaceDynamicListener- Returns:
trueif the dynamic colors should be extracted from the wallpaper for this listener
-
getDefaultColor
Description copied from interface:DynamicListenerThis 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:
getDefaultColorin 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:DynamicListenerThis 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:
onDynamicChangedin interfaceDynamicListener- Parameters:
context-trueif there is a context change and it must be reinitialized.recreate-trueif 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:DynamicListenerThis 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:
onDynamicConfigurationChangedin interfaceDynamicListener- Parameters:
locale-trueif locale is changed.fontScale-trueif font scale is changed.orientation-trueif there is an orientation change.uiMode-trueif ui mode is changed.density-trueif configuration density is changed.- See Also:
-
onAutoThemeChanged
public void onAutoThemeChanged(boolean context) Description copied from interface:DynamicListenerThis 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:
onAutoThemeChangedin interfaceDynamicListener- Parameters:
context-trueif there is a context change and it must be reinitialized.
-
onPowerSaveModeChanged
public void onPowerSaveModeChanged(boolean powerSaveMode) Description copied from interface:DynamicListenerThis method will be called when the power save mode has been changed.It will be called only on API 21 and above.
- Specified by:
onPowerSaveModeChangedin interfaceDynamicListener- Parameters:
powerSaveMode-trueif 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:
onBackPressedin classComponentActivity
-
finish
public void finish() -
supportStartPostponedEnterTransition
public void supportStartPostponedEnterTransition()- Overrides:
supportStartPostponedEnterTransitionin classFragmentActivity
-
supportFinishAfterTransition
public void supportFinishAfterTransition()- Overrides:
supportFinishAfterTransitionin 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
trueif this activity should be finished after the transition. - See Also:
-
isPaused
public boolean isPaused()Checks whether the activity was paused before.- Returns:
trueif the activity was paused before.
-
finishActivity
public void finishActivity()Finish the activity properly after checking the shared element transition.
-