From 2c33f7a7f84256b1bd3cc742d7a1fbddde0b814d Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 14 Oct 2020 19:11:53 +0200 Subject: [PATCH] Prepare the new layout. --- app/src/acad/res/values/strings.xml | 7 + app/src/full/res/values/strings.xml | 5 + .../fedilab/fedilabtube/PeertubeActivity.java | 3 +- .../drawer/CommentListAdapter.java | 10 +- app/src/main/res/layout/activity_peertube.xml | 557 ++++++++++++------ app/src/main/res/layout/drawer_comment.xml | 7 + 6 files changed, 392 insertions(+), 197 deletions(-) diff --git a/app/src/acad/res/values/strings.xml b/app/src/acad/res/values/strings.xml index 4e38387..071a79e 100644 --- a/app/src/acad/res/values/strings.xml +++ b/app/src/acad/res/values/strings.xml @@ -16,6 +16,13 @@ Automatique + + + %d réponse + %d réponse + %d réponses + + Thème Permet de changer le thème de l\'application La vidéo ne peut pas être fédérée ! diff --git a/app/src/full/res/values/strings.xml b/app/src/full/res/values/strings.xml index e518607..c1a2b54 100644 --- a/app/src/full/res/values/strings.xml +++ b/app/src/full/res/values/strings.xml @@ -8,6 +8,11 @@ set_theme_choice + + %d reply + %d replies + + Theme Allow to change app theme The video cannot be federated! diff --git a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java index 8c57fae..e2576cb 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java @@ -55,6 +55,7 @@ import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.AppCompatImageView; import androidx.appcompat.widget.PopupMenu; +import androidx.constraintlayout.widget.ConstraintLayout; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.core.graphics.drawable.DrawableCompat; @@ -146,7 +147,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd private AppCompatImageView fullScreenIcon; private TextView resolution; private int mode; - private LinearLayout write_comment_container; + private ConstraintLayout write_comment_container; private ImageView send; private TextView add_comment_read; private EditText add_comment_write; diff --git a/app/src/main/java/app/fedilab/fedilabtube/drawer/CommentListAdapter.java b/app/src/main/java/app/fedilab/fedilabtube/drawer/CommentListAdapter.java index 65567ab..95af31e 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/drawer/CommentListAdapter.java +++ b/app/src/main/java/app/fedilab/fedilabtube/drawer/CommentListAdapter.java @@ -215,6 +215,13 @@ public class CommentListAdapter extends RecyclerView.Adapter 0) { + holder.number_of_replies.setVisibility(View.VISIBLE); + holder.number_of_replies.setText(context.getResources().getQuantityString(R.plurals.number_of_replies, comment.getTotalReplies(), comment.getTotalReplies())); + } else { + holder.number_of_replies.setVisibility(View.GONE); + } + if (comment.getAccount() != null) { Spannable wordtoSpan; Pattern hashAcct; @@ -298,7 +305,7 @@ public class CommentListAdapter extends RecyclerView.Adapter - - - + - - - + android:layout_height="match_parent"> + android:layout_marginStart="20dp" + android:layout_marginLeft="20dp" + android:layout_marginEnd="20dp" + android:layout_marginRight="20dp" + android:orientation="vertical"> - - - - - - - - + android:layout_marginTop="5dp" /> - - - - - - - - - - - - - - - - - - + android:orientation="horizontal"> + android:layout_gravity="center_horizontal" + android:layout_marginStart="10dp" + android:layout_marginLeft="10dp" + android:layout_marginEnd="10dp" + android:layout_marginRight="10dp" + android:drawablePadding="5dp" + android:gravity="center_horizontal" + android:text="0" + app:drawableTopCompat="@drawable/ic_baseline_visibility_24" + tools:ignore="HardcodedText" /> - + android:layout_gravity="center_horizontal" + android:layout_marginStart="20dp" + android:layout_marginLeft="10dp" + android:layout_marginEnd="10dp" + android:layout_marginRight="10dp" + android:drawablePadding="5dp" + android:gravity="center_horizontal" + android:text="0" + app:drawableTopCompat="@drawable/ic_baseline_thumb_up_alt_24" + tools:ignore="HardcodedText" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + - - + - - - + android:layout_height="wrap_content"> + + + + + + + + + + + + + + + + + + + + + + + + + + + +