yarolegovich / materialpreferences Goto Github PK
View Code? Open in Web Editor NEWA highly flexible set of lovely looking views that provides functionality of preferences.
License: Apache License 2.0
A highly flexible set of lovely looking views that provides functionality of preferences.
License: Apache License 2.0
First of all, thank you for this wonderful library. I am using MaterialChoicePreference to select the path where data is stored in my app, based on the available storage units. Currently I use a string array with the values "internal storage" and "micro sd" respectively. However, I need to assign these values at run time based on the availability of storage units at a given time. How could I achieve this?
It's not possible to add padding left and right ? For the moment, I used LinearLayout in MaterialPreferenceCategory.
And It'll be great for single choice to show the selected pref when it launch and for the others to show in the editbox the value if it exists already too.
Dear sir,
Thanks for the nice library :)
I need to know How to read setting value in my code ?, eg in main MainActivity screen
Thanks.
This repo can be accessed from jitpack using com.github.yarolegovich:MaterialPreferences:1.1.6
but it depends on LovelyDialog library, which is not on jitpack. Hence can not access this library through jitpack if not declare jCenter()
Many properties can be set only from XML, but sometimes you need to adjust these values programmatically.
Missing setters:
MaterialSeekBarPreference#minValue
MaterialSeekBarPreference#maxValue
MaterialSeekBarPreference#showValue
AbsMaterialPreference#key
AbsMaterialPreference#defaultValue
CompositeClickListener
maintains a list of View.OnClickListener
s and when it receives a click event it iterates through the list backward, delegating the click to each in turn. The problem with this approach is that in the case of AbsMaterialCheckablePreference
the preference sets itself as a listener in its onViewCreated
method, which is the listener responsible for switching the value. Because this is the first listener in the CompositeClickListener
's list, it is the last to be executed, so all other click listeners will be executed using the old value of the preference should they call getValue()
.
This is particularly notable with MaterialPreferenceScreen#setVisibilityController
as it sets a click listener on the controller MaterialPreference
which is consistently invoked with the wrong boolean value. The sample app demonstrates this behavior (despite what appears to be an attempt to correct for it by setting showWhenChecked
to false
when it really wants to be true
). When you enter the AppConfigActivity
, the visibility of Location will be the opposite of what Automatic Location would indicate (because at this point it has the correct value and is respecting showWhenChecked = false
. When you switch the value for the first time, the visibility will not change (as it is still using the old value).
Possible solutions include:
controller.getValue()
and !controller.getValue()
at line 73 of MaterialPreferenceScreenCompositeClickListener
forward instead of backwardOnPreferenceChangedListener
and relying on that for setVisibilityController
(this could be more broadly useful as well)AbsMaterialCheckablePreference
set a composite CompositeClickListener
which always delegates to the AbsMaterialCheckablePreference
first.When I use use MaterialPreferences with tabs and I jump from one tab to another, it clears the input on the tabs. it doesn't affect the data saved in preferences, just the views, it resets it.
See a video of my screen demonstrating this problem Watch Video
Hi, thanks for this awesome and useful library
I was wondering is there any way to use it for rtl languages? my app's minimum SDK is 9 and it can't use the built-in RTL support.
thanks
Hi,
Is there a way to dynamically define the entries for the list (instead of static resource array)?
Also, is the list scrollable?
regards
Caused by: android.view.InflateException: Binary XML file line #31: Error inflating class com.yarolegovich.mp.MaterialPreferenceCategory at android.view.LayoutInflater.createView(LayoutInflater.java:620) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at android.view.LayoutInflater.inflate(LayoutInflater.java:353) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at eu.inovim.cisurvey.ui.SettingsActivity.onCreate(SettingsActivity.java:13) at android.app.Activity.performCreate(Activity.java:5133) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) at android.app.ActivityThread.access$600(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5103) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.