Skip to content

AC-700 Refined custom dialog box in add patient activity#731

Merged
f4ww4z merged 3 commits intoopenmrs:masterfrom
rishabh-997:AC-700
May 11, 2020
Merged

AC-700 Refined custom dialog box in add patient activity#731
f4ww4z merged 3 commits intoopenmrs:masterfrom
rishabh-997:AC-700

Conversation

@rishabh-997
Copy link
Collaborator

Description of what I changed

  1. Removed previous custom dialog fragment
  2. Created Another dialog fragment in which we can pass more parameters, has a recycler view to increasing its functionality and readability.
  3. Created interface to handle click events between both fragments.

Issue I worked on

JIRA Issue: https://issues.openmrs.org/browse/AC-700

Checklist: I completed these to help reviewers :)

  • My pull request only contains ONE single commit
    (the number above, next to the 'Commits' tab is 1).
  • I have added tests to cover my changes. (If you refactored
    existing code that was well tested you do not have to add tests)
  • All new and existing tests passed.
  • My pull request is based on the latest changes of the master branch.

@rishabh-997 rishabh-997 requested a review from f4ww4z May 8, 2020 22:52
Copy link
Collaborator

@f4ww4z f4ww4z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rishabh-997 , see my comments below.

public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_my_custom, container, false);
RecyclerView recyclerView = view.findViewById(R.id.recyclerView_dialog);
list.add(new CustomDialogModel("Take a photo", R.drawable.ic_photo_camera));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put "Take a photo" in a string resource.

View view = inflater.inflate(R.layout.dialog_my_custom, container, false);
RecyclerView recyclerView = view.findViewById(R.id.recyclerView_dialog);
list.add(new CustomDialogModel("Take a photo", R.drawable.ic_photo_camera));
list.add(new CustomDialogModel("Choose photo", R.drawable.ic_photo_library));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put "Choose photo" in a string resource.

RecyclerView recyclerView = view.findViewById(R.id.recyclerView_dialog);
list.add(new CustomDialogModel("Take a photo", R.drawable.ic_photo_camera));
list.add(new CustomDialogModel("Choose photo", R.drawable.ic_photo_library));
if (showRemoveButton)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the OpenMRS Java conventions, if statements should always have curly braces.

list.add(new CustomDialogModel("Take a photo", R.drawable.ic_photo_camera));
list.add(new CustomDialogModel("Choose photo", R.drawable.ic_photo_library));
if (showRemoveButton)
list.add(new CustomDialogModel("Remove photo", R.drawable.ic_photo_delete));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Place "Remove photo" in a string resource.

android:layout_marginEnd="50dp"
android:layout_marginRight="50dp"
android:paddingEnd="15dp"
android:paddingRight="15dp"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be even sized, e.g. 16dp

@rishabh-997
Copy link
Collaborator Author

Done with the changes @f4ww4z sir

Copy link
Collaborator

@f4ww4z f4ww4z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@f4ww4z f4ww4z merged commit 855d73a into openmrs:master May 11, 2020
@rishabh-997 rishabh-997 deleted the AC-700 branch May 12, 2020 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants