RoadShieldIconProvider
Provide road shield and exit sign images.
Inorder to generate images in a different density to that of the target device the following code can be used:
private const val NEW_DPI = 240
val newConfig: Configuration = applicationContext.resources.configuration
newConfig.densityDpi = NEW_DPI
val provider = RoadShieldIconProvider(
context = applicationContext.createConfigurationContext(newConfig)
)
Content copied to clipboard
Important: This is a Public Preview API. It may be changed or removed at any time.
Parameters
context
The application context.
Properties
Link copied to clipboard
Style mode used when generating road shield or exit sign images. The style mode defaults to StyleMode.Main.
Functions
Link copied to clipboard
fun provideExitSignIcon(reference: IconReference, content: String): Result<Bitmap, RoadShieldIconProviderFailure>
Generate an exit sign image.
Link copied to clipboard
fun provideRoadShieldIcon(reference: IconReference, content: String): Result<Bitmap, RoadShieldIconProviderFailure>
Generate a road shield image.