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