mirror of https://github.com/tasks/tasks
Local lists
parent
ae6cfca8ec
commit
346bf22fb3
@ -0,0 +1,31 @@
|
|||||||
|
package org.tasks.caldav
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import org.tasks.R
|
||||||
|
import org.tasks.data.CaldavAccount
|
||||||
|
import org.tasks.data.CaldavCalendar
|
||||||
|
import org.tasks.data.CaldavDao
|
||||||
|
import org.tasks.injection.ActivityComponent
|
||||||
|
|
||||||
|
class LocalListSettingsActivity : BaseCaldavCalendarSettingsActivity() {
|
||||||
|
|
||||||
|
override fun getLayout() = R.layout.activity_caldav_calendar_settings
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
toolbar.menu.findItem(R.id.delete)?.isVisible = caldavDao.getCalendarsByAccount(CaldavDao.LOCAL).size > 1
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun inject(component: ActivityComponent) = component.inject(this)
|
||||||
|
|
||||||
|
override fun createCalendar(caldavAccount: CaldavAccount, name: String, color: Int) =
|
||||||
|
createSuccessful(null)
|
||||||
|
|
||||||
|
override fun updateNameAndColor(
|
||||||
|
account: CaldavAccount, calendar: CaldavCalendar, name: String, color: Int) =
|
||||||
|
updateCalendar()
|
||||||
|
|
||||||
|
override fun deleteCalendar(caldavAccount: CaldavAccount, caldavCalendar: CaldavCalendar) =
|
||||||
|
onDeleted(true)
|
||||||
|
}
|
||||||
@ -1,27 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<com.google.android.material.chip.ChipGroup xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/chip_group"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
app:chipSpacingVertical="@dimen/chip_spacing"
|
||||||
|
app:chipSpacingHorizontal="@dimen/chip_spacing" />
|
||||||
<TextView
|
|
||||||
android:id="@+id/dont_sync"
|
|
||||||
style="@style/TaskEditTextPrimary"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="top"
|
|
||||||
android:gravity="start"
|
|
||||||
android:hint="@string/dont_sync"
|
|
||||||
android:textAlignment="viewStart" />
|
|
||||||
|
|
||||||
<com.google.android.material.chip.ChipGroup
|
|
||||||
android:id="@+id/chip_group"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:chipSpacingVertical="@dimen/chip_spacing"
|
|
||||||
app:chipSpacingHorizontal="@dimen/chip_spacing"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|||||||
Loading…
Reference in New Issue