在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):LarsWerkman/Lobsterpicker开源软件地址(OpenSource Url):https://github.com/LarsWerkman/Lobsterpicker开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):LobsterpickerDesigned by Marie Schweiz, Developed by Lars Werkman Lobsterpicker is a library for android material design made to support apps and developers if a color should be choosen by a user. The library is offering a dialog with all shades of material design colors. Give it a try and download our demo app via google play ![image](http://dvsty.com/git-lobsterpicker/header.png)How you can use it:Include one or multiple of the views inside of you layout: <com.larswerkman.lobsterpicker.LobsterPicker
android:id="@+id/lobsterpicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.larswerkman.lobsterpicker.sliders.LobsterShadeSlider
android:id="@+id/shadeslider"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.larswerkman.lobsterpicker.sliders.LobsterOpacitySlider
android:id="@+id/opacityslider"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> summary of options
color wheel you prefer (wheel only)LobsterPicker lobsterPicker = (LobsterPicker) findViewById(R.id.lobsterpicker);
//To retrieve the selected color use
lobsterPicker.getColor();
//You'r also able to add a listener
lobsterPicker.addOnColorListener(new OnColorListener() {
@Override
public void onColorChanged(@ColorInt int color) {
}
@Override
public void onColorSelected(@ColorInt int color) {
}
}); color wheel and a before and after circle in the middleBy default this is disabled your able to enable it in xml app:color_history_enabled="true" Or in Java LobsterPicker lobsterPicker = (LobsterPicker) findViewById(R.id.lobsterpicker);
//To enable to color feedback use
lobsterPicker.setColorHistoryEnabled(true);
//To set a previous picked color or reference color use
lobsterPicker.setHistory(Color.RED); color wheel and a slider for switching between different color spacesTo connect a slider to the color wheel use LobsterPicker lobsterPicker = (LobsterPicker) findViewById(R.id.lobsterpicker);
LobsterShadeSlider shadeSlider = (LobsterShadeSlider) findViewById(R.id.shadeslider);
//To connect them
lobsterpicker.addDecorator(shadeSlider); All sliders implement the color wheel, a slider for the colorspace and the opacityTo connect both the LobsterPicker lobsterPicker = (LobsterPicker) findViewById(R.id.lobsterpicker);
LobsterShadeSlider shadeSlider = (LobsterShadeSlider) findViewById(R.id.shadeslider);
LobsterOpacitySlider opacitySlider = (LobsterOpacitySlider) findViewById(R.id.opacityslider);
//To connect them
lobsterpicker.addDecorator(shadeSlider);
lobsterpicker.addDecorator(opacitySlider); slider only, toggle for 5 different shades you defineThe //To retrieve to color is the same mehtod used for the LobsterPicker
shadeSlider.getColor(); To use your own colors this can be done by implementing the lobsterPicker.setColorAdapter(new BitmapColorAdapter(this, R.drawable.default_shader_pallete)); slider only and opacityJust like for the LobsterShadeSlider shadeSlider = (LobsterShadeSlider) findViewById(R.id.shadeslider);
LobsterOpacitySlider opacitySlider = (LobsterOpacitySlider) findViewById(R.id.opacityslider);
//To connect them
shadeSlider.addDecorator(opacitySlider); DownloadMaven: <dependency>
<groupId>com.larswerkman</groupId>
<artifactId>lobsterpicker</artifactId>
<version>1.0.1</version>
</dependency> Gradle: compile 'com.larswerkman:lobsterpicker:1.0.1' License
CreditsThis library is written and developed by Lars Werkman. For feedback, requests and collaboration please use Github or write us. Lars Werkman Freelance android developer [email protected] Marie Schweiz Freelance android designer [email protected] |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论