mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-10 14:28:47 +00:00
better formatting for tasks
This commit is contained in:
parent
dba6030c25
commit
933c9cd515
5 changed files with 16 additions and 7 deletions
|
|
@ -64,7 +64,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:text="@{daily.text}" />
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
android:id="@+id/notesTextView"
|
||||
style="@style/CardText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
android:text="@{habit.text}" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
android:id="@+id/notesTextView"
|
||||
style="@style/CardText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
android:text="@{reward.text}" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
android:id="@+id/notesTextView"
|
||||
style="@style/CardText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="41dp"
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
android:text="@{todo.text}" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
android:id="@+id/notesTextView"
|
||||
style="@style/CardText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
|
|
|||
|
|
@ -176,9 +176,10 @@ public class HabitItemRecyclerViewAdapter<THabitItem extends Task>
|
|||
@Override
|
||||
public long getItemId(int position) {
|
||||
Task task = filteredObservableContent.get(position);
|
||||
UUID uuid = new UUID(0, 0).fromString(task.getId());
|
||||
|
||||
return uuid.getMostSignificantBits();
|
||||
if (task.getId() != null && task.getId().length() == 36) {
|
||||
return UUID.fromString(task.getId()).getMostSignificantBits();
|
||||
}
|
||||
return UUID.randomUUID().getMostSignificantBits();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -248,6 +249,9 @@ public class HabitItemRecyclerViewAdapter<THabitItem extends Task>
|
|||
|
||||
public THabitItem Item;
|
||||
|
||||
@InjectView(R.id.notesTextView)
|
||||
TextView notesTextView;
|
||||
|
||||
public ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
|
|
@ -265,6 +269,11 @@ public class HabitItemRecyclerViewAdapter<THabitItem extends Task>
|
|||
public void bindHolder(THabitItem habitItem, int position) {
|
||||
double itemvalue = habitItem.getValue();
|
||||
Item = habitItem;
|
||||
if (habitItem.notes.length() == 0) {
|
||||
notesTextView.setHeight(0);
|
||||
} else {
|
||||
notesTextView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in a new issue