Improves dates & cards

This commit is contained in:
stom79 2017-12-25 18:23:01 +01:00
parent fc306393f4
commit 5e7fbb9af1
2 changed files with 8 additions and 9 deletions

View File

@ -577,12 +577,11 @@ public class Helper {
long months = days / 30; long months = days / 30;
long years = days / 365; long years = days / 365;
String format = DateFormat.getDateInstance(DateFormat.SHORT).format(dateToot);
if( years > 0 ) { if( years > 0 ) {
SimpleDateFormat format = new SimpleDateFormat("M/d/yy", Locale.getDefault()); return format;
return format.format(dateToot);
} else if( months > 0 || days > 7) { } else if( months > 0 || days > 7) {
SimpleDateFormat format = new SimpleDateFormat("M/d", Locale.getDefault()); return format.substring(0,5);
return format.format(dateToot);
}else if( days > 0 ) }else if( days > 0 )
return context.getString(R.string.date_day, days); return context.getString(R.string.date_day, days);
else if(hours > 0) else if(hours > 0)

View File

@ -198,7 +198,7 @@
<LinearLayout <LinearLayout
android:id="@+id/status_cardview" android:id="@+id/status_cardview"
android:padding="10dp" android:padding="5dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:visibility="gone" android:visibility="gone"
@ -209,15 +209,15 @@
<ImageView <ImageView
android:layout_gravity="center" android:layout_gravity="center"
android:id="@+id/status_cardview_image" android:id="@+id/status_cardview_image"
android:layout_width="60dp" android:layout_width="80dp"
android:gravity="center" android:gravity="center"
android:layout_height="60dp" android:layout_height="80dp"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="2dp"
android:layout_marginStart="10dp" android:layout_marginStart="2dp"
android:layout_weight="1" android:layout_weight="1"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <TextView