update commons to 3.21.3

This commit is contained in:
tibbi 2018-05-01 20:37:39 +02:00
parent 52b9e13990
commit 898519de91
11 changed files with 37 additions and 26 deletions

View File

@ -46,7 +46,7 @@ ext {
}
dependencies {
implementation 'com.simplemobiletools:commons:3.21.2'
implementation 'com.simplemobiletools:commons:3.21.3'
implementation 'joda-time:joda-time:2.9.9'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.android.support:multidex:1.0.3'

View File

@ -421,7 +421,7 @@ class EventActivity : SimpleActivity() {
val eventType = dbHelper.getEventType(mEventTypeId)
if (eventType != null) {
event_type.text = eventType.title
event_type_color.setBackgroundWithStroke(eventType.color, config.backgroundColor)
event_type_color.setFillWithStroke(eventType.color, config.backgroundColor)
}
}

View File

@ -107,15 +107,19 @@ class WidgetListConfigureActivity : SimpleActivity() {
private fun pickBackgroundColor() {
ColorPickerDialog(this, mBgColorWithoutTransparency) { wasPositivePressed, color ->
mBgColorWithoutTransparency = color
updateBgColor()
if (wasPositivePressed) {
mBgColorWithoutTransparency = color
updateBgColor()
}
}
}
private fun pickTextColor() {
ColorPickerDialog(this, mTextColor) { wasPositivePressed, color ->
mTextColorWithoutTransparency = color
updateColors()
if (wasPositivePressed) {
mTextColorWithoutTransparency = color
updateColors()
}
}
}

View File

@ -23,6 +23,7 @@ import com.simplemobiletools.commons.dialogs.ColorPickerDialog
import com.simplemobiletools.commons.extensions.adjustAlpha
import com.simplemobiletools.commons.extensions.applyColorFilter
import com.simplemobiletools.commons.extensions.beVisible
import com.simplemobiletools.commons.extensions.setFillWithStroke
import kotlinx.android.synthetic.main.first_row.*
import kotlinx.android.synthetic.main.top_navigation.*
import kotlinx.android.synthetic.main.widget_config_monthly.*
@ -111,16 +112,20 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar {
private fun pickBackgroundColor() {
ColorPickerDialog(this, mBgColorWithoutTransparency) { wasPositivePressed, color ->
mBgColorWithoutTransparency = color
updateBgColor()
if (wasPositivePressed) {
mBgColorWithoutTransparency = color
updateBgColor()
}
}
}
private fun pickTextColor() {
ColorPickerDialog(this, mTextColor) { wasPositivePressed, color ->
mTextColorWithoutTransparency = color
updateColors()
updateDays()
if (wasPositivePressed) {
mTextColorWithoutTransparency = color
updateColors()
updateDays()
}
}
}

View File

@ -9,7 +9,7 @@ import com.simplemobiletools.calendar.activities.SimpleActivity
import com.simplemobiletools.calendar.extensions.config
import com.simplemobiletools.calendar.models.EventType
import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor
import com.simplemobiletools.commons.extensions.setBackgroundWithStroke
import com.simplemobiletools.commons.extensions.setFillWithStroke
import com.simplemobiletools.commons.interfaces.MyAdapterListener
import kotlinx.android.synthetic.main.filter_event_type_view.view.*
import java.util.*
@ -73,7 +73,7 @@ class FilterEventTypeAdapter(val activity: SimpleActivity, val eventTypes: List<
itemView.apply {
filter_event_type_checkbox.setColors(activity.config.textColor, activity.getAdjustedPrimaryColor(), activity.config.backgroundColor)
filter_event_type_checkbox.text = eventType.getDisplayTitle()
filter_event_type_color.setBackgroundWithStroke(eventType.color, activity.config.backgroundColor)
filter_event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor)
filter_event_type_holder.setOnClickListener { viewClicked(!filter_event_type_checkbox.isChecked) }
}

View File

@ -13,7 +13,7 @@ import com.simplemobiletools.calendar.models.EventType
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.extensions.setBackgroundWithStroke
import com.simplemobiletools.commons.extensions.setFillWithStroke
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.models.RadioItem
import com.simplemobiletools.commons.views.MyRecyclerView
@ -60,7 +60,7 @@ class ManageEventTypesAdapter(activity: SimpleActivity, val eventTypes: ArrayLis
private fun setupView(view: View, eventType: EventType) {
view.apply {
event_type_title.text = eventType.getDisplayTitle()
event_type_color.setBackgroundWithStroke(eventType.color, activity.config.backgroundColor)
event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor)
event_type_title.setTextColor(textColor)
}
}

View File

@ -9,7 +9,7 @@ import com.simplemobiletools.calendar.extensions.dbHelper
import com.simplemobiletools.calendar.helpers.DBHelper
import com.simplemobiletools.calendar.helpers.IcsImporter
import com.simplemobiletools.calendar.helpers.IcsImporter.ImportResult.*
import com.simplemobiletools.commons.extensions.setBackgroundWithStroke
import com.simplemobiletools.commons.extensions.setFillWithStroke
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.extensions.toast
import kotlinx.android.synthetic.main.dialog_import_events.view.*
@ -50,7 +50,7 @@ class ImportEventsDialog(val activity: SimpleActivity, val path: String, val cal
private fun updateEventType(view: ViewGroup) {
val eventType = activity.dbHelper.getEventType(currEventTypeId)
view.import_event_type_title.text = eventType!!.getDisplayTitle()
view.import_event_type_color.setBackgroundWithStroke(eventType.color, activity.config.backgroundColor)
view.import_event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor)
}
private fun handleParseResult(result: IcsImporter.ImportResult) {

View File

@ -11,7 +11,7 @@ import com.simplemobiletools.calendar.extensions.config
import com.simplemobiletools.calendar.extensions.dbHelper
import com.simplemobiletools.calendar.helpers.STORED_LOCALLY_ONLY
import com.simplemobiletools.calendar.models.CalDAVCalendar
import com.simplemobiletools.commons.extensions.setBackgroundWithStroke
import com.simplemobiletools.commons.extensions.setFillWithStroke
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.extensions.updateTextColors
import kotlinx.android.synthetic.main.dialog_select_radio_group.view.*
@ -52,7 +52,7 @@ class SelectEventCalendarDialog(val activity: Activity, val calendars: List<CalD
}
if (color != Color.TRANSPARENT)
view.dialog_radio_color.setBackgroundWithStroke(color, activity.config.backgroundColor)
view.dialog_radio_color.setFillWithStroke(color, activity.config.backgroundColor)
view.setOnClickListener { viewClicked(typeId) }
radioGroup.addView(view, RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))

View File

@ -10,7 +10,7 @@ import com.simplemobiletools.calendar.R
import com.simplemobiletools.calendar.extensions.config
import com.simplemobiletools.calendar.helpers.CalDAVHandler
import com.simplemobiletools.calendar.models.EventType
import com.simplemobiletools.commons.extensions.setBackgroundWithStroke
import com.simplemobiletools.commons.extensions.setFillWithStroke
import com.simplemobiletools.commons.extensions.setupDialogStuff
import kotlinx.android.synthetic.main.dialog_select_radio_group.view.*
import kotlinx.android.synthetic.main.radio_button_with_color.view.*
@ -45,7 +45,7 @@ class SelectEventTypeColorDialog(val activity: Activity, val eventType: EventTyp
}
if (color != Color.TRANSPARENT)
view.dialog_radio_color.setBackgroundWithStroke(color, activity.config.backgroundColor)
view.dialog_radio_color.setFillWithStroke(color, activity.config.backgroundColor)
view.setOnClickListener { viewClicked(colorKey) }
radioGroup.addView(view, RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))

View File

@ -10,7 +10,7 @@ import com.simplemobiletools.calendar.extensions.config
import com.simplemobiletools.calendar.extensions.dbHelper
import com.simplemobiletools.calendar.models.EventType
import com.simplemobiletools.commons.extensions.hideKeyboard
import com.simplemobiletools.commons.extensions.setBackgroundWithStroke
import com.simplemobiletools.commons.extensions.setFillWithStroke
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.views.MyCompatRadioButton
@ -59,7 +59,7 @@ class SelectEventTypeDialog(val activity: Activity, val currEventType: Int, val
}
if (eventType.color != Color.TRANSPARENT) {
view.dialog_radio_color.setBackgroundWithStroke(eventType.color, activity.config.backgroundColor)
view.dialog_radio_color.setFillWithStroke(eventType.color, activity.config.backgroundColor)
}
view.setOnClickListener { viewClicked(eventType) }

View File

@ -24,8 +24,10 @@ class UpdateEventTypeDialog(val activity: Activity, var eventType: EventType? =
type_color.setOnClickListener {
if (eventType?.caldavCalendarId == 0) {
ColorPickerDialog(activity, eventType!!.color) { wasPositivePressed, color ->
eventType!!.color = color
setupColor(type_color)
if (wasPositivePressed) {
eventType!!.color = color
setupColor(type_color)
}
}
} else {
SelectEventTypeColorDialog(activity, eventType!!) {
@ -79,6 +81,6 @@ class UpdateEventTypeDialog(val activity: Activity, var eventType: EventType? =
}
private fun setupColor(view: ImageView) {
view.setBackgroundWithStroke(eventType!!.color, activity.config.backgroundColor)
view.setFillWithStroke(eventType!!.color, activity.config.backgroundColor)
}
}