diff --git a/app/src/main/java/com/example/sprout/refactor/messengers/NavigationMessage.java b/app/src/main/java/com/example/sprout/refactor/messengers/NavigationMessage.java new file mode 100644 index 0000000..6c5327a --- /dev/null +++ b/app/src/main/java/com/example/sprout/refactor/messengers/NavigationMessage.java @@ -0,0 +1,33 @@ +package com.example.sprout.refactor.messengers; + +/** + * 画面遷移をするために送信するObject + * + * @author matsumoto_k + */ +public class NavigationMessage { + private final Type type; + private Class clazz = null; + + public NavigationMessage(Type type, Class clazz) { + this.type = type; + this.clazz = clazz; + } + + public NavigationMessage(Type type) { + this.type = type; + } + + public enum Type { + Start, // 指定のアクティビティを開始する + Finish // アクティビティを終了する + } + + public Type getType() { + return type; + } + + public Class getClazz() { + return clazz; + } +} diff --git a/app/src/main/java/com/example/sprout/refactor/messengers/ToastMessage.java b/app/src/main/java/com/example/sprout/refactor/messengers/ToastMessage.java new file mode 100644 index 0000000..860895f --- /dev/null +++ b/app/src/main/java/com/example/sprout/refactor/messengers/ToastMessage.java @@ -0,0 +1,32 @@ +package com.example.sprout.refactor.messengers; + +/** + * トーストを表示するために送信するObject + * + * @author matsumoto_k + */ +public class ToastMessage { + private final String message; + private final Length length; + + public ToastMessage(String message, Length length) { + this.message = message; + this.length = length; + } + + /** + * トーストを表示させた時の表示時間の長さ + */ + public enum Length { + SHORT, + LONG + } + + public String getMessage() { + return message; + } + + public Length getLength() { + return length; + } +} \ No newline at end of file