From 2dc659cada08d4dfb59c8053da7ce01673357857 Mon Sep 17 00:00:00 2001 From: hlq07 Date: Sun, 27 May 2018 17:31:45 +0800 Subject: [PATCH] add translateType method --- .../cutecalendar/model/TodoItemUtil.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/src/main/java/org/cutem/cutecalendar/model/TodoItemUtil.java b/app/src/main/java/org/cutem/cutecalendar/model/TodoItemUtil.java index 5af62f8..f18c066 100644 --- a/app/src/main/java/org/cutem/cutecalendar/model/TodoItemUtil.java +++ b/app/src/main/java/org/cutem/cutecalendar/model/TodoItemUtil.java @@ -372,4 +372,23 @@ public class TodoItemUtil { return !isBeforeStart(item) && !isEnded(item); } + private static String[] TYPE_NAME = { + "unknown", + "others", + "conference", + "date", + "trip", + "anniversary", + "course", + "interview" + }; + + public static String translateType(int type) { + if (1 <= type && type < TYPE_NAME.length) { + return TYPE_NAME[type]; + } else { + return TYPE_NAME[0]; + } + } + }