|
@@ -43,7 +43,7 @@ class SignatureTabView : ConstraintLayout {
|
|
|
updateSignaturePaths()
|
|
|
updateSignatureMessage()
|
|
|
|
|
|
- recyclerView_signature.layoutManager = GridLayoutManager(context, 1)
|
|
|
+ recyclerView_signature.layoutManager = GridLayoutManager(context, resources.getInteger(R.integer.mediaBox_signature_columnCount))
|
|
|
val adapter = SignatureAdapter(context, signaturePaths)
|
|
|
adapter.setOnSignatureClickListener(object : OnSignatureClickListener {
|
|
|
override fun onSignatureClick(path: String) {
|
|
@@ -54,6 +54,12 @@ class SignatureTabView : ConstraintLayout {
|
|
|
adapter.setOnSignatureRemoveListener(object : OnSignatureRemoveListener {
|
|
|
override fun onSignatureRemove(path: String) {
|
|
|
val position = signaturePaths.indexOf(path)
|
|
|
+
|
|
|
+ val layoutManager = recyclerView_signature.layoutManager as GridLayoutManager
|
|
|
+ val updateRow = (position - 1) / layoutManager.spanCount
|
|
|
+ val positionStart = updateRow * layoutManager.spanCount
|
|
|
+ adapter.notifyItemRangeChanged(positionStart, adapter.itemCount - positionStart)
|
|
|
+
|
|
|
signaturePaths.removeAt(position)
|
|
|
adapter.notifyItemRemoved(position)
|
|
|
File(path).delete()
|