Class AdminNavigationHelper

java.lang.Object
com.example.lottery.util.AdminNavigationHelper

public final class AdminNavigationHelper extends Object
Centralised helper that wires up the admin bottom-navigation bar (layout_bottom_nav_admin.xml) in every admin screen.

Call setup(Activity, AdminTab, String) (or the overload with finishOnNavigate) from onCreate after setContentView.

  • Method Details

    • overrideTabWithoutFinish

      public static void overrideTabWithoutFinish(android.app.Activity activity, AdminNavigationHelper.AdminTab tab, String userId)
      Re-wires a single tab so it navigates to the target Activity without calling finish() on the source. Use after setup(android.app.Activity, com.example.lottery.util.AdminNavigationHelper.AdminTab, java.lang.String) with finishOnNavigate = true to selectively keep the source screen alive for certain tabs.
    • setup

      public static void setup(android.app.Activity activity, AdminNavigationHelper.AdminTab currentTab, String userId)
      Highlights the active tab and wires every tab's click listener.
      Parameters:
      activity - the hosting Activity
      currentTab - which tab this screen represents
      userId - the admin's userId (may be null)
    • setup

      public static void setup(android.app.Activity activity, AdminNavigationHelper.AdminTab currentTab, String userId, boolean finishOnNavigate)
      Highlights the active tab and wires every tab's click listener.
      Parameters:
      activity - the hosting Activity
      currentTab - which tab this screen represents
      userId - the admin's userId (may be null)
      finishOnNavigate - if true, calls finish() after starting the target Activity (use for detail screens)