PatelVatsalB21 commented on a change in pull request #156:
URL: https://github.com/apache/fineract-cn-mobile/pull/156#discussion_r596552161



##########
File path: 
app/src/main/java/org/apache/fineract/ui/online/groups/creategroup/AddGroupMemberStepFragment.kt
##########
@@ -108,17 +108,36 @@ class AddGroupMemberStepFragment : 
FineractBaseFragment(), Step, NameListAdapter
                         .addErrorCallback { etNewMember.error = it }.check()) {
             if (currentAction == GroupAction.CREATE) {
                 members.add(etNewMember.text.toString())
+                hideAddMemberView()
             } else {
-                members[editItemPosition] = etNewMember.text.toString()
+                if (members[editItemPosition] != etNewMember.text.toString()) {
+                    MaterialDialog.Builder().init(context).apply {
+                        
setTitle(getString(R.string.dialog_title_confirm_updation))
+                        
setMessage(getString(R.string.dialog_message_confirm_name_updation, 
members[editItemPosition]))
+                        setPositiveButton(getString(R.string.update)
+                        ) { dialog: DialogInterface?, _ ->
+                            members[editItemPosition] = 
etNewMember.text.toString()
+                            hideAddMemberView()
+                            dialog?.dismiss()
+                        }
+                        
setNegativeButton(getString(R.string.dialog_action_cancel))
+                        createMaterialDialog()
+                    }.run { show() }

Review comment:
       @EGOR-IND it would be better if a function is made for dialog as it is 
used 2 times and **passing it necessary parameters to either hide or work with 
Member or Leader**. It would shorten the code and reduces the redundancy.
   ```suggestion
   
                    showUpdateConfirmDialog(Int type , other parameters if 
required)
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to