convert Day and Event models to kotlin

This commit is contained in:
tibbi 2016-09-15 23:58:49 +02:00
parent 09ef991010
commit 0993212094
6 changed files with 26 additions and 144 deletions

View File

@ -138,11 +138,11 @@ public class MyWidgetProvider extends AppWidgetProvider implements Calendar {
int curTextColor = mWeakTextColor;
float curTextSize = mDayTextSize;
if (day.getIsThisMonth()) {
if (day.isThisMonth()) {
curTextColor = mTextColor;
}
if (day.getIsToday()) {
if (day.isToday()) {
curTextSize = mTodayTextSize;
}

View File

@ -193,11 +193,11 @@ public class WidgetConfigureActivity extends AppCompatActivity implements Calend
int curTextColor = mWeakTextColor;
float curTextSize = mDayTextSize;
if (day.getIsThisMonth()) {
if (day.isThisMonth()) {
curTextColor = mTextColor;
}
if (day.getIsToday()) {
if (day.isToday()) {
curTextSize = mTodayTextSize;
}

View File

@ -1,37 +0,0 @@
package com.simplemobiletools.calendar.models;
public class Day {
private final int mValue;
private final boolean mIsThisMonth;
private final boolean mIsToday;
private final boolean mHasEvent;
private final String mCode;
public Day(int value, boolean isThisMonth, boolean isToday, String code, boolean hasEvent) {
mValue = value;
mIsThisMonth = isThisMonth;
mIsToday = isToday;
mCode = code;
mHasEvent = hasEvent;
}
public int getValue() {
return mValue;
}
public boolean getIsThisMonth() {
return mIsThisMonth;
}
public boolean getIsToday() {
return mIsToday;
}
public String getCode() {
return mCode;
}
public boolean getHasEvent() {
return mHasEvent;
}
}

View File

@ -1,103 +0,0 @@
package com.simplemobiletools.calendar.models;
import java.io.Serializable;
public class Event implements Serializable {
private static final long serialVersionUID = -32456795132344616L;
private int mId;
private int mStartTS;
private int mEndTS;
private String mTitle;
private String mDescription;
private int mReminderMinutes;
private int mRepeatInterval;
public Event() {
mId = 0;
mStartTS = 0;
mEndTS = 0;
mTitle = "";
mDescription = "";
mReminderMinutes = 0;
mRepeatInterval = 0;
}
public Event(int id, int startTS, int endTS, String title, String description, int reminderMinutes, int repeatInterval) {
mId = id;
mStartTS = startTS;
mEndTS = endTS;
mTitle = title;
mDescription = description;
mReminderMinutes = reminderMinutes;
mRepeatInterval = repeatInterval;
}
public int getId() {
return mId;
}
public void setId(int id) {
mId = id;
}
public int getStartTS() {
return mStartTS;
}
public void setStartTS(int startTS) {
mStartTS = startTS;
}
public int getEndTS() {
return mEndTS;
}
public void setEndTS(int endTS) {
mEndTS = endTS;
}
public String getTitle() {
return mTitle;
}
public void setTitle(String title) {
mTitle = title;
}
public String getDescription() {
return mDescription;
}
public void setDescription(String description) {
mDescription = description;
}
public int getReminderMinutes() {
return mReminderMinutes;
}
public void setReminderMinutes(int reminderMinutes) {
mReminderMinutes = reminderMinutes;
}
public int getRepeatInterval() {
return mRepeatInterval;
}
public void setRepeatInterval(int repeatInterval) {
mRepeatInterval = repeatInterval;
}
@Override
public String toString() {
return "Event {" +
"id=" + getId() +
", startTS=" + getStartTS() +
", endTS=" + getEndTS() +
", title=" + getTitle() +
", description=" + getDescription() +
", reminderMinutes=" + getReminderMinutes() +
", repeatInterval=" + getRepeatInterval() +
"}";
}
}

View File

@ -0,0 +1,7 @@
package com.simplemobiletools.calendar.models
class Day(val value: Int, val isThisMonth: Boolean, val isToday: Boolean, val code: String, val hasEvent: Boolean) {
override fun toString(): String {
return "Day {value=$value, isThisMonth=$isThisMonth, itToday=$isToday, code=$code, hasEvent=$hasEvent}"
}
}

View File

@ -0,0 +1,15 @@
package com.simplemobiletools.calendar.models
import java.io.Serializable
class Event(var id: Int = 0, var startTS: Int = 0, var endTS: Int = 0, var title: String = "", var description: String = "",
var reminderMinutes: Int = 0, var repeatInterval: Int = 0) : Serializable {
override fun toString(): String {
return "Event {id=$id, startTS=$startTS, endTS=$endTS, title=$title, description=$description, " +
"reminderMinutes=$reminderMinutes, repeatInterval=$repeatInterval}"
}
companion object {
private val serialVersionUID = -32456795132344616L
}
}