GithubHelp home page GithubHelp logo

yarolegovich / materialpreferences Goto Github PK

View Code? Open in Web Editor NEW
485.0 15.0 67.0 2.57 MB

A highly flexible set of lovely looking views that provides functionality of preferences.

License: Apache License 2.0

Java 100.00%
android android-ui android-library preferences sharedpreferences material-design material-ui

materialpreferences's People

Contributors

antonkozyriatskyi avatar baris-fidan avatar mrbimc avatar yarolegovich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

materialpreferences's Issues

Missing setters

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
  • And more...

Support for RTL

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

CompositeClickListener doesn't function as expected

CompositeClickListener maintains a list of View.OnClickListeners 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:

  • Invert controller.getValue() and !controller.getValue() at line 73 of MaterialPreferenceScreen
  • Iterating through the CompositeClickListener forward instead of backward
  • Creating a separate OnPreferenceChangedListener and relying on that for setVisibilityController (this could be more broadly useful as well)
  • Having AbsMaterialCheckablePreference set a composite CompositeClickListener which always delegates to the AbsMaterialCheckablePreference first.

Define MaterialChoicePreference entries at runtime

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?

Problem using MaterialPreferences and tabs.

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

jCenter() issue

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()

Layout inflating error

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) 

Padding

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.