Type Gallery is out of date

imageView.setLayoutParams(new Gallery.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT)); 

What are the other methods to replace the gallery. Therefore, I can use horizontal scrolling in action

+6
source share
1 answer

Gallery documentation says:

This widget is no longer supported. Other horizontal scroll widgets include the HorizontalScrollView and ViewPager from the support library.

The best way for you is to use ViewPager with ImageView in the fragment layout.

You can see this sample Android Gallery (no longer supported). There are also other gallery implementations on GitHub .

+4
source

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


All Articles