mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
now showing notes in show habits
This commit is contained in:
@@ -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() {}
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
Reference in New Issue
Block a user