Skip to content

Commit

Permalink
fix: solve various issues with task display
Browse files Browse the repository at this point in the history
Fixes #10
  • Loading branch information
AKPWebDesign committed Aug 26, 2017
1 parent 098a529 commit 15a9ccb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ private static String millisToShortDHMS(long duration, String extra) {
res = String.format(Locale.ENGLISH, "%02d:%02d:%02d", hours, minutes, seconds);
}
else if (days == 1) {
res = String.format(Locale.ENGLISH, "%d day \r\n%02d:%02d:%02d", days, hours, minutes, seconds);
res = String.format(Locale.ENGLISH, "%d day\n%02d:%02d:%02d", days, hours, minutes, seconds);
}
else {
res = String.format(Locale.ENGLISH, "%d days \r\n%02d:%02d:%02d", days, hours, minutes, seconds);
res = String.format(Locale.ENGLISH, "%d days\n%02d:%02d:%02d", days, hours, minutes, seconds);
}
return extra + res;
}
Expand Down
32 changes: 20 additions & 12 deletions app/src/main/res/layout/item_whenevent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,47 @@
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground">
android:foreground="?android:attr/selectableItemBackground"
android:minHeight="60dp">

<TextView
android:id="@+id/event_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start|center_vertical"
android:layout_centerVertical="true"
android:textAlignment="textStart"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:paddingRight="?android:attr/listPreferredItemPaddingRight"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="@dimen/item_padding"
android:paddingLeft="@dimen/item_padding"
android:paddingRight="@dimen/item_padding"
android:paddingStart="@dimen/item_padding"
android:paddingTop="@dimen/item_padding"
android:paddingBottom="@dimen/item_padding"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_toStartOf="@+id/event_time"
android:layout_toLeftOf="@+id/event_time"
tools:text="An Event" />
tools:text="An Event \ntwo lines\nthree lines" />

<TextView
android:id="@+id/event_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end|center_vertical"
android:textAlignment="textEnd"
android:layout_centerVertical="true"
android:textAlignment="viewEnd"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:paddingRight="?android:attr/listPreferredItemPaddingRight"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="@dimen/item_padding"
android:paddingRight="@dimen/item_padding"
android:paddingStart="@dimen/item_padding"
android:paddingLeft="@dimen/item_padding"
android:paddingTop="@dimen/item_padding"
android:paddingBottom="@dimen/item_padding"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
android:layout_alignParentEnd="true"
tools:text="15 days\n00:00:00"/>

</RelativeLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
<dimen name="desc_padding">40dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="appbar_padding_top">8dp</dimen>
<dimen name="item_padding">8dp</dimen>
</resources>

0 comments on commit 15a9ccb

Please sign in to comment.