move config and dbHelper extensions to the top of the file
This commit is contained in:
parent
b405317f7d
commit
a9593e945b
|
@ -30,6 +30,10 @@ import org.joda.time.DateTimeZone
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
val Context.config: Config get() = Config.newInstance(applicationContext)
|
||||||
|
|
||||||
|
val Context.dbHelper: DBHelper get() = DBHelper.newInstance(applicationContext)
|
||||||
|
|
||||||
fun Context.updateWidgets() {
|
fun Context.updateWidgets() {
|
||||||
val widgetsCnt = AppWidgetManager.getInstance(applicationContext).getAppWidgetIds(ComponentName(applicationContext, MyWidgetMonthlyProvider::class.java))
|
val widgetsCnt = AppWidgetManager.getInstance(applicationContext).getAppWidgetIds(ComponentName(applicationContext, MyWidgetMonthlyProvider::class.java))
|
||||||
if (widgetsCnt.isNotEmpty()) {
|
if (widgetsCnt.isNotEmpty()) {
|
||||||
|
@ -266,10 +270,6 @@ fun Context.scheduleCalDAVSync(activate: Boolean) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val Context.config: Config get() = Config.newInstance(applicationContext)
|
|
||||||
|
|
||||||
val Context.dbHelper: DBHelper get() = DBHelper.newInstance(applicationContext)
|
|
||||||
|
|
||||||
fun Context.addDayNumber(rawTextColor: Int, day: DayMonthly, linearLayout: LinearLayout, dayLabelHeight: Int, callback: (Int) -> Unit) {
|
fun Context.addDayNumber(rawTextColor: Int, day: DayMonthly, linearLayout: LinearLayout, dayLabelHeight: Int, callback: (Int) -> Unit) {
|
||||||
var textColor = rawTextColor
|
var textColor = rawTextColor
|
||||||
if (!day.isThisMonth)
|
if (!day.isThisMonth)
|
||||||
|
|
Loading…
Reference in New Issue