Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4f0cc23 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

add back tablet ui

parent c219d8db
Loading
Loading
Loading
Loading
+112 −4
Original line number Diff line number Diff line
From 5e31300b6602528be862fb2fb91be954c74ab036 Mon Sep 17 00:00:00 2001
From 53b6d28575c1a4a44077202ea13d2fdb37d334ee Mon Sep 17 00:00:00 2001
From: althafvly <althafvly@gmail.com>
Date: Fri, 29 Sep 2023 14:35:06 +0530
Subject: [PATCH 7/8] fixup Add option to force tablet UI

---
 .../browser/ui/android/strings/android_chrome_strings.grd   | 6 ------
 .../browser_ui/strings/android/browser_ui_strings.grd       | 6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)
 .../ui/android/strings/android_chrome_strings.grd |  6 ------
 .../toolbar/top/ToolbarControlContainer.java      | 15 +++------------
 components/BUILD.gn                               |  4 ++--
 .../strings/android/browser_ui_strings.grd        |  6 ++++++
 ui/android/BUILD.gn                               |  2 --
 .../org/chromium/ui/base/DeviceFormFactor.java    | 11 +++++------
 6 files changed, 16 insertions(+), 28 deletions(-)

diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
index d935119f47e46..2e9db5ca4da57 100644
@@ -25,6 +29,61 @@ index d935119f47e46..2e9db5ca4da57 100644
       <message name="IDS_MOVE_TOOLBAR_BOTTOM_TITLE" desc="Title of the preference that allows the user to move toolbar on bottom.">
         Move toolbar to bottom
       </message>
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
index 1f8f98c6a6424..28a975d6d4f8b 100644
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
@@ -176,8 +176,9 @@ public class ToolbarControlContainer extends OptimizedFrameLayout implements Con
 
             return backgroundDrawable;
         } else {
-            Drawable backgroundDrawable = new ColorDrawable(
-                    ChromeColors.getPrimaryBackgroundColor(getContext(), incognito));
+            final Drawable backgroundDrawable =
+                    AppCompatResources.getDrawable(getContext(), R.drawable.toolbar_background)
+                            .mutate();
             backgroundDrawable.setTint(ChromeColors.getDefaultThemeColor(getContext(), incognito));
             backgroundDrawable.setTintMode(PorterDuff.Mode.MULTIPLY);
 
@@ -210,16 +211,6 @@ public class ToolbarControlContainer extends OptimizedFrameLayout implements Con
                 tabSupplier, compositorInMotionSupplier,
                 browserStateBrowserControlsVisibilityDelegate, isVisible,
                 layoutStateProviderSupplier);
-
-        View toolbarView = findViewById(R.id.toolbar);
-        assert toolbarView != null;
-
-        if (toolbarView instanceof ToolbarTablet) {
-            // On tablet, draw a fake tab strip and toolbar until the compositor is
-            // ready to draw the real tab strip. (On phone, the toolbar is made entirely
-            // of Android views, which are already initialized.)
-            setBackground(getTempTabStripDrawable(isIncognito));
-        }
     }
 
     @Override
diff --git a/components/BUILD.gn b/components/BUILD.gn
index 1227c584867d0..8eab7d5bb1a76 100644
--- a/components/BUILD.gn
+++ b/components/BUILD.gn
@@ -730,7 +730,7 @@ test("components_unittests") {
   # On other platforms, no components should depend on Chrome.
   # Since //chrome depends on //extensions, we also only assert_no_deps on
   # extensions targets for non-lacros builds.
-  if (!is_chromeos_lacros  && !is_android) {
+  if (!is_chromeos_lacros && !is_android) {
     assert_no_deps = [ "//chrome/*" ]
     assert_no_deps += disallowed_extension_deps_
   }
@@ -1018,7 +1018,7 @@ if (use_blink) {
     # dependency. On other platforms, no components should depend on Chrome.
     # Since //chrome depends on //extensions, we also only assert_no_deps on
     # extensions targets for non-lacros builds.
-    if (!is_chromeos_lacros  && !is_android) {
+    if (!is_chromeos_lacros && !is_android) {
       assert_no_deps = [ "//chrome/*" ]
       assert_no_deps += disallowed_extension_deps_
     }
diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/components/browser_ui/strings/android/browser_ui_strings.grd
index 4c721079ca474..a07c17caac0b5 100644
--- a/components/browser_ui/strings/android/browser_ui_strings.grd
@@ -42,6 +101,55 @@ index 4c721079ca474..a07c17caac0b5 100644
 
       <!-- Page Zoom -->
       <message name="IDS_PAGE_ZOOM_TITLE" desc="Title of the preference that allows the user to update the accessibility page zoom feature that applies to the web contents.">
diff --git a/ui/android/BUILD.gn b/ui/android/BUILD.gn
index c548631abe029..b47847845ca31 100644
--- a/ui/android/BUILD.gn
+++ b/ui/android/BUILD.gn
@@ -408,8 +408,6 @@ android_library("ui_no_recycler_view_java") {
     ":ui_android_features_java",
     ":ui_java_resources",
     ":ui_utils_java",
-    # dependency for ui_no_recycler_view_java
-    "//chrome/browser/preferences:java",
     "//base:base_java",
     "//base:jni_java",
     "//build/android:build_java",
diff --git a/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java b/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java
index 3df825d11052e..c123e0cccd54b 100644
--- a/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java
+++ b/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java
@@ -5,6 +5,8 @@
 package org.chromium.ui.base;
 
 import android.content.Context;
+import android.content.SharedPreferences;
+import android.preference.PreferenceManager;
 
 import androidx.annotation.UiThread;
 import androidx.annotation.VisibleForTesting;
@@ -12,8 +14,6 @@ import androidx.annotation.VisibleForTesting;
 import org.chromium.base.ContextUtils;
 import org.chromium.base.ThreadUtils;
 import org.chromium.base.annotations.CalledByNative;
-import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
-import org.chromium.chrome.browser.preferences.SharedPreferencesManager;
 import org.chromium.ui.R;
 import org.chromium.ui.display.DisplayAndroid;
 import org.chromium.ui.display.DisplayUtil;
@@ -64,10 +64,9 @@ public class DeviceFormFactor {
      *         E.g. http://developer.samsung.com/samsung-dex/testing
      */
     public static boolean isNonMultiDisplayContextOnTablet(Context context) {
-        if (SharedPreferencesManager.getInstance().readBoolean(
-                ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false))
-            return true;
-        return detectScreenWidthBucket(context) >= SCREEN_BUCKET_TABLET;
+        boolean isTabletUi = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(
+                "force_tablet_ui_enabled", false);
+        return isTabletUi || detectScreenWidthBucket(context) >= SCREEN_BUCKET_TABLET;
     }
 
     /**
-- 
2.34.1
+1 −1
Original line number Diff line number Diff line
From 8877abc517f29ca19b7efd09c766ee8b937af1cc Mon Sep 17 00:00:00 2001
From 46b08227a712379f047674b658a75f8acd0bf9ef Mon Sep 17 00:00:00 2001
From: althafvly <althafvly@gmail.com>
Date: Fri, 29 Sep 2023 14:41:03 +0530
Subject: [PATCH 8/8] fixup Move navigation bar to bottom
+0 −2
Original line number Diff line number Diff line
@@ -44,5 +44,3 @@
0006-fixup-Disable-Accessibility-service-by-default.patch
0007-fixup-Add-option-to-force-tablet-UI.patch
0008-fixup-Move-navigation-bar-to-bottom.patch

0001-Revert-Add-option-to-force-tablet-UI.patch
+0 −4
Original line number Diff line number Diff line
# List of removed patches in bromite
Remove-price-shopping-commerce-integrations.patch
Enable-SPPI-for-devices-with-enough-memory.patch
Remove-weblayer-dependency-on-Play-Services.patch
Unexpire-tab-groups-flags.patch
Disable-AGSA-by-default.patch
Update-i18n-zh_CN-support.patch
@@ -13,6 +12,3 @@ Automated-domain-substitution.patch
# List of removed patches in e
0028-Change-accent-and-switch-according-to-our-palette.patch
0034-Change-accent-to-match-our-palette.patch

# Reverted patches
0008-Revert-Add-option-to-force-tablet-UI.patch