-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ANDROID-14825 Add fonts in Mistica Catalog app #394
Conversation
📱 New catalog for testing generated: Download |
ComponentStyle("O2", R.style.CatalogO2, O2), | ||
ComponentStyle("Vivo", R.style.CatalogVivo, VIVO), | ||
ComponentStyle("Vivo New", R.style.CatalogVivoNew, VIVO_NEW), | ||
ComponentStyle("Telefonica", R.style.CatalogTelefonica, TELEFONICA), | ||
ComponentStyle("Blau", R.style.MisticaTheme_Blau, BLAU), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blau has a licensed font
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if we dont have that font in our catalog could we have a CatalogBlau like the rest of the brands, even if is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
📱 New catalog for testing generated: Download |
📱 New catalog for testing generated: Download |
override val compatibilityTheme: Int | ||
get() = R.style.MisticaTheme_Movistar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be CatalogMovistar
so AndroidViews
still use the correct font. Same for other brands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
import com.telefonica.mistica.compose.theme.color.MisticaColors | ||
import com.telefonica.mistica.compose.theme.values.MisticaRadius | ||
|
||
object CatalogMovistarBrand : Brand { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can create a CatalogBrand
and reuse it so we don't have to write all this code for every brand:
abstract class CatalogBrand(
private val basebBrand: Brand,
val theme: Int,
) : Brand {
override val compatibilityTheme: Int = theme
override val lightColors: MisticaColors = brand.lightColors
// ...
}
The you can use it as follows:
object CatalogMovistarBrand : CatalogBrand(MovistarBrand, R.style.CatalogMovistar) {
override val fontFamily: FontFamily
get() = FontFamily(
Font(R.font.onair_light, FontWeight.Light),
Font(R.font.onair_regular, FontWeight.Normal),
Font(R.font.onair_medium, FontWeight.Medium),
)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
📱 New catalog for testing generated: Download |
) | ||
} | ||
|
||
object CatalogO2Brand : CatalogBrand(O2Brand, R.style.CatalogO2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A minor, could we have O2 with his brother O2New together as Vivo is with its two themes?
Also, check XML too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
val theme: Int, | ||
) : Brand { | ||
override val compatibilityTheme: Int | ||
get() = theme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now seeing this, it is necessary that theme is computed every time that compatibilityTheme is retrieved? cc: @yamal-alm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we can use override val compatibilityTheme: Int = theme
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, nice job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job 👏
📱 New catalog for testing generated: Download |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🥅 What's the goal?
Add fonts in Mistica Catalog app
🚧 How do we do it?
Added font archives and created correspondent themes for xml and Brand objects for Compose
☑️ Checks
🧪 How can I test this?