github

TangXiaoLv / TelegramGallery

  • пятница, 23 сентября 2016 г. в 03:14:08
https://github.com/TangXiaoLv/TelegramGallery

Java
world level Gallery , from Telegram ,QQ 相册风格,相册选择器



TelegramGallery

English | 中文

Fast,efficiently,low memory selector of album,extract from Telegram. Support singleSelection, Multiselect, photo preview,scalable ,sliding to quit preview,QQ pick style.

Getting Started

configuration

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

    <activity android:name="com.tangxiaolv.telegramgallery.GalleryActivity" />

Usage

//open album
GalleryActivity.openActivity(
            Activity activity,
            //Filter the specified type, Follow the rule of standard of mime type 。eg:new String[]{"image/gif","image/png"}
            String[] filterMimeTypes,
            //true:singleSelection,false: Multiselect
            boolean singlePhoto,
            //limit for pick photo nums,when singlePhoto=false,the param is available
            int limitPickPhoto,
            int requestCode)

//or
GalleryActivity.openActivity(Activity activity, boolean singlePhoto, int limitPickPhoto,int requestCode)

//or
GalleryActivity.openActivity(Activity activity, boolean singlePhoto, int requestCode)

//process result
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {

    //list of photos of seleced
    List<String> photos = (List<String>) data.getSerializableExtra(GalleryActivity.PHOTOS);

    //list of videos of seleced
    List<String> vides = (List<String>) data.getSerializableExtra(GalleryActivity.VIDEOS);
}

License

GPL-2.0