What should be used instead of "setListNavigationCallbacks"?

Background

setListNavigationCallbacks is used to allow the user to easily switch between different views of the current screen through the ActionBar, as shown in the figure here and here .

Problem

I noticed that it is deprecated from API21 (Lollipop), and that all the documentation says that you need to look for different navigation solutions, but it does not say which of the best is suitable for the same point:

This method is deprecated. The navigation modes of the action bar are outdated and not supported by the built-in toolbar action panels. Consider using other common navigation patterns .

All other functions / classes associated with this function are also deprecated, e.g. setNavigationMode , OnNavigationListener , ActionBar.NAVIGATION_MODE_LIST .

What i tried

  • The navigation box is intended for navigation on different screens, and not for different types of the same screen.

  • adding an action element that provides a way to switch between modes, but a little strange ...

  • using ViewPager, but it’s also weird as it really doesn’t switch views and also takes up more space.

  • Using tabs, but I think it is deprecated too, and it takes up more space.

Question

What should be the best alternative to this navigation path?

+6
source share
1 answer

This post explains why not only list-, but all navigation modes are outdated. Too difficult to make it capable of customizing Actionbar navigation. The toolbar is a new action bar (also available in the appcompat-v7 support library). However, you also will not find these methods. Instead, you need to provide your own additional (navigation) views. Then you can use it as a normal view in your layout.

+1
source

Source: https://habr.com/ru/post/977062/


All Articles