Adjust widget text gravity (#35430)

This commit is contained in:
Simone Arpe
2026-04-10 18:24:08 +02:00
committed by GitHub
parent 28138db70b
commit e21d548ec2
2 changed files with 11 additions and 6 deletions
@@ -38,8 +38,9 @@
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:gravity="start"
android:layout_marginTop="16dp"
android:layout_marginHorizontal="16dp"
android:text="@string/try_brave_search_widget"
android:textColor="@color/text_primary"/>
@@ -48,8 +49,9 @@
style="@style/DefaultRegular"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:gravity="start"
android:layout_marginBottom="8dp"
android:layout_marginHorizontal="16dp"
android:text="@string/try_brave_search_widget_description"
android:textColor="@color/text_secondary" />
@@ -66,17 +68,17 @@
android:background="@drawable/button_transparent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_weight="1"
android:text="@string/not_now"
android:gravity="end"
android:layout_marginEnd="2dp"
android:textColor="@color/schemes_on_surface_variant" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btAddWidget"
style="@style/LargeFilledButton"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_marginStart="2dp"
android:text="@string/add_widget" />
</LinearLayout>
@@ -2704,7 +2704,10 @@ public abstract class BraveActivity extends ChromeActivity
private void showWidgetPromoPanel() {
if (mSearchWidgetPromoPanel != null) {
final View rootView = requireViewById(android.R.id.content);
mSearchWidgetPromoPanel.showIfNeeded(rootView, getBottomOffsetForWidgetPromo(), this);
rootView.post(
() ->
mSearchWidgetPromoPanel.showIfNeeded(
rootView, getBottomOffsetForWidgetPromo(), BraveActivity.this));
}
}