mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-07 01:28: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.content.*;
|
||||||
import android.os.*;
|
import android.os.*;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.*;
|
import androidx.appcompat.widget.*;
|
||||||
@@ -52,6 +54,9 @@ public class ShowHabitRootView extends BaseRootView
|
|||||||
@BindView(R.id.subtitleCard)
|
@BindView(R.id.subtitleCard)
|
||||||
SubtitleCard subtitleCard;
|
SubtitleCard subtitleCard;
|
||||||
|
|
||||||
|
@BindView(R.id.habitNotes)
|
||||||
|
TextView habitNotes;
|
||||||
|
|
||||||
@BindView(R.id.overviewCard)
|
@BindView(R.id.overviewCard)
|
||||||
OverviewCard overviewCard;
|
OverviewCard overviewCard;
|
||||||
|
|
||||||
@@ -136,6 +141,7 @@ public class ShowHabitRootView extends BaseRootView
|
|||||||
private void initCards()
|
private void initCards()
|
||||||
{
|
{
|
||||||
subtitleCard.setHabit(habit);
|
subtitleCard.setHabit(habit);
|
||||||
|
initHabitNotes();
|
||||||
overviewCard.setHabit(habit);
|
overviewCard.setHabit(habit);
|
||||||
scoreCard.setHabit(habit);
|
scoreCard.setHabit(habit);
|
||||||
historyCard.setHabit(habit);
|
historyCard.setHabit(habit);
|
||||||
@@ -144,6 +150,14 @@ public class ShowHabitRootView extends BaseRootView
|
|||||||
barCard.setHabit(habit);
|
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
|
public interface Controller extends HistoryCard.Controller
|
||||||
{
|
{
|
||||||
default void onToolbarChanged() {}
|
default void onToolbarChanged() {}
|
||||||
|
|||||||
@@ -38,6 +38,16 @@
|
|||||||
android:id="@+id/subtitleCard"
|
android:id="@+id/subtitleCard"
|
||||||
style="@style/ShowHabit.Subtitle"/>
|
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
|
<View
|
||||||
android:id="@+id/headerShadow"
|
android:id="@+id/headerShadow"
|
||||||
style="@style/ToolbarShadow"/>
|
style="@style/ToolbarShadow"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user