Commit f3557fdb authored by Mugdha Lakhani's avatar Mugdha Lakhani Committed by Commit Bot

[WebLayer] Remove urlbar textview's layout weight

A layout weight of 1 is a good way to make the TextView take up the rest
of the remaining width of the parent view, but it is causing
issues with centering of the view. This CL removes that.

It also centers the contents of the UrlBarView to match the current use
case.

Here's a video of what the UI looks like after this change:
https://drive.google.com/file/d/1fRzackboMhZW5mMAkiLyKs9zKbll35Ei/view?usp=sharing

Bug: 1052375, b/156453601
Change-Id: Iecf4b03aacc2ebb60253c6e437031de1320f644a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2199277Reviewed-by: default avatarBo <boliu@chromium.org>
Auto-Submit: Mugdha Lakhani <nator@chromium.org>
Commit-Queue: Mugdha Lakhani <nator@chromium.org>
Cr-Commit-Position: refs/heads/master@{#768892}
parent 8fe5edd8
......@@ -9,6 +9,7 @@ import android.content.res.ColorStateList;
import android.graphics.Color;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageButton;
import android.widget.LinearLayout;
......@@ -94,6 +95,8 @@ public class UrlBarControllerImpl extends IUrlBarController.Stub {
public UrlBarView(@NonNull Context context, Bundle options) {
super(context);
setGravity(Gravity.CENTER_HORIZONTAL);
mTextSize = options.getFloat(UrlBarOptionsKeys.URL_TEXT_SIZE, DEFAULT_TEXT_SIZE);
mShowPageInfoWhenUrlTextClicked = options.getBoolean(
UrlBarOptionsKeys.SHOW_PAGE_INFO_WHEN_URL_TEXT_CLICKED, /*default= */ false);
......
......@@ -22,8 +22,7 @@
<TextView
android:id="@+id/url_text"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_gravity="center_vertical"
android:maxLines="1"
android:paddingEnd="@dimen/url_text_edge_padding"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment