mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-28 01:17:50 +01:00
update target SDK to 26
This commit is contained in:
parent
10b40f5b99
commit
aeadf3bd03
@ -3,13 +3,13 @@ apply plugin: 'kotlin-android'
|
|||||||
apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-android-extensions'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 25
|
compileSdkVersion 26
|
||||||
buildToolsVersion "25.0.3"
|
buildToolsVersion "26.0.2"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.simplemobiletools.calendar"
|
applicationId "com.simplemobiletools.calendar"
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 25
|
targetSdkVersion 26
|
||||||
versionCode 99
|
versionCode 99
|
||||||
versionName "2.9.1"
|
versionName "2.9.1"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
@ -44,7 +44,7 @@ ext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.simplemobiletools:commons:2.31.11'
|
compile 'com.simplemobiletools:commons:2.34.2'
|
||||||
compile 'joda-time:joda-time:2.9.1'
|
compile 'joda-time:joda-time:2.9.1'
|
||||||
compile 'com.facebook.stetho:stetho:1.4.1'
|
compile 'com.facebook.stetho:stetho:1.4.1'
|
||||||
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
||||||
|
@ -153,7 +153,7 @@ class WidgetMonthlyConfigureActivity : AppCompatActivity(), MonthlyCalendar {
|
|||||||
week_num.beVisible()
|
week_num.beVisible()
|
||||||
|
|
||||||
for (i in 0..5) {
|
for (i in 0..5) {
|
||||||
(findViewById(mRes.getIdentifier("week_num_$i", "id", mPackageName)) as TextView).apply {
|
findViewById<TextView>(mRes.getIdentifier("week_num_$i", "id", mPackageName)).apply {
|
||||||
text = "${mDays!![i * 7 + 3].weekOfYear}:"
|
text = "${mDays!![i * 7 + 3].weekOfYear}:"
|
||||||
setTextColor(mTextColor)
|
setTextColor(mTextColor)
|
||||||
beVisible()
|
beVisible()
|
||||||
@ -163,7 +163,7 @@ class WidgetMonthlyConfigureActivity : AppCompatActivity(), MonthlyCalendar {
|
|||||||
|
|
||||||
val dividerMargin = mRes.displayMetrics.density.toInt()
|
val dividerMargin = mRes.displayMetrics.density.toInt()
|
||||||
for (i in 0 until len) {
|
for (i in 0 until len) {
|
||||||
(findViewById(mRes.getIdentifier("day_$i", "id", mPackageName)) as LinearLayout).apply {
|
findViewById<LinearLayout>(mRes.getIdentifier("day_$i", "id", mPackageName)).apply {
|
||||||
val day = mDays!![i]
|
val day = mDays!![i]
|
||||||
removeAllViews()
|
removeAllViews()
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ class WidgetMonthlyConfigureActivity : AppCompatActivity(), MonthlyCalendar {
|
|||||||
|
|
||||||
private fun updateLabels() {
|
private fun updateLabels() {
|
||||||
for (i in 0..6) {
|
for (i in 0..6) {
|
||||||
(findViewById(mRes.getIdentifier("label_$i", "id", mPackageName)) as TextView).apply {
|
findViewById<TextView>(mRes.getIdentifier("label_$i", "id", mPackageName)).apply {
|
||||||
setTextColor(mTextColor)
|
setTextColor(mTextColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ class DayFragment : Fragment(), DBHelper.EventUpdateListener, DeleteEventsListen
|
|||||||
private fun pickDay() {
|
private fun pickDay() {
|
||||||
activity.setTheme(context.getAppropriateTheme())
|
activity.setTheme(context.getAppropriateTheme())
|
||||||
val view = getLayoutInflater(arguments).inflate(R.layout.date_picker, null)
|
val view = getLayoutInflater(arguments).inflate(R.layout.date_picker, null)
|
||||||
val datePicker = view.findViewById(R.id.date_picker) as DatePicker
|
val datePicker = view.findViewById<DatePicker>(R.id.date_picker)
|
||||||
|
|
||||||
val dateTime = Formatter.getDateTimeFromCode(mDayCode)
|
val dateTime = Formatter.getDateTimeFromCode(mDayCode)
|
||||||
datePicker.init(dateTime.year, dateTime.monthOfYear - 1, dateTime.dayOfMonth, null)
|
datePicker.init(dateTime.year, dateTime.monthOfYear - 1, dateTime.dayOfMonth, null)
|
||||||
|
@ -127,8 +127,8 @@ class MonthFragment : Fragment(), MonthlyCalendar {
|
|||||||
private fun showMonthDialog() {
|
private fun showMonthDialog() {
|
||||||
activity.setTheme(context.getAppropriateTheme())
|
activity.setTheme(context.getAppropriateTheme())
|
||||||
val view = getLayoutInflater(arguments).inflate(R.layout.date_picker, null)
|
val view = getLayoutInflater(arguments).inflate(R.layout.date_picker, null)
|
||||||
val datePicker = view.findViewById(R.id.date_picker) as DatePicker
|
val datePicker = view.findViewById<DatePicker>(R.id.date_picker)
|
||||||
datePicker.findViewById(Resources.getSystem().getIdentifier("day", "id", "android")).beGone()
|
datePicker.findViewById<View>(Resources.getSystem().getIdentifier("day", "id", "android")).beGone()
|
||||||
|
|
||||||
val dateTime = DateTime(mCalendar.mTargetDate.toString())
|
val dateTime = DateTime(mCalendar.mTargetDate.toString())
|
||||||
datePicker.init(dateTime.year, dateTime.monthOfYear - 1, 1, null)
|
datePicker.init(dateTime.year, dateTime.monthOfYear - 1, 1, null)
|
||||||
@ -156,7 +156,7 @@ class MonthFragment : Fragment(), MonthlyCalendar {
|
|||||||
if (!mSundayFirst)
|
if (!mSundayFirst)
|
||||||
index = (index + 1) % letters.size
|
index = (index + 1) % letters.size
|
||||||
|
|
||||||
(mHolder.findViewById(mRes.getIdentifier("label_$i", "id", mPackageName)) as TextView).apply {
|
mHolder.findViewById<TextView>(mRes.getIdentifier("label_$i", "id", mPackageName)).apply {
|
||||||
setTextColor(mTextColor)
|
setTextColor(mTextColor)
|
||||||
text = getString(letters[index])
|
text = getString(letters[index])
|
||||||
}
|
}
|
||||||
@ -174,7 +174,7 @@ class MonthFragment : Fragment(), MonthlyCalendar {
|
|||||||
week_num.beVisibleIf(displayWeekNumbers)
|
week_num.beVisibleIf(displayWeekNumbers)
|
||||||
|
|
||||||
for (i in 0..5) {
|
for (i in 0..5) {
|
||||||
(mHolder.findViewById(mRes.getIdentifier("week_num_$i", "id", mPackageName)) as TextView).apply {
|
mHolder.findViewById<TextView>(mRes.getIdentifier("week_num_$i", "id", mPackageName)).apply {
|
||||||
text = "${days[i * 7 + 3].weekOfYear}:" // fourth day of the week matters
|
text = "${days[i * 7 + 3].weekOfYear}:" // fourth day of the week matters
|
||||||
setTextColor(mTextColor)
|
setTextColor(mTextColor)
|
||||||
beVisibleIf(displayWeekNumbers)
|
beVisibleIf(displayWeekNumbers)
|
||||||
@ -183,7 +183,7 @@ class MonthFragment : Fragment(), MonthlyCalendar {
|
|||||||
|
|
||||||
val dividerMargin = mRes.displayMetrics.density.toInt()
|
val dividerMargin = mRes.displayMetrics.density.toInt()
|
||||||
for (i in 0 until len) {
|
for (i in 0 until len) {
|
||||||
(mHolder.findViewById(mRes.getIdentifier("day_$i", "id", mPackageName)) as LinearLayout).apply {
|
mHolder.findViewById<LinearLayout>(mRes.getIdentifier("day_$i", "id", mPackageName)).apply {
|
||||||
val day = days[i]
|
val day = days[i]
|
||||||
setOnClickListener { openDay(day.code) }
|
setOnClickListener { openDay(day.code) }
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
|||||||
for (i in 0..6) {
|
for (i in 0..6) {
|
||||||
val dayCode = Formatter.getDayCodeFromDateTime(curDay)
|
val dayCode = Formatter.getDayCodeFromDateTime(curDay)
|
||||||
val dayLetter = getDayLetter(curDay.dayOfWeek)
|
val dayLetter = getDayLetter(curDay.dayOfWeek)
|
||||||
(mView.findViewById(mRes.getIdentifier("week_day_label_$i", "id", context.packageName)) as TextView).apply {
|
mView.findViewById<TextView>(mRes.getIdentifier("week_day_label_$i", "id", context.packageName)).apply {
|
||||||
text = "$dayLetter\n${curDay.dayOfMonth}"
|
text = "$dayLetter\n${curDay.dayOfMonth}"
|
||||||
setTextColor(if (todayCode == dayCode) primaryColor else textColor)
|
setTextColor(if (todayCode == dayCode) primaryColor else textColor)
|
||||||
if (todayCode == dayCode)
|
if (todayCode == dayCode)
|
||||||
@ -427,7 +427,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
|||||||
mWasDestroyed = true
|
mWasDestroyed = true
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getColumnWithId(id: Int) = mView.findViewById(mRes.getIdentifier("week_column_$id", "id", context.packageName)) as ViewGroup
|
private fun getColumnWithId(id: Int) = mView.findViewById<ViewGroup>(mRes.getIdentifier("week_column_$id", "id", context.packageName))
|
||||||
|
|
||||||
fun updateScrollY(y: Int) {
|
fun updateScrollY(y: Int) {
|
||||||
if (wasFragmentInit)
|
if (wasFragmentInit)
|
||||||
|
@ -64,7 +64,7 @@ class YearFragment : Fragment(), YearlyCalendar {
|
|||||||
markCurrentMonth(res)
|
markCurrentMonth(res)
|
||||||
|
|
||||||
for (i in 1..12) {
|
for (i in 1..12) {
|
||||||
val monthView = mView.findViewById(res.getIdentifier("month_" + i, "id", activity.packageName)) as SmallMonthView
|
val monthView = mView.findViewById<SmallMonthView>(res.getIdentifier("month_" + i, "id", activity.packageName))
|
||||||
var dayOfWeek = dateTime.withMonthOfYear(i).dayOfWeek().get()
|
var dayOfWeek = dateTime.withMonthOfYear(i).dayOfWeek().get()
|
||||||
if (!mSundayFirst)
|
if (!mSundayFirst)
|
||||||
dayOfWeek--
|
dayOfWeek--
|
||||||
@ -79,10 +79,10 @@ class YearFragment : Fragment(), YearlyCalendar {
|
|||||||
private fun markCurrentMonth(res: Resources) {
|
private fun markCurrentMonth(res: Resources) {
|
||||||
val now = DateTime()
|
val now = DateTime()
|
||||||
if (now.year == mYear) {
|
if (now.year == mYear) {
|
||||||
val monthLabel = mView.findViewById(res.getIdentifier("month_${now.monthOfYear}_label", "id", activity.packageName)) as TextView
|
val monthLabel = mView.findViewById<TextView>(res.getIdentifier("month_${now.monthOfYear}_label", "id", activity.packageName))
|
||||||
monthLabel.setTextColor(context.config.primaryColor)
|
monthLabel.setTextColor(context.config.primaryColor)
|
||||||
|
|
||||||
val monthView = mView.findViewById(res.getIdentifier("month_${now.monthOfYear}", "id", activity.packageName)) as SmallMonthView
|
val monthView = mView.findViewById<SmallMonthView>(res.getIdentifier("month_${now.monthOfYear}", "id", activity.packageName))
|
||||||
monthView.todaysId = now.dayOfMonth
|
monthView.todaysId = now.dayOfMonth
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ class YearFragment : Fragment(), YearlyCalendar {
|
|||||||
lastHash = hashCode
|
lastHash = hashCode
|
||||||
val res = resources
|
val res = resources
|
||||||
for (i in 1..12) {
|
for (i in 1..12) {
|
||||||
val monthView = mView.findViewById(res.getIdentifier("month_$i", "id", context.packageName)) as SmallMonthView
|
val monthView = mView.findViewById<SmallMonthView>(res.getIdentifier("month_$i", "id", context.packageName))
|
||||||
monthView.setEvents(events.get(i))
|
monthView.setEvents(events.get(i))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user