From 40b686c889d50c6ffb2fe2a1ea8c2e953c4ffcfc Mon Sep 17 00:00:00 2001 From: Priyansh-Kedia Date: Sat, 3 Oct 2020 02:17:17 +0530 Subject: [PATCH] bug fix --- .../src/main/java/com/kedia/customcamera/CCMultiple.kt | 3 ++- .../main/java/com/kedia/customcamera/CustomImageAdapter.kt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/customcamera/src/main/java/com/kedia/customcamera/CCMultiple.kt b/customcamera/src/main/java/com/kedia/customcamera/CCMultiple.kt index f53128f..50161dd 100644 --- a/customcamera/src/main/java/com/kedia/customcamera/CCMultiple.kt +++ b/customcamera/src/main/java/com/kedia/customcamera/CCMultiple.kt @@ -427,8 +427,9 @@ class CCMultiple : FrameLayout, CustomImageAdapter.CustomAdapterClick, Lifecycle } - override fun onDeleteImageClicked(adapterPosition: Int) { + override fun onDeleteImageClicked(adapterPosition: Int, bitmap: Bitmap?) { customCameraAdapter.removeItem(adapterPosition) + imageArrayList.remove(bitmap) Log.d(TAG, imageArrayList.toString()) imageCount.text = "${customCameraAdapter.itemCount}" if (customCameraAdapter.itemCount == 0) diff --git a/customcamera/src/main/java/com/kedia/customcamera/CustomImageAdapter.kt b/customcamera/src/main/java/com/kedia/customcamera/CustomImageAdapter.kt index c528e0d..42965ea 100644 --- a/customcamera/src/main/java/com/kedia/customcamera/CustomImageAdapter.kt +++ b/customcamera/src/main/java/com/kedia/customcamera/CustomImageAdapter.kt @@ -63,13 +63,13 @@ class CustomImageAdapter( Glide.with(context).load(item).into(imageView) cancelImage.setOnClickListener { - onClick?.onDeleteImageClicked(adapterPosition) + onClick?.onDeleteImageClicked(adapterPosition, item) } } } interface CustomAdapterClick { - fun onDeleteImageClicked(adapterPosition: Int) + fun onDeleteImageClicked(adapterPosition: Int, bitmap: Bitmap?) } } \ No newline at end of file