gregkorossy / Android-Support-Preference-V7-Fix

Android androidx.preference support library has some issues, this lib tries to fix them.
https://discord.gg/87NVsSK
Apache License 2.0
497 stars 46 forks source link

how to get items from custom view #194

Open danwguy opened 5 years ago

danwguy commented 5 years ago

I have a custom preference layout because I needed a progress dialog in one of my preferences, so I used a custom widget layout and just created a simple ConstraintLayout with a ProgressBar in it. The problem I am having is, I can't get a hold of that ProgressBar from my PreferenceFragment to update the progress based on the action that is happening. Essentially I am allowing a user to reset their app, it deletes all the SharedPreferences, then exits the app and restarts it. I am using commit() not apply() for the SharedPreferences because using apply() then calling exit() and loading the app back up, the SharedPreferences don't actually get wiped. The app loads with the old preferences still in tact. All that aside, I need to know how to get a hold of the ProgressBar that is inside a custom widget layout from the PreferenceFragment. I can provide code samples if needed, it is pretty simple so I wasn't sure if it was needed. Thank you.

gregkorossy commented 5 years ago

Some code would be helpful. It basically depends on what techniques you use now.