diff --git a/app/src/main/java/org/ntlab/irisclient/viewmodels/DrawingStateViewModel.java b/app/src/main/java/org/ntlab/irisclient/viewmodels/DrawingStateViewModel.java index be74306..137efe5 100644 --- a/app/src/main/java/org/ntlab/irisclient/viewmodels/DrawingStateViewModel.java +++ b/app/src/main/java/org/ntlab/irisclient/viewmodels/DrawingStateViewModel.java @@ -9,7 +9,6 @@ import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; -import androidx.lifecycle.ViewModel; import java.util.List; import java.util.Timer; @@ -20,7 +19,7 @@ import retrofit2.Response; import retrofit2.converter.jackson.JacksonConverterFactory; -public class DrawingStateViewModel extends ViewModel { +public class DrawingStateViewModel extends TimerViewModel { final private MutableLiveData stateMutableLiveData=new MutableLiveData<>(); final private MutableLiveData dnoMutableLiveData=new MutableLiveData<>(); @@ -28,6 +27,8 @@ private Integer drawingStatePreData; private Integer dnoPreData; + private String rid; + private String nickName; //フィールド public DrawingStateViewModel(MutableLiveData drawingStateMutableLiveData) { @@ -38,9 +39,9 @@ } //ゲッター - public LiveData getDrawingStateLiveData(){ - return this.stateMutableLiveData; - } +// public LiveData getDrawingStateLiveData(){ +// return this.stateMutableLiveData; +// } public void updateState(String rid) { @@ -67,7 +68,7 @@ public void onFailure(Call call, Throwable t) { } }); - } + } public void updateDno(String rid, String nickname) { final DrawingRest drawingRest = retrofit.create(DrawingRest.class); @@ -93,14 +94,30 @@ } }); } -public List getKeywords(String rid){ - return null; - } -public LiveData getDno(){ - return this.dnoMutableLiveData; - } -public LiveData getState(){ - return this.stateMutableLiveData; - } + public List getKeywords(String rid){ + return null; + } + public LiveData getDno(){ + return this.dnoMutableLiveData; + } + public LiveData getState(){ + return this.stateMutableLiveData; + } + + public void setRid(String rid){ + this.rid = rid; + } + + public void setNickName(String nickName){ + this.nickName = nickName; + } + @Override + public void update() { + updateState(rid); + updateDno(rid, nickName); + } + public void putDrawing(){ + + } }