move config and dbHelper extensions to the top of the file

This commit is contained in:
tibbi 2017-12-02 19:44:52 +01:00
parent b405317f7d
commit a9593e945b
1 changed files with 4 additions and 4 deletions

View File

@ -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)