Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 13880 Hide last divider in XML Lists #327

Merged
merged 4 commits into from
Jan 11, 2024

Conversation

pmartinbTEF
Copy link
Contributor

@pmartinbTEF pmartinbTEF commented Jan 10, 2024

🥅 What's the goal?

Hide last divider by default in xml lists.

In Compose elements and dividers are added manually so no changes needed

🚧 How do we do it?

Check is last element in DividerItemDecoration

☑️ Checks

  • I updated the documentation, including readmes and wikis. If this is a breaking change, update UPGRADING.md to inform users how to proceed. If no updates are necessary, indicate so.
  • Tested with dark mode.
  • Tested with API 23.

🧪 How can I test this?

  • Create a MisticaRecyclerView in xml
  • Check that last divider is hidden
  • Added Screenshot test


val list: MisticaRecyclerView = view.findViewById(R.id.test_list)
list.adapter = ClickableListAdapter()
compareScreenshot(Espresso.onView(ViewMatchers.withId(R.id.test_recycler_view)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't also be the screenshot (the image) here in the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Copy link

📱 New catalog for testing generated: Download

Comment on lines +9 to +16
<com.telefonica.mistica.list.MisticaRecyclerView
android:id="@+id/test_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:nestedScrollingEnabled="false"
app:listLayoutType="full_width"
/>
Copy link
Contributor

@jeprubio jeprubio Jan 10, 2024

Choose a reason for hiding this comment

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

Perhaps this could also be created programmatically and inserted in the dummy layout. But I'm not against this, if we need to test several MisticaRecyclerView elements perhaps it's simpler this way. And it's only a layout in the test directory, should be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this approach is simpler and, as you said, the layout is only added to the test directory :)

Copy link
Contributor

@jeprubio jeprubio left a comment

Choose a reason for hiding this comment

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

Nice approach 👏 check if the new screenshot should also be in this pr.
I think it should: Compare Screenshots has failed as expected.

Copy link
Contributor

@jeslat jeslat left a comment

Choose a reason for hiding this comment

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

👍

Copy link

📱 New catalog for testing generated: Download

@pmartinbTEF pmartinbTEF merged commit afb1e1a into main Jan 11, 2024
5 checks passed
@pmartinbTEF pmartinbTEF deleted the ANDROID-13880-Hide_last_divider branch January 11, 2024 10:09
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.

3 participants