-
Notifications
You must be signed in to change notification settings - Fork 138
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
Create MaterialAboutToggleItem #77
Comments
MaterialAboutToggleItem? Don't think I've created one of these - is it in a forked library. I've actually wanted to implement some items like this so that people can use the library as a settings page also. Also, it should definitely be possible to implement. |
Hi, this functionality has been implemented in a fork at by @filol here: https://github.com/filol/material-preference-library |
@daniel-stoneuk Perhaps you can close this issue as it was merged? |
@Robyer we haven't merged it into the main branch yet since it's performance is pretty terrible. |
@daniel-stoneuk Aha, I saw on the MaterialPreferenceLibrary notice that that library is deprecated now as it was merged to MAL. |
Also, I'm comparing the changes between your branch and master and I noticed some weird things:
|
@daniel-stoneuk I pushed some fixes for the preferences branch. |
Yep spot on with the edit, and you're right. We should implement a function to compare just the visuals - generating the strings and then comparing them is probably quite slow and wasteful. I've created issue #91. Probably won't get round to fixing this until after my University interview in a couple weeks. The performance issues I was noticing were during scrolling. Lots of frames were dropped, which doesn't really give a good user experience. Because of this, I didn't clean up the PR too much & kept it in a separate branch. I think part of this is due to the inherent performance issues that come with using nested RecyclerViews - I knew from the start that this wouldn't be a great idea for scalability, however it seemed most practical & I didn't want to include library like groupie, which might struggle to display a cardview beneath the items. Another perk of the nested RVs is the ability to use custom adapters like LicenseAdapter. Would you say the fixes you've made are ready to be merged? Thanks very much for the commits - as I mentioned, I don't have much free time right now but in a couple weeks should be able to put more work into it if required. |
@daniel-stoneuk As I now tried it, the bad performance during scrolling really seems to be caused by the nested RecyclerViews - it can be seen when you scroll down slowly, when the Custom Adapter should be drawn, it lags for some hundreds of milliseconds. So problem is not in the checkbox/toggle. I think the preferences branch could be merged (as it is not the cause of bad scrolling performance), but the feature should be improved in the future - e.g. configure on click listener to whole row so it will change checkbox/toggle when clicking anywhere on the row. Or also I think changing the row checked state programatically won't work. But that is related only to new 2 items, everything in library should work same as before, that why I think you can merge it. |
Hmm, maybe the scrolling issues are also caused by the DiffUtil, as it seems it freezes a bit for me always when new card should be added/drawn for first time during scrolling. It should be tested, where the issue really is, but that should be new separate issue as it is not related to this issue. |
Hi! Is it possible to set a toggle state programmatically?
It looks like
MaterialAboutToggleItem
doesn't have such method.I have a case when I should set toggle back depending on user answer. Like if user toggles “set fullscreen”, then we show him permission dialog and if the user denies to give the permission, we uncheck the toggle back programmatically.
The text was updated successfully, but these errors were encountered: