update commons to 3.16.16

This commit is contained in:
tibbi 2018-03-23 22:49:55 +01:00
parent ae0441b5b1
commit 5665a687a7
10 changed files with 26 additions and 29 deletions

View File

@ -46,7 +46,7 @@ ext {
}
dependencies {
implementation 'com.simplemobiletools:commons:3.15.6'
implementation 'com.simplemobiletools:commons:3.16.16'
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

@ -174,22 +174,22 @@ class EventActivity : SimpleActivity() {
}
private fun showReminder1Dialog() {
showPickIntervalDialog(mReminder1Minutes) {
mReminder1Minutes = it
showPickSecondsDialog(mReminder1Minutes * 60) {
mReminder1Minutes = it / 60
checkReminderTexts()
}
}
private fun showReminder2Dialog() {
showPickIntervalDialog(mReminder2Minutes) {
mReminder2Minutes = it
showPickSecondsDialog(mReminder2Minutes * 60) {
mReminder2Minutes = it / 60
checkReminderTexts()
}
}
private fun showReminder3Dialog() {
showPickIntervalDialog(mReminder3Minutes) {
mReminder3Minutes = it
showPickSecondsDialog(mReminder3Minutes * 60) {
mReminder3Minutes = it / 60
checkReminderTexts()
}
}
@ -700,7 +700,7 @@ class EventActivity : SimpleActivity() {
private fun setupStartTime() {
hideKeyboard()
TimePickerDialog(this, mDialogTheme, startTimeSetListener, mEventStartDateTime.hourOfDay, mEventStartDateTime.minuteOfHour, config.use24hourFormat).show()
TimePickerDialog(this, mDialogTheme, startTimeSetListener, mEventStartDateTime.hourOfDay, mEventStartDateTime.minuteOfHour, config.use24HourFormat).show()
}
@SuppressLint("NewApi")
@ -718,7 +718,7 @@ class EventActivity : SimpleActivity() {
private fun setupEndTime() {
hideKeyboard()
TimePickerDialog(this, mDialogTheme, endTimeSetListener, mEventEndDateTime.hourOfDay, mEventEndDateTime.minuteOfHour, config.use24hourFormat).show()
TimePickerDialog(this, mDialogTheme, endTimeSetListener, mEventEndDateTime.hourOfDay, mEventEndDateTime.minuteOfHour, config.use24HourFormat).show()
}
private val startDateSetListener = DatePickerDialog.OnDateSetListener { view, year, monthOfYear, dayOfMonth ->

View File

@ -126,7 +126,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
}
if (config.storedView == WEEKLY_VIEW) {
if (mStoredIsSundayFirst != config.isSundayFirst || mStoredUse24HourFormat != config.use24hourFormat) {
if (mStoredIsSundayFirst != config.isSundayFirst || mStoredUse24HourFormat != config.use24HourFormat) {
updateViewPager()
}
}
@ -206,7 +206,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
mStoredTextColor = textColor
mStoredPrimaryColor = primaryColor
mStoredBackgroundColor = backgroundColor
mStoredUse24HourFormat = use24hourFormat
mStoredUse24HourFormat = use24HourFormat
}
mStoredDayCode = Formatter.getTodayCode(applicationContext)
}
@ -673,7 +673,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
FAQItem(getString(R.string.faq_1_title), getString(R.string.faq_1_text)),
FAQItem(getString(R.string.faq_2_title), getString(R.string.faq_2_text)))
startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_JODA or LICENSE_STETHO or LICENSE_MULTISELECT or LICENSE_LEAK_CANARY,
startAboutActivity(R.string.app_name, LICENSE_JODA or LICENSE_STETHO or LICENSE_MULTISELECT or LICENSE_LEAK_CANARY,
BuildConfig.VERSION_NAME, faqItems)
}

View File

@ -113,10 +113,10 @@ class SettingsActivity : SimpleActivity() {
}
private fun setupHourFormat() {
settings_hour_format.isChecked = config.use24hourFormat
settings_hour_format.isChecked = config.use24HourFormat
settings_hour_format_holder.setOnClickListener {
settings_hour_format.toggle()
config.use24hourFormat = settings_hour_format.isChecked
config.use24HourFormat = settings_hour_format.isChecked
}
}
@ -319,8 +319,8 @@ class SettingsActivity : SimpleActivity() {
private fun setupSnoozeTime() {
updateSnoozeTime()
settings_snooze_time_holder.setOnClickListener {
showPickIntervalDialog(config.snoozeTime, true) {
config.snoozeTime = it
showPickSecondsDialog(config.snoozeTime * 60, true) {
config.snoozeTime = it / 60
updateSnoozeTime()
}
}

View File

@ -6,17 +6,17 @@ import com.simplemobiletools.calendar.extensions.config
import com.simplemobiletools.calendar.extensions.dbHelper
import com.simplemobiletools.calendar.extensions.rescheduleReminder
import com.simplemobiletools.calendar.helpers.EVENT_ID
import com.simplemobiletools.commons.extensions.showPickIntervalDialog
import com.simplemobiletools.commons.extensions.showPickSecondsDialog
class SnoozeReminderActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
showPickIntervalDialog(config.snoozeTime, true, cancelCallback = { dialogCancelled() }) {
showPickSecondsDialog(config.snoozeTime * 60, true, cancelCallback = { dialogCancelled() }) {
val eventId = intent.getIntExtra(EVENT_ID, 0)
val event = dbHelper.getEventWithId(eventId)
config.snoozeTime = it
rescheduleReminder(event, it)
config.snoozeTime = it / 60
rescheduleReminder(event, it / 60)
finishActivity()
}
}

View File

@ -35,7 +35,7 @@ class EventListAdapter(activity: SimpleActivity, val listItems: ArrayList<ListIt
private val redTextColor = resources.getColor(R.color.red_text)
private val now = activity.getNowSeconds()
private val todayDate = Formatter.getDayTitle(activity, Formatter.getDayCodeFromTS(now))
private var use24HourFormat = activity.config.use24hourFormat
private var use24HourFormat = activity.config.use24HourFormat
override fun getActionMenuId() = R.menu.cab_event_list

View File

@ -36,7 +36,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
mView.calendar_empty_list_placeholder.text = placeholderText
mView.background = ColorDrawable(context!!.config.backgroundColor)
mView.calendar_events_list_holder?.id = (System.currentTimeMillis() % 100000).toInt()
use24HourFormat = context!!.config.use24hourFormat
use24HourFormat = context!!.config.use24HourFormat
updateActionBarTitle()
return mView
}
@ -44,7 +44,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
override fun onResume() {
super.onResume()
checkEvents()
val use24Hour = context!!.config.use24hourFormat
val use24Hour = context!!.config.use24HourFormat
if (use24Hour != use24HourFormat) {
use24HourFormat = use24Hour
(mView.calendar_events_list.adapter as? EventListAdapter)?.toggle24HourFormat(use24HourFormat)
@ -53,7 +53,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
override fun onPause() {
super.onPause()
use24HourFormat = context!!.config.use24hourFormat
use24HourFormat = context!!.config.use24HourFormat
}
private fun checkEvents() {

View File

@ -9,7 +9,6 @@ import org.joda.time.DateTime
import org.joda.time.DateTimeZone
import org.joda.time.LocalDate
import org.joda.time.format.DateTimeFormat
import java.text.DateFormat
object Formatter {
val DAYCODE_PATTERN = "YYYYMMdd"
@ -89,9 +88,9 @@ object Formatter {
fun getYear(dateTime: DateTime) = dateTime.toString(YEAR_PATTERN)
fun getHourPattern(context: Context) = if (context.config.use24hourFormat) PATTERN_HOURS_24 else PATTERN_HOURS_12
fun getHourPattern(context: Context) = if (context.config.use24HourFormat) PATTERN_HOURS_24 else PATTERN_HOURS_12
fun getTimePattern(context: Context) = if (context.config.use24hourFormat) PATTERN_TIME_24 else PATTERN_TIME_12
fun getTimePattern(context: Context) = if (context.config.use24HourFormat) PATTERN_TIME_24 else PATTERN_TIME_12
fun getExportedTime(ts: Long): String {
val dateTime = DateTime(ts, DateTimeZone.UTC)

View File

@ -89,7 +89,6 @@
<!-- Event Reminders -->
<string name="reminder">Erinnerung</string>
<string name="tomorrow">Morgen</string>
<string name="before">vorher</string>
<string name="add_another_reminder">Füge eine weitere Erinnerung hinzu</string>
<string name="event_reminders">Ereignis Erinnerungen</string>

View File

@ -89,7 +89,6 @@
<!-- Event Reminders -->
<string name="reminder">Reminder</string>
<string name="tomorrow">Tomorrow</string>
<string name="before">before</string>
<string name="add_another_reminder">Add another reminder</string>
<string name="event_reminders">Event reminders</string>