Commit 9962d3fe authored by Liquan (Max) Gu's avatar Liquan (Max) Gu Committed by Commit Bot

Rename: ephemeral-tab-toolbar layout to sheet-tab-toolbar layout

Since the EphemeralTabToolbar's layout has been reused by
PaymentHandlerToolbar. The layout will be more readable if it
uses a more general name.

In this patch, we change the name in the following manners:
* ephemeral_tab_toolbar --> sheet_tab_toolbar
* preview_tab_toolbar_height --> sheet_tab_toolbar_height
* ephemeral_tab_text --> upper_text
* ephemeral_tab_caption --> lower_text

Bug: 999196

Change-Id: Ia993c024f192980d071461f46b73a40106457d50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1911604
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714704}
parent ab4b2f2b
...@@ -3,17 +3,18 @@ ...@@ -3,17 +3,18 @@
Use of this source code is governed by a BSD-style license that can be Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. --> found in the LICENSE file. -->
<!-- A toolbar layout designed for bottom-sheet based components -->
<FrameLayout <FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/preview_tab_toolbar_height"> android:layout_height="@dimen/sheet_tab_toolbar_height">
<LinearLayout <LinearLayout
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/preview_tab_toolbar_height" android:layout_height="@dimen/sheet_tab_toolbar_height"
android:orientation="vertical"> android:orientation="vertical">
<View <View
...@@ -58,7 +59,7 @@ ...@@ -58,7 +59,7 @@
app:tint="@color/default_icon_color" /> app:tint="@color/default_icon_color" />
<TextView <TextView
android:id="@+id/ephemeral_tab_text" android:id="@+id/title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
...@@ -75,18 +76,18 @@ ...@@ -75,18 +76,18 @@
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="16dp" android:layout_height="16dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_below="@id/ephemeral_tab_text" android:layout_below="@id/title"
android:layout_toEndOf="@id/favicon" android:layout_toEndOf="@id/favicon"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
app:tint="@color/default_icon_color" /> app:tint="@color/default_icon_color" />
<TextView <TextView
android:id="@+id/ephemeral_tab_caption" android:id="@+id/origin"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toStartOf="@id/open_in_new_tab" android:layout_toStartOf="@id/open_in_new_tab"
android:layout_toEndOf="@id/security_icon" android:layout_toEndOf="@id/security_icon"
android:layout_below="@id/ephemeral_tab_text" android:layout_below="@id/title"
android:layout_marginLeft="4dp" android:layout_marginLeft="4dp"
android:textAlignment="viewStart" android:textAlignment="viewStart"
android:ellipsize="start" android:ellipsize="start"
...@@ -113,6 +114,6 @@ ...@@ -113,6 +114,6 @@
android:id="@+id/shadow" android:id="@+id/shadow"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/action_bar_shadow_height" android:layout_height="@dimen/action_bar_shadow_height"
android:layout_marginTop="@dimen/preview_tab_toolbar_height"/> android:layout_marginTop="@dimen/sheet_tab_toolbar_height"/>
</FrameLayout> </FrameLayout>
...@@ -140,10 +140,12 @@ ...@@ -140,10 +140,12 @@
<dimen name="overlay_panel_bar_height">70dp</dimen> <dimen name="overlay_panel_bar_height">70dp</dimen>
<!-- Preview tab dimensions --> <!-- Preview tab dimensions -->
<dimen name="preview_tab_toolbar_height">70dp</dimen>
<dimen name="preview_tab_favicon_size">24dp</dimen> <dimen name="preview_tab_favicon_size">24dp</dimen>
<dimen name="preview_tab_security_icon_size">22dp</dimen> <dimen name="preview_tab_security_icon_size">22dp</dimen>
<!-- Sheet tab toolbar dimensions -->
<dimen name="sheet_tab_toolbar_height">70dp</dimen>
<!-- Autofill keyboard accessory dimensions --> <!-- Autofill keyboard accessory dimensions -->
<dimen name="keyboard_accessory_height_with_shadow">56dp</dimen> <dimen name="keyboard_accessory_height_with_shadow">56dp</dimen>
<dimen name="keyboard_accessory_sheet_height">330dp</dimen> <dimen name="keyboard_accessory_sheet_height">330dp</dimen>
......
...@@ -65,7 +65,7 @@ public class EphemeralTabSheetContent implements BottomSheetContent { ...@@ -65,7 +65,7 @@ public class EphemeralTabSheetContent implements BottomSheetContent {
mOpenNewTabCallback = openNewTabCallback; mOpenNewTabCallback = openNewTabCallback;
mToolbarClickCallback = toolbarClickCallback; mToolbarClickCallback = toolbarClickCallback;
mToolbarHeightPx = mToolbarHeightPx =
mContext.getResources().getDimensionPixelSize(R.dimen.preview_tab_toolbar_height); mContext.getResources().getDimensionPixelSize(R.dimen.sheet_tab_toolbar_height);
createThinWebView(maxSheetHeight); createThinWebView(maxSheetHeight);
createToolbarView(); createToolbarView();
...@@ -101,8 +101,8 @@ public class EphemeralTabSheetContent implements BottomSheetContent { ...@@ -101,8 +101,8 @@ public class EphemeralTabSheetContent implements BottomSheetContent {
} }
private void createToolbarView() { private void createToolbarView() {
mToolbarView = (ViewGroup) LayoutInflater.from(mContext).inflate( mToolbarView =
R.layout.ephemeral_tab_toolbar, null); (ViewGroup) LayoutInflater.from(mContext).inflate(R.layout.sheet_tab_toolbar, null);
mShadow = mToolbarView.findViewById(R.id.shadow); mShadow = mToolbarView.findViewById(R.id.shadow);
mShadow.init(ApiCompatibilityUtils.getColor( mShadow.init(ApiCompatibilityUtils.getColor(
mContext.getResources(), R.color.toolbar_shadow_color), mContext.getResources(), R.color.toolbar_shadow_color),
...@@ -153,14 +153,14 @@ public class EphemeralTabSheetContent implements BottomSheetContent { ...@@ -153,14 +153,14 @@ public class EphemeralTabSheetContent implements BottomSheetContent {
/** Sets the ephemeral tab title text. */ /** Sets the ephemeral tab title text. */
public void updateTitle(String title) { public void updateTitle(String title) {
TextView toolbarText = mToolbarView.findViewById(R.id.ephemeral_tab_text); TextView toolbarText = mToolbarView.findViewById(R.id.title);
toolbarText.setText(title); toolbarText.setText(title);
} }
/** Sets the ephemeral tab URL. */ /** Sets the ephemeral tab URL. */
public void updateURL(String url) { public void updateURL(String url) {
TextView caption = mToolbarView.findViewById(R.id.ephemeral_tab_caption); TextView originView = mToolbarView.findViewById(R.id.origin);
caption.setText(UrlFormatter.formatUrlForSecurityDisplayOmitScheme(url)); originView.setText(UrlFormatter.formatUrlForSecurityDisplayOmitScheme(url));
} }
/** Sets the security icon. */ /** Sets the security icon. */
......
...@@ -41,7 +41,7 @@ import org.chromium.ui.base.ActivityWindowAndroid; ...@@ -41,7 +41,7 @@ import org.chromium.ui.base.ActivityWindowAndroid;
mTabHeight = activity.getActivityTab().getHeight(); mTabHeight = activity.getActivityTab().getHeight();
mToolbarView = toolbarView; mToolbarView = toolbarView;
mToolbarHeightPx = mToolbarHeightPx =
activity.getResources().getDimensionPixelSize(R.dimen.preview_tab_toolbar_height); activity.getResources().getDimensionPixelSize(R.dimen.sheet_tab_toolbar_height);
mContentView = (FrameLayout) LayoutInflater.from(activity).inflate( mContentView = (FrameLayout) LayoutInflater.from(activity).inflate(
R.layout.payment_handler_content, null); R.layout.payment_handler_content, null);
......
...@@ -33,15 +33,15 @@ import org.chromium.chrome.browser.ui.widget.FadingShadowView; ...@@ -33,15 +33,15 @@ import org.chromium.chrome.browser.ui.widget.FadingShadowView;
*/ */
/* package */ PaymentHandlerToolbarView(Context context) { /* package */ PaymentHandlerToolbarView(Context context) {
mToolbarHeightPx = mToolbarHeightPx =
context.getResources().getDimensionPixelSize(R.dimen.preview_tab_toolbar_height); context.getResources().getDimensionPixelSize(R.dimen.sheet_tab_toolbar_height);
mToolbarView = LayoutInflater.from(context).inflate(R.layout.ephemeral_tab_toolbar, null); mToolbarView = LayoutInflater.from(context).inflate(R.layout.sheet_tab_toolbar, null);
mOriginView = mToolbarView.findViewById(R.id.ephemeral_tab_caption); mOriginView = mToolbarView.findViewById(R.id.origin);
mTitleView = mToolbarView.findViewById(R.id.ephemeral_tab_text); mTitleView = mToolbarView.findViewById(R.id.title);
mProgressBar = mToolbarView.findViewById(R.id.progress_bar); mProgressBar = mToolbarView.findViewById(R.id.progress_bar);
mSecurityIconView = mToolbarView.findViewById(R.id.security_icon); mSecurityIconView = mToolbarView.findViewById(R.id.security_icon);
// These parts from ephemeral_tab_toolbar are not needed in this component. // These parts from sheet_tab_toolbar are not needed in this component.
mToolbarView.findViewById(R.id.open_in_new_tab).setVisibility(View.GONE); mToolbarView.findViewById(R.id.open_in_new_tab).setVisibility(View.GONE);
mToolbarView.findViewById(R.id.favicon).setVisibility(View.GONE); mToolbarView.findViewById(R.id.favicon).setVisibility(View.GONE);
......
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