Skip to content

Commit

Permalink
fix: header cell title view
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed May 3, 2024
1 parent 5c80dbc commit 2f766f4
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public HeaderCell(Context context, int textColorKey, int padding, int topMargin,
this.bottomMargin = bottomMargin;
this.animated = animated;

setOrientation(LinearLayout.VERTICAL);
setPadding(AndroidUtilities.dp(padding), AndroidUtilities.dp(topMargin), AndroidUtilities.dp(padding), 0);

if (animated) {
animatedTextView = new AnimatedTextView(getContext());
animatedTextView.setTextSize(AndroidUtilities.dp(15));
Expand All @@ -90,7 +93,8 @@ public HeaderCell(Context context, int textColorKey, int padding, int topMargin,
animatedTextView.setTextColor(getThemedColor(textColorKey));
animatedTextView.setTag(textColorKey);
animatedTextView.getDrawable().setHacks(true, true, false);
addView(animatedTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, height - topMargin, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, padding, topMargin, padding, text2 ? 0 : bottomMargin));
// addView(animatedTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, height - topMargin, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, padding, topMargin, padding, text2 ? 0 : bottomMargin));
addView(animatedTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, height - topMargin));
} else {
textView = new TextView(getContext());
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
Expand All @@ -100,7 +104,8 @@ public HeaderCell(Context context, int textColorKey, int padding, int topMargin,
textView.setMinHeight(AndroidUtilities.dp(height - topMargin));
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, padding, topMargin, padding, text2 ? 0 : bottomMargin));
addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
}

textView2 = new TextView(getContext());
Expand Down

0 comments on commit 2f766f4

Please sign in to comment.