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

how to show divider between preference when merged to androidX-1.0.0/support-28 #192

Open
BrightVan opened this issue Dec 23, 2018 · 1 comment

Comments

@BrightVan
Copy link

BrightVan commented Dec 23, 2018

before support-28/androidX-1.0.0, there has divider between preference;
but now, only can show divider between PreferenceCategory;
i want to show divider between preference, and the divider line not match-parent,
it has a margin with the icon, like the below effect

------------------------
😇 title
   ---------------------
😇 title
   ---------------------
😇 title
   ---------------------
😇 title
------------------------
@BrightVan BrightVan changed the title is there anyone knows that how to show divider between preference when merged to androidx-V1.0.0 how to show divider between preference when merged to androidX-1.0.0/support-28 Dec 23, 2018
@BrightVan
Copy link
Author

after read the source code, i find the way to add divider:

<Preference
            android:enabled="true"
            ....
            app:allowDividerAbove="true"
            app:allowDividerBelow="true"
           />

<Preference
            android:enabled="true"
            ....
            app:allowDividerAbove="true"
            app:allowDividerBelow="true"
           />

attention:both items should allowDivider if you want to show a divider between them.
and the first(last) preference item in a PreferenceCategory, you just need to set
app:allowDividerAbove="true/false" (app:allowDividerBelow="true/false") to control

but i am still do not know how to set a marginStart of a divider!

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

No branches or pull requests

1 participant