From cb9f8605d5cfd576fc4e00028720deaa30d7073f Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 12 Sep 2020 17:54:37 +0200 Subject: [PATCH] Improve time for videos --- .../fedilabtube/drawer/PeertubeAdapter.java | 2 +- .../fedilab/fedilabtube/helper/Helper.java | 4 +- app/src/main/res/drawable/rounded_corner.xml | 15 +++++++ app/src/main/res/layout/drawer_peertube.xml | 42 +++++++++++++------ 4 files changed, 47 insertions(+), 16 deletions(-) create mode 100644 app/src/main/res/drawable/rounded_corner.xml diff --git a/app/src/main/java/app/fedilab/fedilabtube/drawer/PeertubeAdapter.java b/app/src/main/java/app/fedilab/fedilabtube/drawer/PeertubeAdapter.java index 1a7e5fc..4868c12 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/drawer/PeertubeAdapter.java +++ b/app/src/main/java/app/fedilab/fedilabtube/drawer/PeertubeAdapter.java @@ -90,7 +90,7 @@ public class PeertubeAdapter extends RecyclerView.Adapter 0) { return format; } else if (months > 0 || days > 7) { //Removes the year depending of the locale from DateFormat.SHORT format - SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.SHORT, Locale.getDefault()); + SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.LONG, Locale.getDefault()); df.applyPattern(df.toPattern().replaceAll("[^\\p{Alpha}]*y+[^\\p{Alpha}]*", "")); return df.format(dateToot); } else if (days > 0) diff --git a/app/src/main/res/drawable/rounded_corner.xml b/app/src/main/res/drawable/rounded_corner.xml new file mode 100644 index 0000000..d771c80 --- /dev/null +++ b/app/src/main/res/drawable/rounded_corner.xml @@ -0,0 +1,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/drawer_peertube.xml b/app/src/main/res/layout/drawer_peertube.xml index 0ef826c..812d0b8 100644 --- a/app/src/main/res/layout/drawer_peertube.xml +++ b/app/src/main/res/layout/drawer_peertube.xml @@ -15,6 +15,7 @@ see . --> - + android:layout_height="200dp"> + + + + + - - + android:layout_height="wrap_content" />