attenzione/android-ColorPickerPreference
关于
用于在 Android 偏好设置中创建颜色选择器的 ColorPickerPreference。作为库创建。
开发工具可以做什么
- Alpha Slider (disabled by default)
- Old & New Color
- Color Preview in Preferences List
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文===================== ColorPickerPreference
Generally used classes by Daniel Nilsson. ColorPickerPreference class by Sergey Margaritov. Packed by Sergey Margaritov. Packed again and made Gradle compatible by Vincent Fischer.
Features
- Color Area
- Hue Slider
- Alpha Slider (disabled by default)
- Old & New Color
- Color Preview in Preferences List
Requirements
Tested with APIv7, but maybe will work with early versions
Installation
Through Gradle
You can now install this through Gradle with a simple: ::
implementation 'net.margaritov.preference.colorpicker.ColorPickerPreference:ColorPickerPreference:1.0.0'
Android Studio
Paste or clone this library into the
/libsfolder, in the root directory of your project. Create a new folder:/libsif not already present. (This step is not required - only for keeping cleaner project structure)Edit
settings.gradleby adding the library. You have also define a project directory for the library. Yoursettings.gradleshould look like below: ::include ':app', ':ColorPickerPreference' project(':ColorPickerPreference').projectDir = new File('app/libs/ColorPickerPreference')
In
app/build.gradleadd the ColorPickerPreference library as a dependency: ::dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:21.0.3' implementation project(":ColorPickerPreference") }
Sync project, clean and build. You can use the
ColorPickerPreferencelibrary as part of your project now.
Eclipse
- Before you can add a
ColorPickerPreferenceto your application, you must first add a library reference: - Clone or download a copy of the library
- Import the library into Eclipse: File menu -> Import -> Existing Project into Workspace
- Open your application's project properties and add a library reference to
ColorPickerPreference
Usage
You can see some tests inside
::
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="color1"
android:title="@string/color1_title"
android:summary="@string/color1_summary"
android:defaultValue="@color/pumpkin_orange" <!-- integer resources are also accepted -->
alphaSlider="true" <!-- enable alpha slider via XML -->
/>
To enable Alpha Slider in your code use function: :: setAlphaSliderEnabled(boolean enable)
Screens
探索相关项目
加载中…