mirror of
https://github.com/etesync/android
synced 2025-01-11 08:10:58 +00:00
Fix loading tasklist color in edit collection activity.
This commit is contained in:
parent
18a00716f8
commit
96fc87cad4
@ -28,7 +28,7 @@ class LocalTaskList private constructor(
|
||||
id: Long
|
||||
): AndroidTaskList<LocalTask>(account, provider, LocalTask.Factory, id), LocalCollection<LocalTask> {
|
||||
companion object {
|
||||
val defaultColor = -0x3c1592 // "DAVdroid green"
|
||||
val defaultColor = -0x743cb6 // light green 500
|
||||
|
||||
fun tasksProviderAvailable(context: Context): Boolean {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||
|
@ -22,6 +22,7 @@ import com.etesync.syncadapter.R
|
||||
import com.etesync.syncadapter.model.CollectionInfo
|
||||
import com.etesync.syncadapter.model.JournalEntity
|
||||
import com.etesync.syncadapter.resource.LocalCalendar
|
||||
import com.etesync.syncadapter.resource.LocalTaskList
|
||||
|
||||
class EditCollectionActivity : CreateCollectionActivity() {
|
||||
|
||||
@ -30,10 +31,18 @@ class EditCollectionActivity : CreateCollectionActivity() {
|
||||
|
||||
setTitle(R.string.edit_collection)
|
||||
|
||||
if (info.type == CollectionInfo.Type.CALENDAR) {
|
||||
when (info.type) {
|
||||
CollectionInfo.Type.CALENDAR -> {
|
||||
val colorSquare = findViewById<View>(R.id.color)
|
||||
colorSquare.setBackgroundColor(info.color ?: LocalCalendar.defaultColor)
|
||||
}
|
||||
CollectionInfo.Type.TASKS -> {
|
||||
val colorSquare = findViewById<View>(R.id.color)
|
||||
colorSquare.setBackgroundColor(info.color ?: LocalTaskList.defaultColor)
|
||||
}
|
||||
CollectionInfo.Type.ADDRESS_BOOK -> {
|
||||
}
|
||||
}
|
||||
|
||||
val edit = findViewById<View>(R.id.display_name) as EditText
|
||||
edit.setText(info.displayName)
|
||||
|
Loading…
Reference in New Issue
Block a user