ColorPicker

This commit is contained in:
Mike Schwörer 2018-10-22 14:04:50 +02:00
parent 6dfd7e016b
commit f9d04e38a0
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
2 changed files with 21 additions and 1 deletions

View File

@ -50,6 +50,7 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:3.10.0' implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.github.kenglxn.QRGen:android:2.5.0' implementation 'com.github.kenglxn.QRGen:android:2.5.0'
implementation "com.github.DeweyReed:UltimateMusicPicker:2.0.0" implementation "com.github.DeweyReed:UltimateMusicPicker:2.0.0"
implementation 'com.github.duanhong169:colorpicker:1.1.5'
} }
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'

View File

@ -22,6 +22,7 @@ import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import top.defaults.colorpicker.ColorPickerPopup;
import xyz.aprildown.ultimatemusicpicker.MusicPickerListener; import xyz.aprildown.ultimatemusicpicker.MusicPickerListener;
import xyz.aprildown.ultimatemusicpicker.UltimateMusicPicker; import xyz.aprildown.ultimatemusicpicker.UltimateMusicPicker;
@ -221,7 +222,25 @@ public class SettingsFragment extends Fragment implements MusicPickerListener
private void chooseLEDColorLow() private void chooseLEDColorLow()
{ {
// new ColorPickerPopup.Builder(getContext())
.initialColor(SCNSettings.inst().PriorityLow.LEDColor) // Set initial color
.enableBrightness(true) // Enable brightness slider or not
.okTitle("Choose")
.cancelTitle("Cancel")
.showIndicator(true)
.showValue(false)
.build()
.show(getView(), new ColorPickerPopup.ColorPickerObserver()
{
@Override
public void onColorPicked(int color) {
SCNSettings.inst().PriorityLow.LEDColor = color;
saveAndUpdate();
}
@Override
public void onColor(int color, boolean fromUser) { }
});
} }
@Override @Override