Commit 1d33e4c3 authored by Ricki Hirner's avatar Ricki Hirner

Replace AmbilWarna by ColorPicker

parent 7d468996
Pipeline #41344441 passed with stages
in 11 minutes and 33 seconds
......@@ -79,7 +79,7 @@ dependencies {
implementation 'androidx.preference:preference:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.github.yukuku:ambilwarna:2.0.1'
implementation 'com.jaredrummler:colorpicker:1.0.5'
implementation 'com.mikepenz:aboutlibraries:6.2.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'
......
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
~ All rights reserved. This program and the accompanying materials
~ are made available under the terms of the GNU Public License v3.0
~ which accompanies this distribution, and is available at
~ http://www.gnu.org/licenses/gpl.html
-->
<manifest package="at.bitfire.davdroid"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
......
......@@ -25,14 +25,15 @@ import at.bitfire.davdroid.R
import at.bitfire.davdroid.model.CollectionInfo
import at.bitfire.davdroid.model.ServiceDB
import at.bitfire.ical4android.DateUtils
import com.jaredrummler.android.colorpicker.ColorPickerDialog
import com.jaredrummler.android.colorpicker.ColorPickerDialogListener
import kotlinx.android.synthetic.main.activity_create_calendar.*
import net.fortuna.ical4j.model.Calendar
import okhttp3.HttpUrl
import org.apache.commons.lang3.StringUtils
import java.util.*
import yuku.ambilwarna.AmbilWarnaDialog
class CreateCalendarActivity: AppCompatActivity(), LoaderManager.LoaderCallbacks<CreateCalendarActivity.AccountInfo> {
class CreateCalendarActivity: AppCompatActivity(), LoaderManager.LoaderCallbacks<CreateCalendarActivity.AccountInfo>, ColorPickerDialogListener {
companion object {
const val EXTRA_ACCOUNT = "account"
......@@ -49,16 +50,23 @@ class CreateCalendarActivity: AppCompatActivity(), LoaderManager.LoaderCallbacks
setContentView(R.layout.activity_create_calendar)
color.setOnClickListener { _ ->
AmbilWarnaDialog(this, (color.background as ColorDrawable).color, true, object: AmbilWarnaDialog.OnAmbilWarnaListener {
override fun onCancel(dialog: AmbilWarnaDialog) {}
override fun onOk(dialog: AmbilWarnaDialog, rgb: Int) =
color.setBackgroundColor(rgb)
}).show()
ColorPickerDialog.newBuilder()
.setShowAlphaSlider(false)
.setColor((color.background as ColorDrawable).color)
.show(this)
}
LoaderManager.getInstance(this).initLoader(0, null, this)
}
override fun onColorSelected(dialogId: Int, rgb: Int) {
color.setBackgroundColor(rgb)
}
override fun onDialogDismissed(dialogId: Int) {
// color selection dismissed
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.activity_create_collection, menu)
return true
......
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright © Ricki Hirner (bitfire web engineering).
~ All rights reserved. This program and the accompanying materials
~ are made available under the terms of the GNU Public License v3.0
~ which accompanies this distribution, and is available at
~ http://www.gnu.org/licenses/gpl.html
-->
<resources>
<string name="define_ambilwarna" translatable="false" />
<string name="library_ambilwarna_author" translatable="false">Randy Sugianto</string>
<string name="library_ambilwarna_authorWebsite">https://github.com/yukuku</string>
<string name="library_ambilwarna_libraryName" translatable="false">AmbilWarna</string>
<string name="library_ambilwarna_libraryDescription">This is a small library for your application to enable the users to select an arbitrary color.</string>
<string name="library_ambilwarna_libraryWebsite" translatable="false">https://github.com/yukuku/ambilwarna</string>
<string name="library_ambilwarna_isOpenSource" translatable="false">true</string>
<string name="library_ambilwarna_licenseId">apache_2_0</string>
<string name="define_colorpicker" translatable="false" />
<string name="library_colorpicker_author" translatable="false">Jared Rummler, Daniel Nilsson</string>
<string name="library_colorpicker_authorWebsite">https://github.com/jaredrummler/</string>
<string name="library_colorpicker_libraryName" translatable="false">Color Picker</string>
<string name="library_colorpicker_libraryDescription">Yet another open source color picker for Android.</string>
<string name="library_colorpicker_libraryWebsite" translatable="false">https://github.com/jaredrummler/ColorPicker</string>
<string name="library_colorpicker_isOpenSource" translatable="false">true</string>
<string name="library_colorpicker_licenseId">apache_2_0</string>
<string name="define_commons" translatable="false" />
<string name="library_commons_author" translatable="false">Apache Software Foundation</string>
......
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
# AmbilWarna doesn't use AndroidX yet
android.enableJetifier=true
\ No newline at end of file
android.useAndroidX=true
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment