Android 相冊Gallery組件:ImageGallery

jopen 9年前發布 | 13K 次閱讀 Android開發 移動開發 ImageGallery

一個Android相冊組件支持展示任何圖片數組。 你可以添加單張或更多的圖片至相冊中。支持使用Palette來設置背景顏色。

Palette color 類型

  • VIBRANT
  • LIGHT_VIBRANT
  • DARK_VIBRANT
  • MUTED
  • LIGHT_MUTED
  • DARK_MUTED

Supports pinch-to-zoom on the images

Uses XImage to resize large images like those seen on Unsplash

ImageGallery

ImageGallery

Setup

Gradle

compile 'com.github.lawloretienne:imagegallery:0.0.7'

Maven

<dependency>
    <groupId>com.github.lawloretienne</groupId>
    <artifactId>imagegallery</artifactId>
    <version>0.0.7</version>
</dependency>

Sample Usage

Intent intent = new Intent(MainActivity.this, ImageGalleryActivity.class);

ArrayList<String> images = new ArrayList<>();

images.add("https://images.unsplash.com/photo-1437422061949-f6efbde0a471?q=80&fm=jpg&s=e23055c9ba7686b8fe583fb8318a1f88");
images.add("https://images.unsplash.com/photo-1434139240289-56c519f77cb0?q=80&fm=jpg&s=13f8a0d1c2f96b5f311dedeb17cddb60");
images.add("https://images.unsplash.com/photo-1429152937938-07b5f2828cdd?q=80&fm=jpg&s=a4f424db0ae5a398297df5ae5e0520d6");
images.add("https://images.unsplash.com/photo-1430866880825-336a7d7814eb?q=80&fm=jpg&s=450de8563ac041f48b1563b499f56895");
images.add("https://images.unsplash.com/photo-1429547584745-d8bec594c82e?q=80&fm=jpg&s=e9a7d9973088122a3e453cb2af541201");
images.add("https://images.unsplash.com/photo-1429277158984-614d155e0017?q=80&fm=jpg&s=138f154e17a304b296c953323862633b");
images.add("https://images.unsplash.com/photo-1429042007245-890c9e2603af?q=80&fm=jpg&s=8b76d20174cf46bffe32ea18f05551d3");
images.add("https://images.unsplash.com/photo-1429091967365-492aaa5accfe?q=80&fm=jpg&s=b7430cfe5508430aea39fcf3b0645878");
images.add("https://images.unsplash.com/photo-1430132594682-16e1185b17c5?q=80&fm=jpg&s=a70abbfff85382d11b03b9bbc71649c3");
images.add("https://images.unsplash.com/photo-1436891620584-47fd0e565afb?q=80&fm=jpg&s=33cf5b0ee9fbd292475a0c03bee481c9");

intent.putStringArrayListExtra("images", images);
// optionally set background color using Palette
intent.putExtra("palette_color_type", PaletteColorType.VIBRANT);

startActivity(intent);

項目主頁:http://www.baiduhome.net/lib/view/home/1442053490899

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!