Class DynamicActivity
- 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
,DynamicSearchListener
,DynamicSnackbar
,DynamicTransitionListener
,DynamicProductFlavor
- Direct Known Subclasses:
DynamicDrawerActivity
,DynamicNavigationActivity
,DynamicPermissionsActivity
,DynamicPreviewActivity
,DynamicWidgetActivity
DynamicStateActivity
to handle everything related to design support and the
app compat libraries. It has a fragment container to add fragments dynamically with many
other useful methods to provide a good looking Material Design UI.
If NavigationMenu
is required then,
please check DynamicDrawerActivity
.
-
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
Constant to use the default layout resource.protected AppBarLayout
App bar layout used by this activity.protected boolean
Boolean to maintain the app bar state.protected View
Bottom bar shadow layout used by this activity.protected DynamicBottomSheet
Frame layout for the bottom sheet.protected final BottomSheetBehavior.BottomSheetCallback
The bottom sheet callback to enable on back pressed callback accordingly.protected final OnBackPressedCallback
On back pressed callback to expand the bottom sheet.protected CollapsingToolbarLayout
Collapsing toolbar layout used by this activity.protected CoordinatorLayout
Coordinator layout used by this activity.protected DynamicSearchListener
Listener to listen search view expand and collapse callbacks.protected ExtendedFloatingActionButton
Extended floating action button used by this activity.protected FloatingActionButton
Floating action button used by this activity.protected ViewGroup
Back drop frame for the collapsing toolbar layout.protected ViewGroup
Frame layout to hold the content fragment.protected ViewGroup
Footer frame at the bottom of the screen to add custom views like bottom navigation bar, ads, etc.protected ViewSwitcher
Header frame just below the app toolbar to add custom views like tabs, hints, etc.protected Menu
Default menu reference to perform menu operations.protected View
Navigation shadow layout used by this activity.protected final Runnable
Runnable to update the search view.protected ImageView
Button to clear the toolbar search view edit text.protected EditText
Toolbar edit text used by this activity.protected final OnBackPressedCallback
On back pressed callback to collapse the search view.protected ViewGroup
Root view of the toolbar search view.protected Toolbar
App toolbar used by this activity.Fields inherited from class com.pranavpandey.android.dynamic.support.activity.DynamicStateActivity
ADS_STATE_APP_BAR_COLLAPSED, ADS_STATE_CONTENT_FRAGMENT_TAG, ADS_STATE_EXTENDED_FAB_NO_CHANGE, ADS_STATE_EXTENDED_FAB_STATE, ADS_STATE_EXTENDED_FAB_VISIBLE, ADS_STATE_FAB_VISIBLE, ADS_STATE_LOCALE, ADS_STATE_SEARCH_VIEW_VISIBLE, ADS_VISIBILITY_EXTENDED_FAB_NO_CHANGE, ADS_VISIBILITY_FAB_NO_CHANGE, mAppBarStateListener, mNavigationItemId, mNavigationItemSelected, STATE_DELAY
Fields inherited from class com.pranavpandey.android.dynamic.support.activity.DynamicSystemActivity
ADS_DEFAULT_SYSTEM_BG_COLOR, ADS_DEFAULT_SYSTEM_OVERLAY_COLOR, ADS_DEFAULT_SYSTEM_UI_COLOR, ADS_STATE_BACKGROUND_COLOR, ADS_STATE_DYNAMIC_THEME, ADS_STATE_NAVIGATION_BAR_COLOR, ADS_STATE_PAUSED, ADS_STATE_SHARED_ELEMENT_MAP, ADS_STATE_STATUS_BAR_COLOR, ADS_STATE_TRANSITION_POSITION, ADS_STATE_TRANSITION_RESULT_CODE, mAppliedNavigationBarColor, mBackgroundColor, mContext, mCurrentLocale, mDynamicDelegate, mDynamicRunnable, mFinishRunnable, mNavigationBarColor, mNavigationBarTheme, mStatusBarColor
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
addBottomSheet
(int layoutRes, boolean removePrevious) Add view in the bottom sheet frame layout.void
addBottomSheet
(View view, boolean removePrevious) Add view in the bottom sheet frame layout.void
addFooter
(int layoutRes, boolean removePrevious) Add footer view at the bottom of the screen.void
Add footer view at the bottom of the screen.void
addHeader
(int layoutRes, boolean removePrevious) Add header view just below the app bar.void
addHeader
(int layoutRes, boolean removePrevious, boolean animate) Add header view just below the app bar.void
Add header view just below the app bar.void
Add header view just below the app bar.void
Add a view to the view group.void
Collapse search view to stop searching.void
expandSearchView
(boolean requestSoftInput) Expand search view to start searching.void
Extend the extended FAB.void
extendFAB
(boolean allowExtended) Shrink the extended FAB.Get the bottom sheet frame layout.Returns the current bottom sheet behavior.int
Returns the bottom sheet state if present.Returns the collapsing toolbar layout used by this activity.protected int
Returns the custom content resource if no fragment is required.Returns the parent content view used by this activity.Returns the coordinator layout used by this activity.protected Drawable
Returns the default navigation icon for this activity.Returns the view to apply edge-to-edge window insets.Get the extended floating action button used by this activity.getFAB()
Get the floating action button used by this activity.protected int
Retrieves the fragment container id.Get the main content frame used by this activity.Get the footer frame at the bottom of the screen to add custom views like bottom navigation bar, ads, etc.Get the header frame just below the app toolbar to add custom views like tabs, hints, etc.protected int
Returns the layout resource for this activity.getMenu()
Returns the menu used by this activity.Returns the clear button for the toolbar edit text used by this activity.Returns the toolbar edit text used by this activity.Returns the listener to listen search view expand and collapse callbacks.Returns the root view for the toolbar edit text used by this activity.getSnackbar
(int stringRes) Make a themed snackbar with text and action.getSnackbar
(int stringRes, int duration) Make a themed snackbar with text and action.getSnackbar
(CharSequence text) Make a themed snackbar with text and action.getSnackbar
(CharSequence text, int duration) Make a themed snackbar with text and action.Get the subtitle used by the support action bar.This method will be called to get the text watcher for the search view.Returns the app toolbar used by this activity.void
Hide the extended FAB by setting its visibility toView.GONE
.void
hideFAB()
Hide the FAB by setting its visibility toView.GONE
.boolean
Returns whether the app bar is visible.boolean
Returns whether to apply edge-to-edge window insets.protected boolean
Checks whether the navigation drawer is added.protected boolean
Returns whether to expand bottom sheet on exit.boolean
Checks whether the search view is expanded.void
void
onAddHeader
(View view) This method will be called after adding the header.protected void
This method will be called to adjust elevation of the components like app bar, bottom app bar, etc.void
onApplyTransitions
(boolean exit) This method will be called on applying transitions.void
protected void
This method will be called to configure on back pressed callback to support API 33 and above.protected void
boolean
onCreateOptionsMenu
(Menu menu) void
onSaveInstanceState
(Bundle outState) void
This method will be called when the search view is collapsed.void
This method will be called when the search view is expanded.void
onSnackbarShow
(Snackbar snackbar) This method will be called to show the snackbar.void
Remove the extended FAB associated with this activity.void
Remove the FAB associated with this activity.void
Restore the search view state after the configuration change.void
setAppBarBackDrop
(int drawableRes) Set the drawable id for backdrop image used by the collapsing toolbar layout which will be shown when it is expanded and will be hidden on collapsing the toolbar.void
setAppBarBackDrop
(Drawable drawable) Set the drawable for backdrop image used by the collapsing toolbar layout which will be shown when it is expanded and will be hidden on collapsing the toolbar.void
setAppBarBackDrop
(View view, int expandedTitleColor) Add a backdrop view for the collapsing toolbar layout which will be shown when it is expanded and will be hidden on collapsing the toolbar.void
setAppBarBackDropRes
(int layoutRes, int expandedTitleColorRes) Add a backdrop view for the collapsing toolbar layout which will be shown when it is expanded and will be hidden on collapsing the toolbar.void
setAppBarProgressVisible
(boolean visible) Set the visibility of app bar progress.void
setAppBarShadowVisible
(boolean visible) Set the visibility of app bar shadow.void
setAppBarTransparent
(boolean transparent) Make the app bar transparent or translucent.void
setAppBarVisible
(boolean appBarVisible) Set the toolbar or collapsing toolbar layout visibility (collectively known as app bar) if available.void
setBottomBarShadowVisible
(boolean visible) Set the visibility of bottom bar shadow.void
setBottomSheetState
(int bottomSheetState) Sets the bottom sheet state if present.protected boolean
void
setCollapsingToolbarLayoutFlags
(int flags) Set layout scroll flags for the collapsing toolbar layout.void
setExtendedFAB
(int drawableRes, int resId, int visibility, View.OnClickListener onClickListener) Set an extended floating action button (FAB) used by this activity by supplying an icon, a text, current visibility and a click listener.void
setExtendedFAB
(Drawable icon, CharSequence text, int visibility, View.OnClickListener onClickListener) Set an extended floating action button (FAB) used by this activity by supplying an icon, a text, current visibility and a click listener.void
setExtendedFABVisibility
(int visibility) void
setFAB
(int drawableRes, int visibility, View.OnClickListener onClickListener) Set a floating action button (FAB) used by this activity by supplying an image drawable, current visibility and a click listener.void
setFAB
(Drawable drawable, int visibility, View.OnClickListener onClickListener) Set a floating action button (FAB) used by this activity by supplying an image drawable, current visibility and a click listener.void
setFABImageDrawable
(int drawableRes) Set the FAB image drawable resource.void
setFABImageDrawable
(Drawable drawable) Set the FAB image drawable resource.void
setFABVisibility
(int visibility) void
setMenuItemIcon
(int id, int drawableRes) Set the icon for the app bar menu item by supplying its id.void
setMenuItemIcon
(int id, Drawable drawable) Set the icon for the app bar menu item by supplying its id.void
setMenuItemTitle
(int id, int titleRes) Set the title for the app bar menu item by supplying its id.void
setMenuItemTitle
(int id, CharSequence title) Set the title for the app bar menu item by supplying its id.void
setMenuItemVisible
(int id, boolean visible) Set the visibility of the app bar menu item by supplying its id.void
setNavigationClickListener
(int iconRes, View.OnClickListener onClickListener) Set the icon and on click listener for the back or up button in the app bar.void
setNavigationClickListener
(Drawable icon, View.OnClickListener onClickListener) Set the icon and on click listener for the back or up button in the app bar.void
setNavigationClickListener
(View.OnClickListener onClickListener) Sets the on click listener for the back or up button in the app bar.void
setNavigationIcon
(int iconRes) Set the icon for the back or up button in the app bar.void
setNavigationIcon
(Drawable icon) Set the icon for the back or up button in the app bar.void
setNavigationShadowVisible
(boolean visible) Set the visibility of navigation bar shadow.protected void
Setup search view edit text and clear button listeners.void
setSearchViewListener
(DynamicSearchListener dynamicSearchListener) Sets the listener to listen search view expand and collapse callbacks.void
setStatusBarColor
(int color) Set the status bar color.void
setSubtitle
(int subtitleRes) Set the subtitle resource for the support action bar.void
setSubtitle
(CharSequence subtitle) Set the subtitle for the support action bar.void
setTitle
(int titleRes) void
setTitle
(CharSequence title) void
setToolbarLayoutFlags
(int flagsOrMode) Set layout scroll flags or collapse mode for the toolbar.void
setWindowBackground
(int color) Sets the window background color.void
Show the extended FAB by setting its visibility toView.VISIBLE
.void
showFAB()
Show the FAB by setting its visibility toView.VISIBLE
.void
Shrink the extended FAB.void
shrinkFAB
(boolean allowExtended) Shrink the extended FAB.void
updateExtendedFAB
(int drawableRes, int resId) Set the extended FAB icon and text.void
updateExtendedFAB
(Drawable icon, CharSequence text) Set the extended FAB icon and text.Methods inherited from class com.pranavpandey.android.dynamic.support.activity.DynamicStateActivity
getContentFragment, getExtendedFABState, getExtendedFABVisibility, getFABVisibility, isAppBarCollapsed, onNavigationItemSelected, setAppBarCollapsed, setContentFragment, setExtendedFABState, switchFragment, switchFragment, switchFragment, switchFragment, switchNewFragment
Methods inherited from class com.pranavpandey.android.dynamic.support.activity.DynamicSystemActivity
checkForThemeIntent, commitFragmentTransaction, createConfigurationContext, finish, finishActivity, getAppliedNavigationBarColor, getBackgroundColor, getContext, getCurrentLocale, getDefaultColor, getDefaultLocale, getDelegate, getDynamicEnterTransition, getDynamicExitTransition, getDynamicIntentTheme, getDynamicLayoutInflater, getDynamicReenterTransition, getDynamicReturnTransition, getDynamicTheme, getDynamicTransitionListener, getEdgeToEdgeViewBottom, getFontScale, getLocale, getNavigationBarColor, getPostponeTransitionView, getProductFlavor, getRequiredThemeVersion, getSavedInstanceState, getSharedElementCallback, getSharedElementTransition, getStatusBarColor, getSupportedLocales, getThemeRes, getThemeRes, getTransitionPosition, getTransitionResultCode, isApplyFooterInsets, isDynamicColor, isDynamicColors, isEdgeToEdgeContent, isForceMenuIcons, isLaunchedFromHistory, isNavigationBarTheme, isNightMode, isOnSharedPreferenceChangeListener, isPaused, isSupportFinishAfterTransition, isSystemColor, isThemeActivity, isWallpaperColor, navigationBarThemeChange, onAdjustEnterReturnTransition, onAdjustExitReenterTransition, onAppThemeChange, onAutoThemeChanged, onCustomiseTheme, onDestroy, onDynamicChanged, onDynamicColorsChanged, onDynamicConfigurationChanged, onFindView, onManageSharedElementTransition, onNavigationBarThemeChanged, onNewIntent, onNewIntent, onPause, onPostCreate, onPowerSaveModeChanged, onPrepareOptionsMenu, onResume, onSetFallbackActivityOptions, onSetSharedElementTransition, onSharedPreferenceChanged, onStartActivityException, onThemeIntent, onUpdateIntent, resetSharedElementTransition, setDynamicTransitionListener, setLocale, setNavigationBarColor, setNavigationBarColorRes, setNavigationBarTheme, setNavigationBarThemeInLandscape, setRootBackground, setSharedElementCallback, setSharedElementTransition, setStatusBarColorRes, setTransitionPosition, setTransitionResultCode, setTranslucentNavigationBar, setTranslucentStatusBar, setWindowStatusBarColor, startActivity, startActivity, startActivityForResult, startActivityForResult, startActivityFromFragment, startMotionActivity, startMotionActivity, startMotionActivity, startMotionActivityForResult, startMotionActivityForResult, startMotionActivityForResult, startMotionActivityFromFragment, startMotionActivityFromFragment, startMotionActivityFromFragment, supportFinishAfterTransition, supportStartPostponedEnterTransition, updateNavigationBar, updateStatusBar, updateTaskDescription
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, onActivityReenter, onActivityResult, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onChildTitleChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, 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, 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_DEFAULT_LAYOUT_RES
protected static final int ADS_DEFAULT_LAYOUT_RESConstant to use the default layout resource.- See Also:
-
mToolbar
App toolbar used by this activity. -
mSearchViewEditText
Toolbar edit text used by this activity. -
mSearchViewRoot
Root view of the toolbar search view. -
mSearchViewClear
Button to clear the toolbar search view edit text. -
mDynamicSearchListener
Listener to listen search view expand and collapse callbacks. -
mFAB
Floating action button used by this activity.Use the methods
setFAB(Drawable, int, View.OnClickListener)
orsetFAB(int, int, View.OnClickListener)
to enable it. -
mExtendedFAB
Extended floating action button used by this activity.Use the methods
setExtendedFAB(int, int, int, View.OnClickListener)
orsetExtendedFAB(Drawable, CharSequence, int, View.OnClickListener)
to enable it. -
mCoordinatorLayout
Coordinator layout used by this activity. -
mCollapsingToolbarLayout
Collapsing toolbar layout used by this activity. -
mAppBarLayout
App bar layout used by this activity. -
mBottomBarShadow
Bottom bar shadow layout used by this activity. -
mMenu
Default menu reference to perform menu operations. -
mFrameBackDrop
Back drop frame for the collapsing toolbar layout. -
mFrameHeader
Header frame just below the app toolbar to add custom views like tabs, hints, etc.Use the methods
addHeader(int, boolean, boolean)
(int, boolean)} oraddHeader(View, boolean, boolean)
to add the views. -
mFrameContent
Frame layout to hold the content fragment.- See Also:
-
DynamicStateActivity.switchFragment(Fragment, boolean)
DynamicStateActivity.switchFragment(Fragment, boolean, boolean)
DynamicStateActivity.switchFragment(Fragment, boolean, String, boolean)
DynamicStateActivity.switchFragment(FragmentTransaction, Fragment, boolean, String, boolean)
DynamicStateActivity.switchNewFragment(Fragment, boolean)
-
mBottomSheet
Frame layout for the bottom sheet.Use the methods
addBottomSheet(int, boolean)
oraddBottomSheet(View, boolean)
to add the views. -
mAppBarVisible
protected boolean mAppBarVisibleBoolean to maintain the app bar state. -
mSearchViewOnBackPressedCallback
On back pressed callback to collapse the search view. -
mBottomSheetOnBackPressedCallback
On back pressed callback to expand the bottom sheet. -
mBottomSheetCallback
The bottom sheet callback to enable on back pressed callback accordingly. -
mSearchRunnable
Runnable to update the search view.
-
-
Constructor Details
-
DynamicActivity
public DynamicActivity()
-
-
Method Details
-
onCreate
- Overrides:
onCreate
in classDynamicStateActivity
-
onConfigureOnBackPressedDispatcher
protected void onConfigureOnBackPressedDispatcher()Description copied from class:DynamicSystemActivity
This method will be called to configure on back pressed callback to support API 33 and above.- Overrides:
onConfigureOnBackPressedDispatcher
in classDynamicSystemActivity
-
onAdjustElevation
protected void onAdjustElevation()Description copied from class:DynamicSystemActivity
This method will be called to adjust elevation of the components like app bar, bottom app bar, etc.- Overrides:
onAdjustElevation
in classDynamicSystemActivity
-
setWindowBackground
Description copied from class:DynamicSystemActivity
Sets the window background color.- Overrides:
setWindowBackground
in classDynamicSystemActivity
- Parameters:
color
- The window background color to be set.- 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
- Overrides:
onApplyTransitions
in classDynamicSystemActivity
- Parameters:
exit
-true
if the activity is exiting.
-
setStatusBarColor
Description copied from class:DynamicSystemActivity
Set the status bar color.It will be applied only on the API 21 and above.
- Overrides:
setStatusBarColor
in classDynamicSystemActivity
- Parameters:
color
- The color to be applied.
-
getEdgeToEdgeView
Description copied from class:DynamicSystemActivity
Returns the view to apply edge-to-edge window insets.- Overrides:
getEdgeToEdgeView
in classDynamicSystemActivity
- Returns:
- The view to apply edge-to-edge window insets.
- See Also:
-
isApplyEdgeToEdgeInsets
public boolean isApplyEdgeToEdgeInsets()Description copied from class:DynamicSystemActivity
Returns whether to apply edge-to-edge window insets.- Overrides:
isApplyEdgeToEdgeInsets
in classDynamicSystemActivity
- Returns:
true
to apply edge-to-edge window insets.- See Also:
-
getCoordinatorLayout
Description copied from class:DynamicSystemActivity
Returns the coordinator layout used by this activity.- Overrides:
getCoordinatorLayout
in classDynamicSystemActivity
- Returns:
- The coordinator layout used by this activity.
-
isDrawerActivity
protected boolean isDrawerActivity()Checks whether the navigation drawer is added.- Returns:
true
if this activity is a drawer activity.
-
onSaveInstanceState
- Overrides:
onSaveInstanceState
in classDynamicStateActivity
-
onCreateOptionsMenu
- Overrides:
onCreateOptionsMenu
in classActivity
-
onActionModeStarted
- Specified by:
onActionModeStarted
in interfaceWindow.Callback
- Overrides:
onActionModeStarted
in classActivity
-
setTitle
-
setTitle
-
getSubtitle
Get the subtitle used by the support action bar.- Returns:
- The subtitle used by the support action bar.
-
setSubtitle
Set the subtitle for the support action bar.- Parameters:
subtitle
- The subtitle to be set.
-
setSubtitle
Set the subtitle resource for the support action bar.- Parameters:
subtitleRes
- The subtitle resource to be set.
-
getFragmentContainerId
Description copied from class:DynamicStateActivity
Retrieves the fragment container id.This method must be implemented in the extended activity to show fragments inside this container.
- Specified by:
getFragmentContainerId
in classDynamicStateActivity
- Returns:
- The fragment container id so that the fragment can be injected into this view.
-
setCollapsingToolbarLayout
protected boolean setCollapsingToolbarLayout()- Returns:
true
to enable the collapsing toolbar layout.
-
getLayoutRes
Returns the layout resource for this activity.- Returns:
- The layout resource for this activity.
-
getContentRes
protected int getContentRes()Returns the custom content resource if no fragment is required.It will automatically add this layout in the
mFrameContent
.- Returns:
- The custom content resource if no fragment is required.
-
getContentView
Description copied from class:DynamicSystemActivity
Returns the parent content view used by this activity.- Specified by:
getContentView
in classDynamicSystemActivity
- Returns:
- The parent content view used by this activity.
-
getToolbar
Returns the app toolbar used by this activity.- Returns:
- The app toolbar used by this activity.
-
isAppBarVisible
public boolean isAppBarVisible()Returns whether the app bar is visible.- Returns:
true
if the app bar is visible. It will be used internally to maintain the app bar state.
-
getCollapsingToolbarLayout
Returns the collapsing toolbar layout used by this activity.- Returns:
- The collapsing toolbar layout used by this activity.
-
setCollapsingToolbarLayoutFlags
public void setCollapsingToolbarLayoutFlags(int flags) Set layout scroll flags for the collapsing toolbar layout.Useful to change the collapse mode dynamically.
- Parameters:
flags
- The scroll flags to be set.
-
setToolbarLayoutFlags
public void setToolbarLayoutFlags(int flagsOrMode) Set layout scroll flags or collapse mode for the toolbar.Useful to change the collapse mode dynamically.
- Parameters:
flagsOrMode
- The scroll flags or collapse mode to be set.
-
setAppBarVisible
public void setAppBarVisible(boolean appBarVisible) Set the toolbar or collapsing toolbar layout visibility (collectively known as app bar) if available.- Parameters:
appBarVisible
-true
to make the app bar visible.
-
setAppBarBackDrop
Add a backdrop view for the collapsing toolbar layout which will be shown when it is expanded and will be hidden on collapsing the toolbar.- Parameters:
view
- The view to be added as the backdrop frame.expandedTitleColor
- The title color when the toolbar is expanded.
-
setAppBarBackDropRes
Add a backdrop view for the collapsing toolbar layout which will be shown when it is expanded and will be hidden on collapsing the toolbar.- Parameters:
layoutRes
- The layout resource to be added as the backdrop frame.expandedTitleColorRes
- The title color resource when the toolbar is expanded.
-
setAppBarBackDrop
Set the drawable for backdrop image used by the collapsing toolbar layout which will be shown when it is expanded and will be hidden on collapsing the toolbar.- Parameters:
drawable
- The drawable for the backdrop image.
-
setAppBarBackDrop
Set the drawable id for backdrop image used by the collapsing toolbar layout which will be shown when it is expanded and will be hidden on collapsing the toolbar.- Parameters:
drawableRes
- The drawable resource for the backdrop image.
-
setAppBarTransparent
public void setAppBarTransparent(boolean transparent) Make the app bar transparent or translucent.Useful to make it transparent if a backdrop view has been added.
- Parameters:
transparent
-true
to make the app bar transparent.
-
setAppBarShadowVisible
public void setAppBarShadowVisible(boolean visible) Set the visibility of app bar shadow.- Parameters:
visible
-true
to show the content shadow below the app bar.
-
addView
Add a view to the view group.- Parameters:
viewGroup
- The view group to add the view.view
- The view to be added.removePrevious
-true
to remove all the previous views of the view group.
-
getFrameContent
Get the main content frame used by this activity.- Returns:
- The main content frame used by this activity.
-
getFrameHeader
Get the header frame just below the app toolbar to add custom views like tabs, hints, etc.Use the methods
addHeader(View, boolean, boolean)
oraddView(ViewGroup, View, boolean)
to add the views.- Returns:
- The header frame just below the app toolbar to add custom views like tabs, hints, etc.
-
addHeader
Add header view just below the app bar.Useful to add tabs or hints dynamically. Multiple views can be added and the default background will be the app bar background (theme primary color). Please check
DynamicViewPagerFragment
to add the tabs automatically.- Parameters:
view
- The view to be added in the header frame.removePrevious
-true
to remove the previously added views.animate
-true
to animate the changes.
-
addHeader
Add header view just below the app bar.Useful to add tabs or hints dynamically. Multiple views can be added and the default background will be the app bar background (theme primary color). Please check
DynamicViewPagerFragment
to add the tabs automatically.- Parameters:
view
- The view to be added in the header frame.removePrevious
-true
to remove the previously added views.
-
addHeader
Add header view just below the app bar.Useful to add tabs or hints dynamically. Multiple views can be added and the default background will be the app bar background (theme primary color). Please check
DynamicViewPagerFragment
to add the tabs automatically.- Parameters:
layoutRes
- The layout resource to be added in the header frame.removePrevious
-true
to remove the previously added views.animate
-true
to animate the changes.
-
addHeader
Add header view just below the app bar.Useful to add tabs or hints dynamically. Multiple views can be added and the default background will be the app bar background (theme primary color). Please check
DynamicViewPagerFragment
to add the tabs automatically.- Parameters:
layoutRes
- The layout resource to be added in the header frame.removePrevious
-true
to remove the previously added views.
-
onAddHeader
This method will be called after adding the header.- Parameters:
view
- The view added to the header.
-
setAppBarProgressVisible
public void setAppBarProgressVisible(boolean visible) Set the visibility of app bar progress.- Parameters:
visible
-true
to show the progress bar below the app bar.
-
setBottomBarShadowVisible
public void setBottomBarShadowVisible(boolean visible) Set the visibility of bottom bar shadow.- Parameters:
visible
-true
to show the content shadow above the bottom bar.
-
getBottomSheet
Get the bottom sheet frame layout.Use the methods
addBottomSheet(int, boolean)
oraddBottomSheet(View, boolean)
to add the views.- Returns:
- The bottom sheet frame layout.
-
addBottomSheet
Add view in the bottom sheet frame layout.- Parameters:
view
- The view to be added in the bottom sheet.removePrevious
-true
to remove the previously added views.
-
addBottomSheet
Add view in the bottom sheet frame layout.- Parameters:
layoutRes
- The layout resource to be added in the bottom sheet.removePrevious
-true
to remove the previously added views.
-
getBottomSheetBehavior
Returns the current bottom sheet behavior.- Returns:
- The bottom sheet behavior.
-
getBottomSheetState
public int getBottomSheetState()Returns the bottom sheet state if present.- Returns:
- The bottom sheet state if present.
Otherwise,
BottomSheetBehavior.STATE_HIDDEN
.
-
setBottomSheetState
public void setBottomSheetState(int bottomSheetState) Sets the bottom sheet state if present.- Parameters:
bottomSheetState
- The state to be set.
-
isExpandBottomSheetOnExit
protected boolean isExpandBottomSheetOnExit()Returns whether to expand bottom sheet on exit.- Returns:
true
to expand bottom sheet on exit.
-
getMenu
Returns the menu used by this activity.- Returns:
- The menu used by this activity.
-
setMenuItemTitle
Set the title for the app bar menu item by supplying its id.- Parameters:
id
- The id to find the menu item.title
- The title to be set.
-
setMenuItemTitle
Set the title for the app bar menu item by supplying its id.- Parameters:
id
- The id to find the menu item.titleRes
- The title resource to be set.- See Also:
-
setMenuItemIcon
Set the icon for the app bar menu item by supplying its id.- Parameters:
id
- The id to find the menu item.drawable
- The icon drawable to be set.
-
setMenuItemIcon
Set the icon for the app bar menu item by supplying its id.- Parameters:
id
- The id to find the menu item.drawableRes
- The icon resource to be set.- See Also:
-
setMenuItemVisible
Set the visibility of the app bar menu item by supplying its id.- Parameters:
id
- The id to find the menu item.visible
-true
to make the menu item visible.
-
setSearchView
protected void setSearchView()Setup search view edit text and clear button listeners. -
restoreSearchViewState
public void restoreSearchViewState()Restore the search view state after the configuration change. -
expandSearchView
public void expandSearchView(boolean requestSoftInput) Expand search view to start searching.- Parameters:
requestSoftInput
-true
to request the soft input keyboard.
-
collapseSearchView
public void collapseSearchView()Collapse search view to stop searching. -
getSearchViewRoot
Returns the root view for the toolbar edit text used by this activity.- Returns:
- The the root view for the toolbar edit text used by this activity.
-
getSearchViewEditText
Returns the toolbar edit text used by this activity.- Returns:
- The toolbar edit text used by this activity.
-
getSearchViewClear
Returns the clear button for the toolbar edit text used by this activity.- Returns:
- The clear button for the toolbar edit text used by this activity.
-
isSearchViewExpanded
public boolean isSearchViewExpanded()Checks whether the search view is expanded.- Returns:
true
if search view is expanded.
-
getSearchViewListener
Returns the listener to listen search view expand and collapse callbacks.- Returns:
- The listener to listen search view expand and collapse callbacks.
-
onSearchViewExpanded
public void onSearchViewExpanded()Description copied from interface:DynamicSearchListener
This method will be called when the search view is expanded.- Specified by:
onSearchViewExpanded
in interfaceDynamicSearchListener
-
onSearchViewCollapsed
public void onSearchViewCollapsed()Description copied from interface:DynamicSearchListener
This method will be called when the search view is collapsed.- Specified by:
onSearchViewCollapsed
in interfaceDynamicSearchListener
-
getTextWatcher
Description copied from interface:DynamicSearchListener
This method will be called to get the text watcher for the search view.- Specified by:
getTextWatcher
in interfaceDynamicSearchListener
- Returns:
- The text watcher for the search view.
-
onBackPressed
public void onBackPressed()- Overrides:
onBackPressed
in classDynamicSystemActivity
-
getFAB
Get the floating action button used by this activity.- Returns:
- The floating action button used by this activity.
-
setFAB
public void setFAB(@Nullable Drawable drawable, int visibility, @Nullable View.OnClickListener onClickListener) Set a floating action button (FAB) used by this activity by supplying an image drawable, current visibility and a click listener.The FAB will be tinted automatically according to the accent color used by this activity.
Please use
getFAB()
method to perform more operations dynamically.- Parameters:
drawable
- The image drawable to be set.visibility
- The visibility to be set.onClickListener
- Callback that will run when this view is clicked.
-
setFAB
public void setFAB(@DrawableRes int drawableRes, int visibility, @Nullable View.OnClickListener onClickListener) Set a floating action button (FAB) used by this activity by supplying an image drawable, current visibility and a click listener.The FAB will be tinted automatically according to the accent color used by this activity.
Please use
getFAB()
method to perform more operations dynamically.- Parameters:
drawableRes
- The image drawable resource to be set.visibility
- The visibility to be set.onClickListener
- Callback that will run when this view is clicked.
-
setFABImageDrawable
Set the FAB image drawable resource.Image will be tinted automatically according to its background color to provide best visibility.
- Parameters:
drawable
- The image drawable for the floating action button.
-
setFABImageDrawable
Set the FAB image drawable resource.Image will be tinted automatically according to its background color to provide best visibility.
- Parameters:
drawableRes
- The image drawable resource for the floating action button.
-
setFABVisibility
public void setFABVisibility(int visibility) - Overrides:
setFABVisibility
in classDynamicStateActivity
- Parameters:
visibility
- The FAB visibility to be set.
-
showFAB
public void showFAB()Show the FAB by setting its visibility toView.VISIBLE
. -
hideFAB
public void hideFAB()Hide the FAB by setting its visibility toView.GONE
. -
removeFAB
public void removeFAB()Remove the FAB associated with this activity.Please call the methods
setFAB(int, int, View.OnClickListener)
orsetFAB(Drawable, int, View.OnClickListener)
to set it again. -
getExtendedFAB
Get the extended floating action button used by this activity.- Returns:
- The extended floating action button used by this activity.
-
setExtendedFAB
public void setExtendedFAB(@Nullable Drawable icon, @Nullable CharSequence text, int visibility, @Nullable View.OnClickListener onClickListener) Set an extended floating action button (FAB) used by this activity by supplying an icon, a text, current visibility and a click listener.The FAB will be tinted automatically according to the accent color used by this activity.
Please use
getExtendedFAB()
method to perform more operations dynamically.- Parameters:
icon
- The icon drawable to be set.text
- The text to be set.visibility
- The visibility to be set.onClickListener
- Callback that will run when this view is clicked.
-
setExtendedFAB
public void setExtendedFAB(@DrawableRes int drawableRes, @StringRes int resId, int visibility, @Nullable View.OnClickListener onClickListener) Set an extended floating action button (FAB) used by this activity by supplying an icon, a text, current visibility and a click listener.The FAB will be tinted automatically according to the accent color used by this activity.
Please use
getExtendedFAB()
method to perform more operations dynamically.- Parameters:
drawableRes
- The icon drawable resource to be set.resId
- The string resource id to be set.visibility
- The visibility to be set.onClickListener
- Callback that will run when this view is clicked.
-
updateExtendedFAB
Set the extended FAB icon and text.Icon and text will be tinted automatically according to its background color to provide best visibility.
- Parameters:
icon
- The icon drawable to be set.text
- The text to be set.
-
updateExtendedFAB
Set the extended FAB icon and text.Icon and text will be tinted automatically according to its background color to provide best visibility.
- Parameters:
drawableRes
- The icon drawable resource to be set.resId
- The string resource id to be set.
-
setExtendedFABVisibility
public void setExtendedFABVisibility(int visibility) - Overrides:
setExtendedFABVisibility
in classDynamicStateActivity
- Parameters:
visibility
- The extended FAB visibility to be set.
-
shrinkFAB
public void shrinkFAB()Shrink the extended FAB. -
shrinkFAB
public void shrinkFAB(boolean allowExtended) Shrink the extended FAB.- Parameters:
allowExtended
-true
if the FAB can be extended.
-
extendFAB
public void extendFAB()Extend the extended FAB. -
extendFAB
public void extendFAB(boolean allowExtended) Shrink the extended FAB.- Parameters:
allowExtended
-true
if the FAB can be extended.
-
showExtendedFAB
public void showExtendedFAB()Show the extended FAB by setting its visibility toView.VISIBLE
. -
hideExtendedFAB
public void hideExtendedFAB()Hide the extended FAB by setting its visibility toView.GONE
. -
removeExtendedFAB
public void removeExtendedFAB()Remove the extended FAB associated with this activity.Use the methods
setExtendedFAB(int, int, int, View.OnClickListener)
orsetExtendedFAB(Drawable, CharSequence, int, View.OnClickListener)
to set it again. -
getSnackbar
Description copied from interface:DynamicSnackbar
Make a themed snackbar with text and action.The background of the snackbar will be the tint background color to blend it smoothly and it will automatically use its tint color for the text and action to provide best visibility.
- Specified by:
getSnackbar
in interfaceDynamicSnackbar
- Parameters:
text
- The text to show. Can be formatted text.duration
- The duration of the snackbar.BaseTransientBottomBar.LENGTH_SHORT
,BaseTransientBottomBar.LENGTH_LONG
orBaseTransientBottomBar.LENGTH_INDEFINITE
.- Returns:
- The snackbar with the supplied parameters.
Use
Snackbar.show()
to display the snackbar.
-
getSnackbar
Description copied from interface:DynamicSnackbar
Make a themed snackbar with text and action.The background of the snackbar will be the tint background color to blend it smoothly and it will automatically use its tint color for the text and action to provide best visibility.
- Specified by:
getSnackbar
in interfaceDynamicSnackbar
- Parameters:
stringRes
- The string resource for the snackbar.duration
- The duration of the snackbar.BaseTransientBottomBar.LENGTH_SHORT
,BaseTransientBottomBar.LENGTH_LONG
orBaseTransientBottomBar.LENGTH_INDEFINITE
.- Returns:
- The snackbar with the supplied parameters.
Use
Snackbar.show()
to display the snackbar.
-
getSnackbar
Description copied from interface:DynamicSnackbar
Make a themed snackbar with text and action.The background of the snackbar will be the tint background color to blend it smoothly and it will automatically use its tint color for the text and action to provide best visibility.
- Specified by:
getSnackbar
in interfaceDynamicSnackbar
- Parameters:
text
- The text to show. Can be formatted text.- Returns:
- The snackbar with the supplied parameters.
Use
Snackbar.show()
to display the snackbar.
-
getSnackbar
Description copied from interface:DynamicSnackbar
Make a themed snackbar with text and action.The background of the snackbar will be the tint background color to blend it smoothly and it will automatically use its tint color for the text and action to provide best visibility.
- Specified by:
getSnackbar
in interfaceDynamicSnackbar
- Parameters:
stringRes
- The string resource for the snackbar.- Returns:
- The snackbar with the supplied parameters.
Use
Snackbar.show()
to display the snackbar.
-
onSnackbarShow
Description copied from interface:DynamicSnackbar
This method will be called to show the snackbar.- Specified by:
onSnackbarShow
in interfaceDynamicSnackbar
- Parameters:
snackbar
- The snackbar to be shown.
-