tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 25d57d1b70cc2d44f83c20d6baa0040702209719
parent a43c8bcdab8a39f2f831e3cfaf6eb9709b054440
Author: John Oberhauser <j.git-global@obez.io>
Date:   Fri,  9 Jan 2026 19:33:48 +0000

Bug 2009058 - Part 1: Refactoring flexible window previews so they are aligned with each other r=android-reviewers,007

Differential Revision: https://phabricator.services.mozilla.com/D278386

Diffstat:
Mmobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/annotation/FlexibleWindowLightDarkPreview.kt | 5++---
Mmobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/annotation/FlexibleWindowPreview.kt | 13+++++++++----
Amobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/annotation/FlexibleWindowPreviewSizes.kt | 9+++++++++
3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/mobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/annotation/FlexibleWindowLightDarkPreview.kt b/mobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/annotation/FlexibleWindowLightDarkPreview.kt @@ -9,9 +9,6 @@ import androidx.compose.ui.tooling.preview.Devices import androidx.compose.ui.tooling.preview.Preview import mozilla.components.compose.base.theme.layout.AcornWindowSize -private const val SMALL_WINDOW_WIDTH = 400 -private const val MEDIUM_WINDOW_WIDTH = 700 - /** * A wrapper annotation for creating a preview that renders a preview for each * combination of [AcornWindowSize] and Light/Dark theme. @@ -54,11 +51,13 @@ private const val MEDIUM_WINDOW_WIDTH = 700 ) @Preview( name = "Large Window Light Landscape", + widthDp = LARGE_WINDOW_WIDTH, device = Devices.PIXEL_TABLET, uiMode = Configuration.UI_MODE_NIGHT_NO, ) @Preview( name = "Large Window Dark Landscape", + widthDp = LARGE_WINDOW_WIDTH, device = Devices.PIXEL_TABLET, uiMode = Configuration.UI_MODE_NIGHT_YES, ) diff --git a/mobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/annotation/FlexibleWindowPreview.kt b/mobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/annotation/FlexibleWindowPreview.kt @@ -15,16 +15,21 @@ import mozilla.components.compose.base.theme.layout.AcornWindowSize // to work properly. See: https://issuetracker.google.com/issues/300116108#comment1 @Preview( name = "Small Window", - widthDp = 400, + widthDp = SMALL_WINDOW_WIDTH, +) +@Preview( + name = "Small Window Landscape", + heightDp = SMALL_WINDOW_WIDTH, + widthDp = SMALL_WINDOW_WIDTH * 2, ) @Preview( name = "Medium Window", - widthDp = 700, + widthDp = MEDIUM_WINDOW_WIDTH, device = Devices.NEXUS_7, ) @Preview( name = "Large Window", - widthDp = 1000, - device = Devices.AUTOMOTIVE_1024p, + widthDp = LARGE_WINDOW_WIDTH, + device = Devices.PIXEL_TABLET, ) annotation class FlexibleWindowPreview diff --git a/mobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/annotation/FlexibleWindowPreviewSizes.kt b/mobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/annotation/FlexibleWindowPreviewSizes.kt @@ -0,0 +1,9 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package mozilla.components.compose.base.annotation + +internal const val SMALL_WINDOW_WIDTH = 400 +internal const val MEDIUM_WINDOW_WIDTH = 700 +internal const val LARGE_WINDOW_WIDTH = 1000