function

  • Generate similar nail, wechat group chat profile picture Bitmap
  • You can load the image resource ID, bitmap, or url from the network, passing in the corresponding array
  • Thread pools are supported during network loading
  • Supports disk cache and memory cache. (Remember to apply for file storage permissions for disk caching)
  • Sample rate compression of image resources
  • Supports click events for sub-images
  • .

Basic usage

Add the JitPack repository to build.gradle in the project root directory:

allprojects {
    repositories{... maven { url"https://jitpack.io"}}}Copy the code

Step 2. Add project dependencies

dependencies {
    implementation 'com. Making. Othershe: CombineBitmap: 1.0.5'
}
Copy the code

Step 3. The configuration

CombineBitmap.init(context)
    .setLayoutManager() // Mandatory. Set the image combination form. WechatLayoutManager and DingLayoutManager are supported
    .setSize() // Mandatory. Size of the combined Bitmap in unit dp
    .setGap() // The distance between individual images, unit dp, default 0dp
    .setGapColor() // Single image spacing color, default white
    .setPlaceholder() // The default image is displayed when a single image fails to load
    .setUrls() // An array of image URLS to load
    .setBitmaps() // An array of image bitmaps to load
    .setResourceIds() // An array of image resource ids to load
    .setImageView() // Directly set the ImageView to display the image
    // To set the click event for "sub-image", use setImageView(), index and the image resource array index
    .setOnSubItemClickListener(new OnSubItemClickListener() {
        @Override
        public void onSubItemClick(int index) {}})If setImageView() is not used, the final image can be displayed in onComplete()
    .setProgressListener(new ProgressListener() {
        @Override
        public void onStart(a) {}@Override
        public void onComplete(Bitmap bitmap) {

        }
    })
    .build();
Copy the code

Since the generated composite Bitmap is rectangular, to achieve the circular display effect of the nails, we use a circular ImageView control: NiceImageView

For more details, see GitHub: github.com/Othershe/Co…