Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type Gallery is deprecated

Tags:

android

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

like image 866
Ameer Avatar asked Sep 23 '13 06:09

Ameer


People also ask

What is the gallery in Android?

Gallery is an offline photo gallery. You can use it to edit, find, and manage photos without being connected to the Internet. Gallery also works with SD cards on Android devices. Tip: Gallery is available on Android devices.

What is the difference between gallery and image view?

Galleries are a collection of images (like a category for images) whereas an image is an individual picture file. Before you upload an image you'll need to decide which gallery you're going to upload it into.


1 Answers

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.

like image 95
Mario Kutlev Avatar answered Oct 18 '22 06:10

Mario Kutlev