mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 20:30:58 +01:00
replaces switches with checkboxes at selecting CalDAV calendars
This commit is contained in:
parent
b53e427909
commit
30d125e840
@ -4,13 +4,13 @@ import android.text.TextUtils
|
||||
import android.view.ViewGroup
|
||||
import android.widget.RelativeLayout
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.widget.SwitchCompat
|
||||
import com.simplemobiletools.calendar.pro.R
|
||||
import com.simplemobiletools.calendar.pro.activities.SimpleActivity
|
||||
import com.simplemobiletools.calendar.pro.extensions.calDAVHelper
|
||||
import com.simplemobiletools.calendar.pro.extensions.config
|
||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||
import com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
import kotlinx.android.synthetic.main.calendar_item_account.view.*
|
||||
import kotlinx.android.synthetic.main.calendar_item_calendar.view.*
|
||||
import kotlinx.android.synthetic.main.dialog_select_calendars.view.*
|
||||
@ -39,11 +39,11 @@ class SelectCalendarsDialog(val activity: SimpleActivity, val callback: () -> Un
|
||||
}
|
||||
|
||||
dialog = AlertDialog.Builder(activity)
|
||||
.setPositiveButton(R.string.ok) { dialogInterface, i -> confirmSelection() }
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.create().apply {
|
||||
activity.setupDialogStuff(view, this, R.string.select_caldav_calendars)
|
||||
}
|
||||
.setPositiveButton(R.string.ok) { dialogInterface, i -> confirmSelection() }
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.create().apply {
|
||||
activity.setupDialogStuff(view, this, R.string.select_caldav_calendars)
|
||||
}
|
||||
}
|
||||
|
||||
private fun addCalendarItem(isEvent: Boolean, text: String, tag: Int = 0, shouldCheck: Boolean = false) {
|
||||
@ -73,7 +73,7 @@ class SelectCalendarsDialog(val activity: SimpleActivity, val callback: () -> Un
|
||||
val child = view.dialog_select_calendars_holder.getChildAt(i)
|
||||
if (child is RelativeLayout) {
|
||||
val check = child.getChildAt(0)
|
||||
if (check is SwitchCompat && check.isChecked) {
|
||||
if (check is MyAppCompatCheckbox && check.isChecked) {
|
||||
calendarIds.add(check.tag as Int)
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
android:id="@+id/calendar_item_account"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/big_margin"
|
||||
android:layout_marginStart="@dimen/bigger_margin"
|
||||
android:layout_marginTop="@dimen/activity_margin"
|
||||
android:layout_marginBottom="@dimen/activity_margin"
|
||||
android:alpha="0.8"
|
||||
|
@ -4,15 +4,16 @@
|
||||
android:id="@+id/calendar_item_calendar_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingStart="@dimen/activity_margin">
|
||||
|
||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
android:id="@+id/calendar_item_calendar_switch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:clickable="false"
|
||||
android:paddingStart="@dimen/big_margin"
|
||||
android:paddingStart="@dimen/small_margin"
|
||||
android:paddingTop="@dimen/activity_margin"
|
||||
android:paddingEnd="@dimen/activity_margin"
|
||||
android:paddingBottom="@dimen/activity_margin"
|
||||
|
Loading…
x
Reference in New Issue
Block a user