Show NTP at startup: Fix single tab module view

This commit is contained in:
Carmelo Messina
2025-07-01 18:04:43 +02:00
parent 9001737e70
commit f3c70630ff
+30 -6
View File
@@ -24,7 +24,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
chrome/browser/sessions/session_restore.cc | 9 ++++-
chrome/browser/sessions/tab_loader.cc | 7 ++--
chrome/browser/sessions/tab_loader.h | 2 +-
.../res/layout/single_tab_module_layout.xml | 12 +++----
.../res/layout/single_tab_module_layout.xml | 17 +++++-----
.../SingleTabSwitcherCoordinator.java | 2 +-
.../SingleTabSwitcherOnNtpMediator.java | 5 +--
.../show-ntp-at-startup.grdp | 9 +++++
@@ -34,7 +34,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
.../about_flags_cc/show-ntp-at-startup.inc | 12 +++++++
.../show-ntp-at-startup.inc | 5 +++
.../show-ntp-at-startup.inc | 1 +
26 files changed, 140 insertions(+), 19 deletions(-)
26 files changed, 142 insertions(+), 22 deletions(-)
create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sShowNtpAtStartupAndroid.java
create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/show-ntp-at-startup.grdp
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/show-ntp-at-startup.inc
@@ -361,7 +361,13 @@ diff --git a/chrome/browser/sessions/tab_loader.h b/chrome/browser/sessions/tab_
diff --git a/chrome/browser/single_tab/android/java/res/layout/single_tab_module_layout.xml b/chrome/browser/single_tab/android/java/res/layout/single_tab_module_layout.xml
--- a/chrome/browser/single_tab/android/java/res/layout/single_tab_module_layout.xml
+++ b/chrome/browser/single_tab/android/java/res/layout/single_tab_module_layout.xml
@@ -72,7 +72,7 @@ found in the LICENSE file.
@@ -67,12 +67,12 @@ found in the LICENSE file.
<LinearLayout
android:layout_width="wrap_content"
- android:layout_height="match_parent">
+ android:layout_height="@dimen/single_tab_module_tab_thumbnail_size">
<RelativeLayout
android:id="@+id/tab_images"
android:layout_width="wrap_content"
@@ -370,7 +376,25 @@ diff --git a/chrome/browser/single_tab/android/java/res/layout/single_tab_module
android:background="@drawable/single_tab_thumbnail_background"
tools:ignore="UselessParent">
@@ -125,21 +125,21 @@ found in the LICENSE file.
@@ -85,8 +85,6 @@ found in the LICENSE file.
android:layout_marginStart="@dimen/single_tab_thumbnail_margin"
android:layout_marginEnd="@dimen/single_tab_thumbnail_margin"
android:layout_alignParentStart="true"
- android:layout_alignParentBottom="true"
- android:layout_alignParentTop="true"
android:adjustViewBounds="false"
android:gravity="center_horizontal"
android:importantForAccessibility="no"
@@ -117,7 +115,7 @@ found in the LICENSE file.
<LinearLayout
android:id="@+id/tab_info"
android:layout_width="0dp"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingStart="@dimen/single_tab_module_padding_bottom"
android:baselineAligned="false"
@@ -125,21 +123,22 @@ found in the LICENSE file.
<TextView
android:id="@+id/tab_title_view"
android:layout_width="match_parent"
@@ -388,9 +412,9 @@ diff --git a/chrome/browser/single_tab/android/java/res/layout/single_tab_module
android:id="@+id/tab_url_view"
+ android:layout_weight="1"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
+ android:minLines="6"
android:gravity="start"
- android:singleLine="true"
+ android:singleLine="false"