OrangeBusinessToolsTheme

open class OrangeBusinessToolsTheme(orangeFontFamily: OrangeFontFamily, roundedCornerButtons: Boolean = false, roundedCornerTextInputs: Boolean = true) : OudsThemeContract

The Orange Business Tools theme.

This theme uses the Helvetica Neue font family. Due to legal issues Helvetica Neue font files are not bundled with this library.

The Helvetica Neue font files for the Orange Business Tools theme are available at https://brand.orange.com/en/brand-basics/typography and can be used by copying the ttf files in the res/font directory of the project and by using an implementation of OrangeBundledFontFamily (OrangeHelveticaNeueLatin.Bundled or OrangeHelveticaNeueArabic.Bundled) when creating the OrangeFontFamily instance passed as the OrangeBusinessToolsTheme.orangeFontFamily parameter:

OrangeBusinessToolsTheme(
orangeFontFamily = OrangeFontFamily(
latin = OrangeHelveticaNeueLatin.Bundled(
R.font.helvetica_neue_latin_regular,
R.font.helvetica_neue_latin_medium,
R.font.helvetica_neue_latin_bold
),
arabic = OrangeHelveticaNeueArabic.Bundled(
R.font.helvetica_neue_arabic_light,
R.font.helvetica_neue_arabic_regular,
R.font.helvetica_neue_arabic_medium,
)
)
)

Although the preferred way of using the Helvetica Neue font is configuring bundled font files, there are some cases where this is not possible, for instance in open source projects where the font files cannot be bundled due to legal issues. In these cases, the font files can alternatively be downloaded through the Android Downloadable Fonts feature by using an implementation of OrangeDownloadableFontFamily (OrangeHelveticaNeueLatin.Downloadable or OrangeHelveticaNeueArabic.Downloadable) instead:

OrangeBusinessToolsTheme(
orangeFontFamily = OrangeFontFamily(
latin = OrangeHelveticaNeueLatin.Downloadable,
arabic = OrangeHelveticaNeueArabic.Downloadable
)
)

In order to enable the Android Downloadable Fonts feature for the Orange Business Tools theme, please also add OrangeFontProvider as a provider in your app manifest:

<provider
android:name="com.orange.ouds.theme.orange.OrangeFontProvider"
android:authorities="com.orange.ouds.theme.orange.fontprovider"
android:exported="false" />

As well as the following permission:

<uses-permission android:name="android.permission.INTERNET" />

Finally, call the OrangeFontFamily.preloadDownloadableFontFamilies method in the onCreate method of your application singleton or main activity, and use the onComplete parameter to update your UI when preload is complete:

var areDownloadableOrangeFontFamiliesPreloaded by mutableStateOf(false)
private set
OrangeFontFamily.preloadDownloadableFontFamilies(this, listOf(OrangeHelveticaNeueLatin.Downloadable, OrangeHelveticaNeueArabic.Downloadable)) {
areDownloadableOrangeFontFamiliesPreloaded = true
}

Please note that the Android Downloadable Font feature works asynchronously, whether the font is already downloaded or not, and that FontFamily.Default will be used if download fails.

Parameters

orangeFontFamily

The Helvetica Neue font family to use for the Orange Business Tools theme. If an OrangeBundledFontFamily is used, the resource identifiers should reference Helvetica Neue font files. If an OrangeDownloadableFontFamily is used, the OrangeFontFamily.preloadDownloadableFontFamilies method should be called to download the Helvetica Neue font files through the Android Downloadable Fonts feature.

roundedCornerButtons

Whether or not buttons have rounded corners.

roundedCornerTextInputs

Whether or not text inputs have rounded corners.

Constructors

Link copied to clipboard
constructor(orangeFontFamily: OrangeFontFamily, roundedCornerButtons: Boolean = false, roundedCornerTextInputs: Boolean = true)

Properties

Link copied to clipboard
open override val borderTokens: OudsBorderSemanticTokens
Link copied to clipboard
open override val colorTokens: OudsColorSemanticTokens
Link copied to clipboard
open override val componentsTokens: OudsComponentsTokens
Link copied to clipboard
Link copied to clipboard
open override val effectTokens: OudsEffectSemanticTokens
Link copied to clipboard
open override val elevationTokens: OudsElevationSemanticTokens
Link copied to clipboard
open override val fontFamily: FontFamily
Link copied to clipboard
open override val fontTokens: OudsFontSemanticTokens
Link copied to clipboard
open override val gridTokens: OudsGridSemanticTokens
Link copied to clipboard
open override val materialColorTokens: OudsMaterialColorTokens
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val opacityTokens: OudsOpacitySemanticTokens
Link copied to clipboard
open override val settings: OudsThemeSettings
Link copied to clipboard
open override val sizeTokens: OudsSizeSemanticTokens
Link copied to clipboard
open override val spaceTokens: OudsSpaceSemanticTokens

Functions

Link copied to clipboard
open override fun getFontFamily(locale: Locale): FontFamily