From ac8950ad0ff20776a0b7d3c1a7f483b1c2902be2 Mon Sep 17 00:00:00 2001 From: luvletter2333 Date: Thu, 7 Jul 2022 16:13:37 +0800 Subject: [PATCH] fix HeaderCell orientation --- .../src/main/java/org/telegram/ui/Cells/HeaderCell.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/HeaderCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/HeaderCell.java index fc955541c..43fa5f718 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/HeaderCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/HeaderCell.java @@ -67,6 +67,9 @@ public class HeaderCell extends LinearLayout { super(context); this.resourcesProvider = resourcesProvider; + setOrientation(LinearLayout.VERTICAL); + setPadding(AndroidUtilities.dp(padding), AndroidUtilities.dp(topMargin), AndroidUtilities.dp(padding), 0); + textView = new TextView(getContext()); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15); textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); @@ -74,13 +77,13 @@ public class HeaderCell extends LinearLayout { textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL); textView.setTextColor(getThemedColor(textColorKey)); textView.setTag(textColorKey); - addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, padding, topMargin, padding, text2 ? 0 : bottomMargin)); + addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 0, topMargin, padding, text2 ? 0 : bottomMargin)); textView2 = new TextView(getContext()); textView2.setTextSize(13); textView2.setMovementMethod(new AndroidUtilities.LinkMovementMethodMy()); textView2.setTextColor(Theme.getColor(Theme.key_dialogTextBlack)); - addView(textView2, LayoutHelper.createLinear(-2, -2, 0, 4, 0, bottomMargin)); + addView(textView2, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, 0, 4, 0, bottomMargin)); if (!text2) textView2.setVisibility(View.GONE);