ColorPickerPreferenceCompat
u1aryz
9
Visit GitHub RepoBackward Compatibility

ColorPickerPreferenceCompat

Android Arsenal API Download License

This is color picker for v7 Preference Support Library.
The original ColorPickerView was written by Daniel Nilsson

    

Including in project

dependencies {
  compile 'com.u1aryz:colorpicker-preference-compat:0.1.0'
}

How to use

Add the ColorPreference to your preference xml.

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.preference.PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

  <com.u1aryz.android.colorpicker.ColorPreference
      android:defaultValue="0xFF4183C4"
      android:key="color1"
      android:persistent="false"
      android:title="Color 1"
      app:alphaSlider="true"
      />

  ...

</android.support.v7.preference.PreferenceScreen>

You have to extend ColorPreferenceFragmentCompat to your fragment.

public class MyPreferenceFragment extends ColorPreferenceFragmentCompat {

    @Override public void onCreatePreferences(Bundle bundle, String s) {
        addPreferencesFromResource(R.xml.my_pref);
    }
}

License

Copyright 2017 Daniel Nilsson
Copyright 2017 u1aryz

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Join India's largest learning revolution
Free Video Tutorials
Learn Programming
Learning is a journey, let's learn together

MindOrks Newsletter
100,000+ Subscribers
A free weekly newsletter that comes with the latest Android articles, open source projects, events and hot discussions.

Subscribe Now

Featured Blogs

Our Team

MindOrks is Certainly one of the best online blog to stay on top of all the Android development news, coding and design patterns. Finally a blog I can count on to keep myself updated with latest and greatest things happening in Android world.

Vipul Shah
Android Developer
Microsoft

OUR LEARNERS WORK AT