First Commit
This commit is contained in:
@ -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"
|
||||
}
|
@ -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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user