Ameer Ameer - 2 months ago 10
Android Question

The type Gallery is deprecated

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


What are the other methods to replace Gallery. So I can use a horizontal scrolling in activity

Answer Source

The Gallery documentation says:

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

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

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