ImageSelector

Android Image picker. Fully free customization, support gallery multi-selection/single selection/picture clipping/photo taking/custom picture loading library/immersive status bar

Rely on

Dependencies {the compile 'com. Yuyh. Imgsel: library: 1.1.1'}Copy the code

V1.1.1 partial update to solve image flicker problem

V1.1.0 added the option to customize the back button icon and configure the immersive status bar

V1.0.0 Initial release

use

Configure permissions




Copy the code

use

Private ImageLoader loader = new ImageLoader() {@override public void displayImage(Context); String path, ImageView ImageView) {// TODO can customize the image loading library to load ImageView, Glide, Picasso, ImageLoader, Glide. With (context).load(path). Into (imageView); }}; ImgSelConfig config = new imgSelConfig. Builder(loader) // multiSelect(false) // "OK" button background color .btnbgColor (color.gray) // "Ok" button text color.btnTextColor (color.blue) // Use the immersive status bar.statusBarColor(color.parsecolor ("#3F51B5")) / / return icon ResId. BackResId (android. Support. V7. Appcompat. R.d rawable. Abc_ic_ab_back_mtrl_am_alpha) / / title. The title (" image ") / / Title text color.titlecolor (color.white) // TitleBar background color.titlebgColor (color.parsecolor ("#3F51B5")) // Trim size. .cropsize (1, 1, 200, 200).needCrop(true).needCamera(false).maxNum(9).build(); / / jump to picture selector ImgSelActivity. The startActivity (this config, REQUEST_CODE);Copy the code

@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); If (requestCode == REQUEST_CODE && resultCode == RESULT_OK && data! = null) { List pathList = data.getStringArrayListExtra(ImgSelActivity.INTENT_RESULT); for (String path : pathList) { tvResult.append(path + "\n"); }}}Copy the code