Class DynamicNavigationActivity

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, NavigationBarView.OnItemSelectedListener, DynamicLocale, DynamicListener, DynamicSearchListener, DynamicSnackbar, DynamicTransitionListener, DynamicProductFlavor

public abstract class DynamicNavigationActivity extends DynamicActivity implements NavigationBarView.OnItemSelectedListener
A DynamicActivity to handle everything related to the BottomNavigationView and NavigationRailView.

It also has many other useful functions to customise according to the requirements.

  • Constructor Details

    • DynamicNavigationActivity

      public DynamicNavigationActivity()
  • Method Details

    • onCreate

      protected void onCreate(@Nullable Bundle savedInstanceState)
      Overrides:
      onCreate in class DynamicActivity
    • getLayoutRes

      @LayoutRes protected int getLayoutRes()
      Description copied from class: DynamicActivity
      Returns the layout resource for this activity.
      Overrides:
      getLayoutRes in class DynamicActivity
      Returns:
      The layout resource for this activity.
    • isApplyFooterInsets

      public boolean isApplyFooterInsets()
      Description copied from class: DynamicSystemActivity
      Returns whether to apply footer window insets.
      Overrides:
      isApplyFooterInsets in class DynamicSystemActivity
      Returns:
      true to apply footer window insets.
    • setWindowStatusBarColor

      protected void setWindowStatusBarColor(int color)
      Description copied from class: DynamicSystemActivity
      Set the status bar color.

      It will be applied only on the API 21 and above.

      Overrides:
      setWindowStatusBarColor in class DynamicSystemActivity
      Parameters:
      color - Color to be applied on the status bar.
    • setNavigationBarViewMenu

      public void setNavigationBarViewMenu(@MenuRes int menuRes)
      Set menu for the navigation bar view.
      Parameters:
      menuRes - The menu resource id for the navigation bar view.
    • setSelectedItemId

      public void setSelectedItemId(@IdRes int itemId)
      Set the select item for bottom navigation bar view.
      Parameters:
      itemId - The menu item id to be selected.
    • onNavigationItemSelected

      public boolean onNavigationItemSelected(@NonNull MenuItem item)
      Specified by:
      onNavigationItemSelected in interface NavigationBarView.OnItemSelectedListener
    • getNavigationBarView

      @Nullable public NavigationBarView getNavigationBarView()
      Returns the navigation bar view used by this activity.
      Returns:
      The navigation bar view used by this activity.