Skip to content

Commit

Permalink
ANDROID-13833 VivoNew Override (#312)
Browse files Browse the repository at this point in the history
* ANDROID-13833 Created a clone of VivoNew to mitigate a inheritance styling problem.

* ANDROID-13833 Omit compose customization

* ANDROID-13833 Add a new parameter in brand to handle inheritances

* ANDROID-13833 Copy VivoNew customizations

* ANDROID-13833 Delete old vivoNewOverriden files

* ANDROID-13833 Extract common functionality and add Override suffix

* Update design tokens (#316)

Co-authored-by: dagonco <[email protected]>

---------

Co-authored-by: Flow <[email protected]>
Co-authored-by: dagonco <[email protected]>
  • Loading branch information
3 people authored Nov 7, 2023
1 parent 0009bce commit 4611eb6
Show file tree
Hide file tree
Showing 25 changed files with 412 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,16 @@ import com.telefonica.mistica.catalog.ui.compose.components.TabsCatalog
import com.telefonica.mistica.catalog.ui.compose.components.Tags
import com.telefonica.mistica.catalog.ui.compose.components.Texts
import com.telefonica.mistica.catalog.ui.compose.components.Titles
import com.telefonica.mistica.compose.badge.Badge
import com.telefonica.mistica.compose.theme.MisticaTheme
import com.telefonica.mistica.compose.theme.brand.BlauBrand
import com.telefonica.mistica.compose.theme.brand.Brand
import com.telefonica.mistica.compose.theme.brand.BrandType
import com.telefonica.mistica.compose.theme.brand.BrandType.*
import com.telefonica.mistica.compose.theme.brand.BrandType.BLAU
import com.telefonica.mistica.compose.theme.brand.BrandType.MOVISTAR
import com.telefonica.mistica.compose.theme.brand.BrandType.O2
import com.telefonica.mistica.compose.theme.brand.BrandType.TELEFONICA
import com.telefonica.mistica.compose.theme.brand.BrandType.VIVO
import com.telefonica.mistica.compose.theme.brand.BrandType.VIVO_NEW
import com.telefonica.mistica.compose.theme.brand.MovistarBrand
import com.telefonica.mistica.compose.theme.brand.O2Brand
import com.telefonica.mistica.compose.theme.brand.TelefonicaBrand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public object BlauBrandColors {
textLinkSnackbar = BlauPaletteColor.blau_color_blauPurple30,
control = BlauPaletteColor.blau_color_grey2,
controlActivated = BlauPaletteColor.blau_color_blauBlueSecondary,
controlInverse = BlauPaletteColor.blau_color_white,
controlActivatedInverse = BlauPaletteColor.blau_color_white,
controlError = BlauPaletteColor.blau_color_blauRed,
loadingBar = BlauPaletteColor.blau_color_blauBlueSecondary,
loadingBarBackground = BlauPaletteColor.blau_color_blauBlueSecondary10,
Expand Down Expand Up @@ -170,6 +172,8 @@ public object BlauBrandColors {
textLinkSnackbar = BlauPaletteColor.blau_color_blauPurple30,
control = BlauPaletteColor.blau_color_darkModeGrey6,
controlActivated = BlauPaletteColor.blau_color_blauBlueSecondary,
controlInverse = BlauPaletteColor.blau_color_darkModeGrey6,
controlActivatedInverse = BlauPaletteColor.blau_color_blauBlueSecondary,
controlError = BlauPaletteColor.blau_color_blauRed,
loadingBar = BlauPaletteColor.blau_color_blauBluePrimary,
loadingBarBackground = BlauPaletteColor.blau_color_darkModeGrey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public object MovistarBrandColors {
textLinkSnackbar = MovistarPaletteColor.movistar_color_movistarBlue30,
control = MovistarPaletteColor.movistar_color_grey3,
controlActivated = MovistarPaletteColor.movistar_color_movistarBlue,
controlInverse = MovistarPaletteColor.movistar_color_white,
controlActivatedInverse = MovistarPaletteColor.movistar_color_white,
controlError = MovistarPaletteColor.movistar_color_pepper,
loadingBar = MovistarPaletteColor.movistar_color_movistarBlue30,
loadingBarBackground = MovistarPaletteColor.movistar_color_movistarBlue55,
Expand Down Expand Up @@ -170,6 +172,8 @@ public object MovistarBrandColors {
textLinkSnackbar = MovistarPaletteColor.movistar_color_movistarBlue30,
control = MovistarPaletteColor.movistar_color_darkModeGrey6,
controlActivated = MovistarPaletteColor.movistar_color_movistarBlue,
controlInverse = MovistarPaletteColor.movistar_color_darkModeGrey6,
controlActivatedInverse = MovistarPaletteColor.movistar_color_movistarBlue,
controlError = MovistarPaletteColor.movistar_color_pepper,
loadingBar = MovistarPaletteColor.movistar_color_movistarBlue,
loadingBarBackground = MovistarPaletteColor.movistar_color_darkModeGrey6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public object O2BrandColors {
textLinkSnackbar = O2PaletteColor.o2_color_o2BluePrimary30,
control = O2PaletteColor.o2_color_grey3,
controlActivated = O2PaletteColor.o2_color_o2BluePrimary,
controlInverse = O2PaletteColor.o2_color_white,
controlActivatedInverse = O2PaletteColor.o2_color_white,
controlError = O2PaletteColor.o2_color_pepper,
loadingBar = O2PaletteColor.o2_color_o2BluePrimary,
loadingBarBackground = O2PaletteColor.o2_color_grey1,
Expand Down Expand Up @@ -169,6 +171,8 @@ public object O2BrandColors {
textLinkSnackbar = O2PaletteColor.o2_color_o2BluePrimary30,
control = O2PaletteColor.o2_color_darkModeGrey6,
controlActivated = O2PaletteColor.o2_color_o2BluePrimary30,
controlInverse = O2PaletteColor.o2_color_darkModeGrey6,
controlActivatedInverse = O2PaletteColor.o2_color_o2BluePrimary30,
controlError = O2PaletteColor.o2_color_pepper,
loadingBar = O2PaletteColor.o2_color_darkModeO2BluePrimary,
loadingBarBackground = O2PaletteColor.o2_color_darkModeGrey6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public object TelefonicaBrandColors {
textLinkSnackbar = TelefonicaPaletteColor.telefonica_color_telefonicaBlue30,
control = TelefonicaPaletteColor.telefonica_color_grey3,
controlActivated = TelefonicaPaletteColor.telefonica_color_telefonicaBlue,
controlInverse = TelefonicaPaletteColor.telefonica_color_white,
controlActivatedInverse = TelefonicaPaletteColor.telefonica_color_white,
controlError = TelefonicaPaletteColor.telefonica_color_coral,
loadingBar = TelefonicaPaletteColor.telefonica_color_telefonicaBlue30,
loadingBarBackground = TelefonicaPaletteColor.telefonica_color_telefonicaBlue70,
Expand Down Expand Up @@ -179,6 +181,8 @@ public object TelefonicaBrandColors {
textLinkSnackbar = TelefonicaPaletteColor.telefonica_color_telefonicaBlue30,
control = TelefonicaPaletteColor.telefonica_color_darkModeGrey6,
controlActivated = TelefonicaPaletteColor.telefonica_color_telefonicaBlue,
controlInverse = TelefonicaPaletteColor.telefonica_color_darkModeGrey6,
controlActivatedInverse = TelefonicaPaletteColor.telefonica_color_telefonicaBlue,
controlError = TelefonicaPaletteColor.telefonica_color_coral,
loadingBar = TelefonicaPaletteColor.telefonica_color_telefonicaBlue,
loadingBarBackground = TelefonicaPaletteColor.telefonica_color_grey6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public object VivoBrandColors {
textLinkSnackbar = VivoPaletteColor.vivo_color_vivoPurpleLight50,
control = VivoPaletteColor.vivo_color_grey3,
controlActivated = VivoPaletteColor.vivo_color_vivoPurple,
controlInverse = VivoPaletteColor.vivo_color_white,
controlActivatedInverse = VivoPaletteColor.vivo_color_white,
controlError = VivoPaletteColor.vivo_color_pepper,
loadingBar = VivoPaletteColor.vivo_color_pink,
loadingBarBackground = VivoPaletteColor.vivo_color_pepperLight30,
Expand Down Expand Up @@ -170,6 +172,8 @@ public object VivoBrandColors {
textLinkSnackbar = VivoPaletteColor.vivo_color_vivoPurpleLight50,
control = VivoPaletteColor.vivo_color_darkModeGrey6,
controlActivated = VivoPaletteColor.vivo_color_vivoPurpleLight80,
controlInverse = VivoPaletteColor.vivo_color_darkModeGrey6,
controlActivatedInverse = VivoPaletteColor.vivo_color_vivoPurpleLight80,
controlError = VivoPaletteColor.vivo_color_pepper,
loadingBar = VivoPaletteColor.vivo_color_vivoPurpleLight80,
loadingBarBackground = VivoPaletteColor.vivo_color_darkModeGrey6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public object VivoNewBrandColors {
textLinkSnackbar = VivoNewPaletteColor.vivoNew_color_vivoPurpleLight20,
control = VivoNewPaletteColor.vivoNew_color_grey3,
controlActivated = VivoNewPaletteColor.vivoNew_color_vivoPurple,
controlInverse = VivoNewPaletteColor.vivoNew_color_white,
controlActivatedInverse = VivoNewPaletteColor.vivoNew_color_white,
controlError = VivoNewPaletteColor.vivoNew_color_pepper,
loadingBar = VivoNewPaletteColor.vivoNew_color_pink,
loadingBarBackground = VivoNewPaletteColor.vivoNew_color_pepperLight30,
Expand Down Expand Up @@ -170,6 +172,8 @@ public object VivoNewBrandColors {
textLinkSnackbar = VivoNewPaletteColor.vivoNew_color_vivoPurpleLight50,
control = VivoNewPaletteColor.vivoNew_color_darkModeGrey6,
controlActivated = VivoNewPaletteColor.vivoNew_color_vivoPurpleLight80,
controlInverse = VivoNewPaletteColor.vivoNew_color_darkModeGrey6,
controlActivatedInverse = VivoNewPaletteColor.vivoNew_color_vivoPurpleLight80,
controlError = VivoNewPaletteColor.vivoNew_color_pepper,
loadingBar = VivoNewPaletteColor.vivoNew_color_vivoPurpleLight80,
loadingBarBackground = VivoNewPaletteColor.vivoNew_color_darkModeGrey6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public class MisticaColors(
textLinkSnackbar: Color = Color.Unspecified,
control: Color = Color.Unspecified,
controlActivated: Color = Color.Unspecified,
controlInverse: Color = Color.Unspecified,
controlActivatedInverse: Color = Color.Unspecified,
controlError: Color = Color.Unspecified,
loadingBar: Color = Color.Unspecified,
loadingBarBackground: Color = Color.Unspecified,
Expand Down Expand Up @@ -334,6 +336,13 @@ public class MisticaColors(
public var controlActivated: Color by mutableStateOf(controlActivated, structuralEqualityPolicy())
internal set

public var controlInverse: Color by mutableStateOf(controlInverse, structuralEqualityPolicy())
internal set

public var controlActivatedInverse: Color by mutableStateOf(controlActivatedInverse,
structuralEqualityPolicy())
internal set

public var controlError: Color by mutableStateOf(controlError, structuralEqualityPolicy())
internal set

Expand Down Expand Up @@ -588,6 +597,8 @@ public class MisticaColors(
textLinkSnackbar: Color = this.textLinkSnackbar,
control: Color = this.control,
controlActivated: Color = this.controlActivated,
controlInverse: Color = this.controlInverse,
controlActivatedInverse: Color = this.controlActivatedInverse,
controlError: Color = this.controlError,
loadingBar: Color = this.loadingBar,
loadingBarBackground: Color = this.loadingBarBackground,
Expand Down Expand Up @@ -681,7 +692,8 @@ public class MisticaColors(
textButtonSecondaryInverse, textButtonSecondaryInverseSelected =
textButtonSecondaryInverseSelected, textLink = textLink, textLinkInverse = textLinkInverse,
textLinkDanger = textLinkDanger, textLinkSnackbar = textLinkSnackbar, control = control,
controlActivated = controlActivated, controlError = controlError, loadingBar = loadingBar,
controlActivated = controlActivated, controlInverse = controlInverse, controlActivatedInverse
= controlActivatedInverse, controlError = controlError, loadingBar = loadingBar,
loadingBarBackground = loadingBarBackground, toggleAndroidInactive = toggleAndroidInactive,
toggleAndroidBackgroundActive = toggleAndroidBackgroundActive, iosControlKnob =
iosControlKnob, divider = divider, dividerInverse = dividerInverse, navigationBarDivider =
Expand Down Expand Up @@ -764,6 +776,8 @@ public class MisticaColors(
textLinkSnackbar = other.textLinkSnackbar
control = other.control
controlActivated = other.controlActivated
controlInverse = other.controlInverse
controlActivatedInverse = other.controlActivatedInverse
controlError = other.controlError
loadingBar = other.loadingBar
loadingBarBackground = other.loadingBarBackground
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
<item name="colorTextLinkSnackbar">@color/blau_color_blauPurple30</item>
<item name="colorControl">@color/blau_color_darkModeGrey6</item>
<item name="colorControlActive">@color/blau_color_blauBlueSecondary</item>
<item name="colorControlInverse">@color/blau_color_darkModeGrey6</item>
<item name="colorControlActivatedInverse">@color/blau_color_blauBlueSecondary</item>
<item name="colorControlError">@color/blau_color_blauRed</item>
<item name="colorLoadingBar">@color/blau_color_blauBluePrimary</item>
<item name="colorLoadingBarBackground">@color/blau_color_darkModeGrey</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
<item name="colorTextLinkSnackbar">@color/movistar_color_movistarBlue30</item>
<item name="colorControl">@color/movistar_color_darkModeGrey6</item>
<item name="colorControlActive">@color/movistar_color_movistarBlue</item>
<item name="colorControlInverse">@color/movistar_color_darkModeGrey6</item>
<item name="colorControlActivatedInverse">@color/movistar_color_movistarBlue</item>
<item name="colorControlError">@color/movistar_color_pepper</item>
<item name="colorLoadingBar">@color/movistar_color_movistarBlue</item>
<item name="colorLoadingBarBackground">@color/movistar_color_darkModeGrey6</item>
Expand Down
2 changes: 2 additions & 0 deletions library/src/main/res/values-night/themes_o2_autogenerated.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
<item name="colorTextLinkSnackbar">@color/o2_color_o2BluePrimary30</item>
<item name="colorControl">@color/o2_color_darkModeGrey6</item>
<item name="colorControlActive">@color/o2_color_o2BluePrimary30</item>
<item name="colorControlInverse">@color/o2_color_darkModeGrey6</item>
<item name="colorControlActivatedInverse">@color/o2_color_o2BluePrimary30</item>
<item name="colorControlError">@color/o2_color_pepper</item>
<item name="colorLoadingBar">@color/o2_color_darkModeO2BluePrimary</item>
<item name="colorLoadingBarBackground">@color/o2_color_darkModeGrey6</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
<item name="colorTextLinkSnackbar">@color/telefonica_color_telefonicaBlue30</item>
<item name="colorControl">@color/telefonica_color_darkModeGrey6</item>
<item name="colorControlActive">@color/telefonica_color_telefonicaBlue</item>
<item name="colorControlInverse">@color/telefonica_color_darkModeGrey6</item>
<item name="colorControlActivatedInverse">@color/telefonica_color_telefonicaBlue</item>
<item name="colorControlError">@color/telefonica_color_coral</item>
<item name="colorLoadingBar">@color/telefonica_color_telefonicaBlue</item>
<item name="colorLoadingBarBackground">@color/telefonica_color_grey6</item>
Expand Down
Loading

0 comments on commit 4611eb6

Please sign in to comment.