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.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 intConstant to use the default layout resource.protected AppBarLayoutApp bar layout used by this activity.protected booleanBoolean to maintain the app bar state.protected ViewBottom bar shadow layout used by this activity.protected DynamicBottomSheetFrame layout for the bottom sheet.protected final BottomSheetBehavior.BottomSheetCallbackThe bottom sheet callback to enable on back pressed callback accordingly.protected final OnBackPressedCallbackOn back pressed callback to expand the bottom sheet.protected CollapsingToolbarLayoutCollapsing toolbar layout used by this activity.protected CoordinatorLayoutCoordinator layout used by this activity.protected DynamicSearchListenerListener to listen search view expand and collapse callbacks.protected ExtendedFloatingActionButtonExtended floating action button used by this activity.protected FloatingActionButtonFloating action button used by this activity.protected ViewGroupBack drop frame for the collapsing toolbar layout.protected ViewGroupFrame layout to hold the content fragment.protected ViewGroupFooter frame at the bottom of the screen to add custom views like bottom navigation bar, ads, etc.protected ViewSwitcherHeader frame just below the app toolbar to add custom views like tabs, hints, etc.protected MenuDefault menu reference to perform menu operations.protected ViewNavigation shadow layout used by this activity.protected final RunnableRunnable to update the search view.protected ImageViewButton to clear the toolbar search view edit text.protected EditTextToolbar edit text used by this activity.protected final OnBackPressedCallbackOn back pressed callback to collapse the search view.protected ViewGroupRoot view of the toolbar search view.protected ToolbarApp 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_DELAYFields 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, mStatusBarColorFields 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 TypeMethodDescriptionvoidaddBottomSheet(int layoutRes, boolean removePrevious) Add view in the bottom sheet frame layout.voidaddBottomSheet(View view, boolean removePrevious) Add view in the bottom sheet frame layout.voidaddFooter(int layoutRes, boolean removePrevious) Add footer view at the bottom of the screen.voidAdd footer view at the bottom of the screen.voidaddHeader(int layoutRes, boolean removePrevious) Add header view just below the app bar.voidaddHeader(int layoutRes, boolean removePrevious, boolean animate) Add header view just below the app bar.voidAdd header view just below the app bar.voidAdd header view just below the app bar.voidAdd a view to the view group.voidCollapse search view to stop searching.voidexpandSearchView(boolean requestSoftInput) Expand search view to start searching.voidExtend the extended FAB.voidextendFAB(boolean allowExtended) Shrink the extended FAB.Get the bottom sheet frame layout.Returns the current bottom sheet behavior.intReturns the bottom sheet state if present.Returns the collapsing toolbar layout used by this activity.protected intReturns 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 DrawableReturns 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 intRetrieves 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 intReturns 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.voidHide the extended FAB by setting its visibility toView.GONE.voidhideFAB()Hide the FAB by setting its visibility toView.GONE.booleanReturns whether the app bar is visible.booleanReturns whether to apply edge-to-edge window insets.protected booleanChecks whether the navigation drawer is added.protected booleanReturns whether to expand bottom sheet on exit.booleanChecks whether the search view is expanded.voidvoidonAddHeader(View view) This method will be called after adding the header.protected voidThis method will be called to adjust elevation of the components like app bar, bottom app bar, etc.voidonApplyTransitions(boolean exit) This method will be called on applying transitions.voidprotected voidThis method will be called to configure on back pressed callback to support API 33 and above.protected voidbooleanonCreateOptionsMenu(Menu menu) voidonSaveInstanceState(Bundle outState) voidThis method will be called when the search view is collapsed.voidThis method will be called when the search view is expanded.voidonSnackbarShow(Snackbar snackbar) This method will be called to show the snackbar.voidRemove the extended FAB associated with this activity.voidRemove the FAB associated with this activity.voidRestore the search view state after the configuration change.voidsetAppBarBackDrop(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.voidsetAppBarBackDrop(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.voidsetAppBarBackDrop(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.voidsetAppBarBackDropRes(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.voidsetAppBarProgressVisible(boolean visible) Set the visibility of app bar progress.voidsetAppBarShadowVisible(boolean visible) Set the visibility of app bar shadow.voidsetAppBarTransparent(boolean transparent) Make the app bar transparent or translucent.voidsetAppBarVisible(boolean appBarVisible) Set the toolbar or collapsing toolbar layout visibility (collectively known as app bar) if available.voidsetBottomBarShadowVisible(boolean visible) Set the visibility of bottom bar shadow.voidsetBottomSheetState(int bottomSheetState) Sets the bottom sheet state if present.protected booleanvoidsetCollapsingToolbarLayoutFlags(int flags) Set layout scroll flags for the collapsing toolbar layout.voidsetExtendedFAB(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.voidsetExtendedFAB(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.voidsetExtendedFABVisibility(int visibility) voidsetFAB(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.voidsetFAB(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.voidsetFABImageDrawable(int drawableRes) Set the FAB image drawable resource.voidsetFABImageDrawable(Drawable drawable) Set the FAB image drawable resource.voidsetFABVisibility(int visibility) voidsetMenuItemIcon(int id, int drawableRes) Set the icon for the app bar menu item by supplying its id.voidsetMenuItemIcon(int id, Drawable drawable) Set the icon for the app bar menu item by supplying its id.voidsetMenuItemTitle(int id, int titleRes) Set the title for the app bar menu item by supplying its id.voidsetMenuItemTitle(int id, CharSequence title) Set the title for the app bar menu item by supplying its id.voidsetMenuItemVisible(int id, boolean visible) Set the visibility of the app bar menu item by supplying its id.voidsetNavigationClickListener(int iconRes, View.OnClickListener onClickListener) Set the icon and on click listener for the back or up button in the app bar.voidsetNavigationClickListener(Drawable icon, View.OnClickListener onClickListener) Set the icon and on click listener for the back or up button in the app bar.voidsetNavigationClickListener(View.OnClickListener onClickListener) Sets the on click listener for the back or up button in the app bar.voidsetNavigationIcon(int iconRes) Set the icon for the back or up button in the app bar.voidsetNavigationIcon(Drawable icon) Set the icon for the back or up button in the app bar.voidsetNavigationShadowVisible(boolean visible) Set the visibility of navigation bar shadow.protected voidSetup search view edit text and clear button listeners.voidsetSearchViewListener(DynamicSearchListener dynamicSearchListener) Sets the listener to listen search view expand and collapse callbacks.voidsetStatusBarColor(int color) Set the status bar color.voidsetSubtitle(int subtitleRes) Set the subtitle resource for the support action bar.voidsetSubtitle(CharSequence subtitle) Set the subtitle for the support action bar.voidsetTitle(int titleRes) voidsetTitle(CharSequence title) voidsetToolbarLayoutFlags(int flagsOrMode) Set layout scroll flags or collapse mode for the toolbar.voidsetWindowBackground(int color) Sets the window background color.voidShow the extended FAB by setting its visibility toView.VISIBLE.voidshowFAB()Show the FAB by setting its visibility toView.VISIBLE.voidShrink the extended FAB.voidshrinkFAB(boolean allowExtended) Shrink the extended FAB.voidupdateExtendedFAB(int drawableRes, int resId) Set the extended FAB icon and text.voidupdateExtendedFAB(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, switchNewFragmentMethods 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, updateTaskDescriptionMethods 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, 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, 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_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:
onCreatein classDynamicStateActivity
-
onConfigureOnBackPressedDispatcher
protected void onConfigureOnBackPressedDispatcher()Description copied from class:DynamicSystemActivityThis method will be called to configure on back pressed callback to support API 33 and above.- Overrides:
onConfigureOnBackPressedDispatcherin classDynamicSystemActivity
-
onAdjustElevation
protected void onAdjustElevation()Description copied from class:DynamicSystemActivityThis method will be called to adjust elevation of the components like app bar, bottom app bar, etc.- Overrides:
onAdjustElevationin classDynamicSystemActivity
-
setWindowBackground
Description copied from class:DynamicSystemActivitySets the window background color.- Overrides:
setWindowBackgroundin classDynamicSystemActivity- Parameters:
color- The window background color to be set.- 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- Overrides:
onApplyTransitionsin classDynamicSystemActivity- Parameters:
exit-trueif the activity is exiting.
-
setStatusBarColor
Description copied from class:DynamicSystemActivitySet the status bar color.It will be applied only on the API 21 and above.
- Overrides:
setStatusBarColorin classDynamicSystemActivity- Parameters:
color- The color to be applied.
-
getEdgeToEdgeView
Description copied from class:DynamicSystemActivityReturns the view to apply edge-to-edge window insets.- Overrides:
getEdgeToEdgeViewin classDynamicSystemActivity- Returns:
- The view to apply edge-to-edge window insets.
- See Also:
-
isApplyEdgeToEdgeInsets
public boolean isApplyEdgeToEdgeInsets()Description copied from class:DynamicSystemActivityReturns whether to apply edge-to-edge window insets.- Overrides:
isApplyEdgeToEdgeInsetsin classDynamicSystemActivity- Returns:
trueto apply edge-to-edge window insets.- See Also:
-
getCoordinatorLayout
Description copied from class:DynamicSystemActivityReturns the coordinator layout used by this activity.- Overrides:
getCoordinatorLayoutin classDynamicSystemActivity- Returns:
- The coordinator layout used by this activity.
-
isDrawerActivity
protected boolean isDrawerActivity()Checks whether the navigation drawer is added.- Returns:
trueif this activity is a drawer activity.
-
onSaveInstanceState
- Overrides:
onSaveInstanceStatein classDynamicStateActivity
-
onCreateOptionsMenu
- Overrides:
onCreateOptionsMenuin classActivity
-
onActionModeStarted
- Specified by:
onActionModeStartedin interfaceWindow.Callback- Overrides:
onActionModeStartedin 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:DynamicStateActivityRetrieves the fragment container id.This method must be implemented in the extended activity to show fragments inside this container.
- Specified by:
getFragmentContainerIdin classDynamicStateActivity- Returns:
- The fragment container id so that the fragment can be injected into this view.
-
setCollapsingToolbarLayout
protected boolean setCollapsingToolbarLayout()- Returns:
trueto 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:DynamicSystemActivityReturns the parent content view used by this activity.- Specified by:
getContentViewin 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:
trueif 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-trueto 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-trueto make the app bar transparent.
-
setAppBarShadowVisible
public void setAppBarShadowVisible(boolean visible) Set the visibility of app bar shadow.- Parameters:
visible-trueto 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-trueto 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
DynamicViewPagerFragmentto add the tabs automatically.- Parameters:
view- The view to be added in the header frame.removePrevious-trueto remove the previously added views.animate-trueto 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
DynamicViewPagerFragmentto add the tabs automatically.- Parameters:
view- The view to be added in the header frame.removePrevious-trueto 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
DynamicViewPagerFragmentto add the tabs automatically.- Parameters:
layoutRes- The layout resource to be added in the header frame.removePrevious-trueto remove the previously added views.animate-trueto 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
DynamicViewPagerFragmentto add the tabs automatically.- Parameters:
layoutRes- The layout resource to be added in the header frame.removePrevious-trueto 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-trueto show the progress bar below the app bar.
-
setBottomBarShadowVisible
public void setBottomBarShadowVisible(boolean visible) Set the visibility of bottom bar shadow.- Parameters:
visible-trueto 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-trueto 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-trueto 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:
trueto 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-trueto 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-trueto 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:
trueif 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:DynamicSearchListenerThis method will be called when the search view is expanded.- Specified by:
onSearchViewExpandedin interfaceDynamicSearchListener
-
onSearchViewCollapsed
public void onSearchViewCollapsed()Description copied from interface:DynamicSearchListenerThis method will be called when the search view is collapsed.- Specified by:
onSearchViewCollapsedin interfaceDynamicSearchListener
-
getTextWatcher
Description copied from interface:DynamicSearchListenerThis method will be called to get the text watcher for the search view.- Specified by:
getTextWatcherin interfaceDynamicSearchListener- Returns:
- The text watcher for the search view.
-
onBackPressed
public void onBackPressed()- Overrides:
onBackPressedin 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:
setFABVisibilityin 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:
setExtendedFABVisibilityin 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-trueif 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-trueif 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:DynamicSnackbarMake 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:
getSnackbarin interfaceDynamicSnackbar- Parameters:
text- The text to show. Can be formatted text.duration- The duration of the snackbar.BaseTransientBottomBar.LENGTH_SHORT,BaseTransientBottomBar.LENGTH_LONGorBaseTransientBottomBar.LENGTH_INDEFINITE.- Returns:
- The snackbar with the supplied parameters.
Use
Snackbar.show()to display the snackbar.
-
getSnackbar
Description copied from interface:DynamicSnackbarMake 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:
getSnackbarin interfaceDynamicSnackbar- Parameters:
stringRes- The string resource for the snackbar.duration- The duration of the snackbar.BaseTransientBottomBar.LENGTH_SHORT,BaseTransientBottomBar.LENGTH_LONGorBaseTransientBottomBar.LENGTH_INDEFINITE.- Returns:
- The snackbar with the supplied parameters.
Use
Snackbar.show()to display the snackbar.
-
getSnackbar
Description copied from interface:DynamicSnackbarMake 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:
getSnackbarin 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:DynamicSnackbarMake 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:
getSnackbarin 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:DynamicSnackbarThis method will be called to show the snackbar.- Specified by:
onSnackbarShowin interfaceDynamicSnackbar- Parameters:
snackbar- The snackbar to be shown.
-