now showing notes in show habits

This commit is contained in:
Rechee
2020-01-08 18:57:47 -08:00
parent 8b042f30dc
commit 2c46e8909a
2 changed files with 24 additions and 0 deletions

View File

@@ -21,6 +21,8 @@ package org.isoron.uhabits.activities.habits.show;
import android.content.*;
import android.os.*;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.*;
@@ -52,6 +54,9 @@ public class ShowHabitRootView extends BaseRootView
@BindView(R.id.subtitleCard)
SubtitleCard subtitleCard;
@BindView(R.id.habitNotes)
TextView habitNotes;
@BindView(R.id.overviewCard)
OverviewCard overviewCard;
@@ -136,6 +141,7 @@ public class ShowHabitRootView extends BaseRootView
private void initCards()
{
subtitleCard.setHabit(habit);
initHabitNotes();
overviewCard.setHabit(habit);
scoreCard.setHabit(habit);
historyCard.setHabit(habit);
@@ -144,6 +150,14 @@ public class ShowHabitRootView extends BaseRootView
barCard.setHabit(habit);
}
private void initHabitNotes() {
final String description = habit.getDescription();
if(!description.isEmpty()){
habitNotes.setText(description);
habitNotes.setVisibility(View.VISIBLE);
}
}
public interface Controller extends HistoryCard.Controller
{
default void onToolbarChanged() {}

View File

@@ -38,6 +38,16 @@
android:id="@+id/subtitleCard"
style="@style/ShowHabit.Subtitle"/>
<TextView
android:id="@+id/habitNotes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Card"
android:gravity="center"
android:textColor="?highContrastTextColor"
tools:text="This is some example text for the notes"
android:visibility="gone"/>
<View
android:id="@+id/headerShadow"
style="@style/ToolbarShadow"/>