First Commit

This commit is contained in:
Tommaso Berlose
2017-10-06 18:13:30 +02:00
commit 13ba1e3281
116 changed files with 1973 additions and 0 deletions

View File

@ -0,0 +1,22 @@
package com.tommasoberlose.anotherwidget.`object`
import java.text.SimpleDateFormat
import java.util.*
/**
* Created by tommaso on 05/10/17.
*/
object Constants {
val CALENDAR_REQUEST_CODE = 1
val LOCATION_REQUEST_CODE = 2
val PREF_WEATHER_ICON = "PREF_WEATHER_ICON"
val PREF_WEATHER_TEMP = "PREF_WEATHER_TEMP"
val dateFormat = SimpleDateFormat("EEEE, MMM d", Locale.getDefault())
val hourFormat = SimpleDateFormat("HH:mm", Locale.getDefault())
val ACTION_TIME_UPDATE = "com.tommasoberlose.anotherwidget.action.ACTION_TIME_UPDATE"
val ACTION_WEATHER_UPDATE = "com.tommasoberlose.anotherwidget.action.ACTION_WEATHER_UPDATE"
}

View File

@ -0,0 +1,28 @@
package com.tommasoberlose.anotherwidget.`object`
import android.database.Cursor
import java.util.Date
/**
* Created by tommaso on 05/10/17.
*/
class Event(eventCursor: Cursor, instanceCursor: Cursor) {
var id: Int = 0
var title: String? = null
var startDate: Long = 0
var endDate: Long = 0
init {
id = instanceCursor.getInt(0)
startDate = instanceCursor.getLong(1)
endDate = instanceCursor.getLong(2)
title = eventCursor.getString(0)
}
override fun toString(): String {
return "Event:\nID" + id + "\nTITLE: " + title + "\nSTART DATE: " + Date(startDate) + "\nEND DATE: " + Date(endDate)
}
}