mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-22 05:38:55 +00:00
Fix sleep button. Fixes #130
This commit is contained in:
parent
e55c806d97
commit
304ac30db1
1 changed files with 10 additions and 10 deletions
|
|
@ -191,7 +191,11 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
|
|||
btnToggleInn.setOnClickListener(this);
|
||||
|
||||
ViewHelper.SetBackgroundTint(btnToggleInn, res.getColor(R.color.brand));
|
||||
changeSleepButton(true);
|
||||
if(HabiticaApplication.User.getPreferences().getSleep()){
|
||||
btnToggleInn.setText("Check Out of Inn");
|
||||
}else{
|
||||
btnToggleInn.setText("Rest in the Inn");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -347,7 +351,11 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
|
|||
|
||||
if (v == btnToggleInn) {
|
||||
EventBus.getDefault().post(new ToggleInnCommand());
|
||||
changeSleepButton(false);
|
||||
if(!HabiticaApplication.User.getPreferences().getSleep()){
|
||||
btnToggleInn.setText("Check Out of Inn");
|
||||
}else{
|
||||
btnToggleInn.setText("Rest in the Inn");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -360,14 +368,6 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
|
|||
textNewMessage.setText("");
|
||||
}
|
||||
|
||||
public void changeSleepButton(boolean startupButton){
|
||||
if(HabiticaApplication.User.getPreferences().getSleep() && startupButton){
|
||||
btnToggleInn.setText("Check Out of Inn");
|
||||
}else{
|
||||
btnToggleInn.setText("Rest in the Inn");
|
||||
}
|
||||
}
|
||||
|
||||
private void toggleLike() {
|
||||
int newCount = currentUserLikedPost ? --likeCount : ++likeCount;
|
||||
currentUserLikedPost = !currentUserLikedPost;
|
||||
|
|
|
|||
Loading…
Reference in a new issue