From 192c2c6469f2c9cc89447c88e5a742def6118945 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 19 Jul 2022 11:19:50 +0200 Subject: [PATCH] Some fixes --- .../app/fedilab/android/client/entities/api/Account.java | 2 +- .../java/app/fedilab/android/client/entities/api/Poll.java | 2 +- .../java/app/fedilab/android/ui/drawer/StatusAdapter.java | 7 ++++--- app/src/main/res/layout/drawer_status.xml | 2 -- app/src/main/res/layout/drawer_status_compose.xml | 1 - 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/client/entities/api/Account.java b/app/src/main/java/app/fedilab/android/client/entities/api/Account.java index 8e245746..4b2392d8 100644 --- a/app/src/main/java/app/fedilab/android/client/entities/api/Account.java +++ b/app/src/main/java/app/fedilab/android/client/entities/api/Account.java @@ -80,7 +80,7 @@ public class Account implements Serializable { public Account moved; public synchronized Spannable getSpanDisplayName(Context context, WeakReference viewWeakReference) { - if (display_name == null) { + if (display_name == null || display_name.isEmpty()) { display_name = username; } return SpannableHelper.convert(context, display_name, null, this, null, true, viewWeakReference); diff --git a/app/src/main/java/app/fedilab/android/client/entities/api/Poll.java b/app/src/main/java/app/fedilab/android/client/entities/api/Poll.java index a4e8b5c6..a91a9361 100644 --- a/app/src/main/java/app/fedilab/android/client/entities/api/Poll.java +++ b/app/src/main/java/app/fedilab/android/client/entities/api/Poll.java @@ -58,7 +58,7 @@ public class Poll implements Serializable { @SerializedName("votes_count") public int votes_count; - public Spannable span_title; + public transient Spannable span_title; public Spannable getSpanTitle(Context context, Status status, WeakReference viewWeakReference) { span_title = SpannableHelper.convert(context, title, status, null, null, true, viewWeakReference); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index 96fb6a54..d0f2cc4c 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -40,7 +40,6 @@ import android.text.SpannableString; import android.text.Spanned; import android.text.TextUtils; import android.text.style.ForegroundColorSpan; -import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import android.view.LayoutInflater; @@ -396,10 +395,12 @@ public class StatusAdapter extends RecyclerView.Adapter Helper.changeDrawableColor(context, holder.binding.statusBoostIcon, theme_text_header_2_line); Helper.changeDrawableColor(context, holder.binding.statusPinned, theme_text_header_2_line); } - Log.v(Helper.TAG, "theme_statuses_color: " + theme_statuses_color); if (theme_statuses_color != -1) { holder.binding.cardviewContainer.setBackgroundColor(theme_statuses_color); holder.binding.translationLabel.setBackgroundColor(theme_statuses_color); + } else { + holder.binding.cardviewContainer.setBackgroundColor(ContextCompat.getColor(context, R.color.cyanea_primary_dark_reference)); + holder.binding.translationLabel.setBackgroundColor(ContextCompat.getColor(context, R.color.cyanea_primary_dark_reference)); } if (theme_boost_header_color != -1 && status.reblog != null) { holder.binding.statusBoosterInfo.setBackgroundColor(theme_boost_header_color); @@ -773,7 +774,7 @@ public class StatusAdapter extends RecyclerView.Adapter } else { holder.binding.botIcon.setVisibility(View.GONE); } - if (statusToDeal.in_reply_to_id != null) { + if (statusToDeal.in_reply_to_id != null && timelineType != Timeline.TimeLineEnum.UNKNOWN) { holder.binding.replyIcon.setVisibility(View.VISIBLE); } else { holder.binding.replyIcon.setVisibility(View.GONE); diff --git a/app/src/main/res/layout/drawer_status.xml b/app/src/main/res/layout/drawer_status.xml index eac76157..c73a3c89 100644 --- a/app/src/main/res/layout/drawer_status.xml +++ b/app/src/main/res/layout/drawer_status.xml @@ -19,7 +19,6 @@ xmlns:tools="http://schemas.android.com/tools" android:id="@+id/cardview_container" android:layout_width="match_parent" - android:backgroundTint="@color/cyanea_primary_dark_reference" android:layout_height="wrap_content" android:layout_marginHorizontal="@dimen/card_margin" android:layout_marginTop="@dimen/card_margin" @@ -35,7 +34,6 @@ android:clipChildren="false" android:clipToPadding="false" android:orientation="vertical"> - diff --git a/app/src/main/res/layout/drawer_status_compose.xml b/app/src/main/res/layout/drawer_status_compose.xml index 073f3ac1..bc345c88 100644 --- a/app/src/main/res/layout/drawer_status_compose.xml +++ b/app/src/main/res/layout/drawer_status_compose.xml @@ -20,7 +20,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginHorizontal="12dp" - android:backgroundTint="@color/cyanea_primary_dark_reference" android:layout_marginTop="12dp" android:clipChildren="false" android:clipToPadding="false"