Update Feature Spotlight layout

ET-6182
This commit is contained in:
Niccolò Forlini
2026-05-08 09:43:08 +02:00
committed by MargeBot
parent 593e407fd1
commit 2ba7b274e8
4 changed files with 11 additions and 192 deletions
@@ -51,10 +51,10 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import ch.protonmail.android.design.compose.theme.ProtonDimens
import ch.protonmail.android.design.compose.theme.ProtonTheme
import ch.protonmail.android.mailcommon.presentation.AdaptivePreviews
import ch.protonmail.android.mailcommon.presentation.NO_CONTENT_DESCRIPTION
import ch.protonmail.android.mailspotlight.presentation.R
import ch.protonmail.android.mailspotlight.presentation.model.FeatureDetailPageContent
@@ -99,6 +99,8 @@ private fun PortraitFeatureDetailPage(content: FeatureDetailPageContent, modifie
)
}
Spacer(modifier = Modifier.height(ProtonDimens.Spacing.Large))
Text(
text = stringResource(content.titleRes),
style = ProtonTheme.typography.headlineMedium.copy(fontWeight = FontWeight.Bold),
@@ -206,8 +208,7 @@ private const val LANDSCAPE_ILLUSTRATION_WEIGHT = 2f
private const val LANDSCAPE_TEXT_WEIGHT = 3f
private const val LANDSCAPE_IMAGE_MAX_HEIGHT_FRACTION = 0.75f
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO, showBackground = true)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES, showBackground = true)
@AdaptivePreviews
@Composable
private fun FeatureDetailPageB2CUnreadPreview() {
ProtonTheme {
@@ -224,8 +225,7 @@ private fun FeatureDetailPageB2CUnreadPreview() {
}
}
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO, showBackground = true)
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES, showBackground = true)
@AdaptivePreviews
@Composable
private fun FeatureDetailPageB2CCategoriesPreview() {
ProtonTheme {
@@ -242,7 +242,7 @@ private fun FeatureDetailPageB2CCategoriesPreview() {
}
}
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO, showBackground = true)
@AdaptivePreviews
@Composable
private fun FeatureDetailPageB2BUnreadPreview() {
ProtonTheme {
@@ -259,7 +259,7 @@ private fun FeatureDetailPageB2BUnreadPreview() {
}
}
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO, showBackground = true)
@AdaptivePreviews
@Composable
private fun FeatureDetailPageB2BCategoriesPreview() {
ProtonTheme {
@@ -276,11 +276,7 @@ private fun FeatureDetailPageB2BCategoriesPreview() {
}
}
@Preview(
uiMode = Configuration.UI_MODE_NIGHT_NO,
showBackground = true,
device = "spec:width=891dp,height=411dp,orientation=landscape"
)
@AdaptivePreviews
@Composable
private fun DetailPageLandscapeContinuePreview() {
ProtonTheme {
@@ -297,11 +293,7 @@ private fun DetailPageLandscapeContinuePreview() {
}
}
@Preview(
uiMode = Configuration.UI_MODE_NIGHT_NO,
showBackground = true,
device = "spec:width=891dp,height=411dp,orientation=landscape"
)
@AdaptivePreviews
@Composable
private fun FeatureDetailPageLandscapeB2BLastPreview() {
ProtonTheme {
@@ -124,7 +124,7 @@ private fun PortraitOverviewPage(
textAlign = TextAlign.Center
)
Spacer(modifier = Modifier.height(ProtonDimens.Spacing.Jumbo))
Spacer(modifier = Modifier.height(ProtonDimens.Spacing.Huge))
FeatureCard(featureItems)
@@ -230,7 +230,7 @@ private fun FeatureRow(
.fillMaxWidth()
.padding(ProtonDimens.Spacing.Large),
horizontalArrangement = Arrangement.spacedBy(ProtonDimens.Spacing.Large),
verticalAlignment = Alignment.CenterVertically
verticalAlignment = Alignment.Top
) {
Box(
modifier = Modifier
Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

@@ -1,173 +0,0 @@
<!--
~ Copyright (c) 2025 Proton Technologies AG
~ This file is part of Proton Technologies AG and Proton Mail.
~
~ Proton Mail is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Proton Mail is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with Proton Mail. If not, see <https://www.gnu.org/licenses/>.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="252dp"
android:height="144dp"
android:viewportWidth="252"
android:viewportHeight="144">
<group>
<clip-path android:pathData="M0,4h240v128h-240z" />
<path android:pathData="M67,52.16L116.63,18.45C118.66,17.07 121.34,17.07 123.37,18.45L173,52.16L122.25,86.64C120.89,87.56 119.11,87.56 117.75,86.64L67,52.16Z">
<aapt:attr name="android:fillColor">
<gradient
android:centerX="162.5"
android:centerY="-8.5"
android:gradientRadius="122.03"
android:type="radial">
<item
android:offset="0"
android:color="#FFB2EAFE" />
<item
android:offset="0.7"
android:color="#FF27ABF4" />
<item
android:offset="1"
android:color="#FF2C83DC" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M67,52.16L117.75,86.64C119.11,87.56 120.89,87.56 122.25,86.64L173,52.16V105.17C173,108.48 170.31,111.17 167,111.17H73C69.69,111.17 67,108.48 67,105.17V52.16Z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="168.18"
android:startY="52.16"
android:endX="138.34"
android:endY="131.37"
android:type="linear">
<item
android:offset="0"
android:color="#FFB2EAFE" />
<item
android:offset="1"
android:color="#FF27ABF4" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M123.75,66.16C123.75,68.24 122.07,69.91 120,69.91C117.93,69.91 116.25,68.24 116.25,66.16H123.75ZM120,34.91C126.9,34.91 132.5,40.51 132.5,47.41V56.16L135.36,61.17C136.32,62.84 135.11,64.91 133.19,64.91H106.81C104.89,64.91 103.69,62.84 104.64,61.17L107.5,56.16V47.41C107.5,40.51 113.1,34.92 120,34.91Z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="135.91"
android:startY="39.29"
android:endX="109.4"
android:endY="69.91"
android:type="linear">
<item
android:offset="0"
android:color="#FFFFFFFF" />
<item
android:offset="1"
android:color="#FFCEF2FF" />
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M172.62,83.69L172.62,83.69A7.44,7.44 81.36,0 1,174.2 94.1L163.67,108.4A7.44,7.44 81.36,0 1,153.27 109.99L153.26,109.99A7.44,7.44 81.36,0 1,151.68 99.58L162.21,85.27A7.44,7.44 81.36,0 1,172.62 83.69z"
android:fillColor="#2A8DD3" />
<path
android:pathData="M230.59,82.87C230.82,82.81 231,83.06 230.87,83.25L228.86,86.34C228.82,86.4 228.81,86.48 228.83,86.55L229.87,90.08C229.93,90.3 229.69,90.49 229.49,90.36L226.4,88.35C226.34,88.31 226.27,88.3 226.2,88.32L222.66,89.36C222.44,89.42 222.25,89.18 222.38,88.98L224.39,85.89C224.43,85.83 224.44,85.76 224.42,85.69L223.39,82.15C223.32,81.93 223.57,81.74 223.76,81.87L226.85,83.88C226.91,83.92 226.99,83.93 227.06,83.91L230.59,82.87Z"
android:fillColor="#D783FF"
android:fillAlpha="0.5" />
<path
android:pathData="M222.43,107.6C222.59,107.43 222.88,107.56 222.86,107.79L222.67,111.47C222.66,111.54 222.69,111.61 222.74,111.66L225.41,114.21C225.58,114.36 225.45,114.65 225.22,114.64L221.54,114.44C221.47,114.43 221.4,114.46 221.35,114.52L218.8,117.18C218.64,117.35 218.36,117.23 218.37,117L218.57,113.32C218.57,113.24 218.55,113.17 218.49,113.12L215.83,110.58C215.66,110.42 215.78,110.13 216.01,110.15L219.69,110.34C219.77,110.35 219.84,110.32 219.89,110.27L222.43,107.6Z"
android:fillColor="#D783FF"
android:fillAlpha="0.5" />
<path
android:pathData="M213.29,59.72C213.51,59.77 213.55,60.08 213.34,60.18L210.06,61.85C209.99,61.88 209.94,61.94 209.93,62.01L209.06,65.59C209,65.82 208.7,65.86 208.59,65.65L206.92,62.36C206.89,62.3 206.83,62.25 206.76,62.23L203.18,61.36C202.95,61.31 202.92,61 203.12,60.9L206.41,59.23C206.47,59.2 206.52,59.14 206.54,59.06L207.41,55.48C207.46,55.26 207.77,55.22 207.87,55.43L209.54,58.72C209.58,58.78 209.64,58.83 209.71,58.84L213.29,59.72Z"
android:fillColor="#D783FF"
android:fillAlpha="0.5" />
<path android:pathData="M147.34,120.15L176.04,70.11C176.75,68.86 178.51,68.76 179.38,69.91L207.95,108.35C208.81,109.5 208.21,111.16 206.8,111.49L150.62,124.56C148.07,125.16 146.03,122.42 147.34,120.15Z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="184.13"
android:startY="69.39"
android:endX="148.76"
android:endY="128.87"
android:type="linear">
<item
android:offset="0"
android:color="#FFF8E974" />
<item
android:offset="1"
android:color="#FFE5C297" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M177.45,69.41a25.5,5.75 53.37,1 0,30.43 40.93a25.5,5.75 53.37,1 0,-30.43 -40.93z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="197.28"
android:startY="86.44"
android:endX="177.5"
android:endY="93"
android:type="linear">
<item
android:offset="0"
android:color="#FFBC6D62" />
<item
android:offset="1"
android:color="#FF28225B" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M160.55,97.11C161.51,100.38 163.33,104.48 166.73,109.05C170.16,113.67 173.55,116.65 176.35,118.57L168.88,120.31C166.63,118.31 164.27,115.79 161.92,112.63C159.61,109.53 157.91,106.57 156.68,103.86L160.55,97.11ZM185.84,116.37C182.07,113.64 177.79,109.68 173.55,103.98C169.37,98.36 166.83,93.2 165.3,88.83L169.51,81.49C169.57,81.81 169.63,82.15 169.71,82.5C170.66,86.85 172.95,93.11 178.37,100.4C183.78,107.68 189.13,111.68 193.01,113.84C193.4,114.06 193.78,114.25 194.14,114.44L185.84,116.37Z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="186"
android:startY="94.5"
android:endX="137.5"
android:endY="95.5"
android:type="linear">
<item
android:offset="0"
android:color="#FFF0B57A" />
<item
android:offset="1"
android:color="#FF561E76" />
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M207.86,91.04C216.5,86 219.5,103 230.5,95.5"
android:strokeAlpha="0.5"
android:strokeWidth="4"
android:fillColor="#00000000"
android:strokeColor="#FFB39B"
android:strokeLineCap="round" />
<path
android:pathData="M196.73,75.66C202,70.5 191,63 198.5,56"
android:strokeAlpha="0.5"
android:strokeWidth="4"
android:fillColor="#00000000"
android:strokeColor="#44B4E4"
android:strokeLineCap="round" />
<path
android:pathData="M216.95,81.48m-1.34,-1.81a2.25,2.25 98.9,1 1,2.69 3.61a2.25,2.25 98.9,1 1,-2.69 -3.61"
android:fillColor="#F4D67B" />
<path
android:pathData="M214.95,104.77m-1.34,-1.81a2.25,2.25 98.9,1 1,2.69 3.61a2.25,2.25 98.9,1 1,-2.69 -3.61"
android:fillColor="#F4D67B" />
<path
android:pathData="M206.98,73.93m-1.34,-1.81a2.25,2.25 115.91,1 1,2.69 3.61a2.25,2.25 115.91,1 1,-2.69 -3.61"
android:fillColor="#F4D67B" />
<path
android:pathData="M188.5,68.36m-1.34,-1.81a2.25,2.25 98.53,1 1,2.69 3.61a2.25,2.25 98.53,1 1,-2.69 -3.61"
android:fillColor="#F4D67B" />
</group>
</vector>