AppDimens

object AppDimens

EN A singleton object that provides functions for responsive dimension management, acting as a gateway to the AppDimensFixed and AppDimensDynamic constructors.

PT Objeto singleton que fornece funções para gerenciamento de dimensões responsivas, agindo como um gateway para os construtores AppDimensFixed e AppDimensDynamic.

Functions

Link copied to clipboard
fun calculateAvailableItemCount(containerSizePx: Int, itemSizeDp: Float, itemMarginDp: Float, resources: Resources): Int

EN Calculates the maximum number of items that can fit in a container, given the container size in PX.

Link copied to clipboard
fun dynamic(initialValueDp: Float, ignoreMultiViewAdjustment: Boolean = false): AppDimensDynamic

EN Initializes the AppDimensDynamic constructor from a Float value in Dp.

fun dynamic(initialValueInt: Int, ignoreMultiViewAdjustment: Boolean = false): AppDimensDynamic

EN Initializes the AppDimensDynamic constructor from an Int value in Dp.

Link copied to clipboard
fun dynamicPercentageDp(percentage: Float, type: ScreenType = ScreenType.LOWEST, resources: Resources): Float

EN Calculates a dynamic dimension value based on a percentage (0.0 to 1.0) of the screen dimension. Returns the value in Dp (Float).

Link copied to clipboard
fun dynamicPercentagePx(percentage: Float, type: ScreenType = ScreenType.LOWEST, resources: Resources): Float

EN Calculates a dynamic dimension value based on a percentage and converts it to Pixels (PX).

Link copied to clipboard
fun dynamicPercentageSp(percentage: Float, type: ScreenType = ScreenType.LOWEST, resources: Resources): Float

EN Calculates a dynamic dimension value based on a percentage and converts it to Scalable Pixels (SP) in PX.

Link copied to clipboard
fun fixed(initialValueDp: Float, ignoreMultiViewAdjustment: Boolean = false): AppDimensFixed

EN Initializes the AppDimensFixed constructor from a Float value in Dp.

fun fixed(initialValueInt: Int, ignoreMultiViewAdjustment: Boolean = false): AppDimensFixed

EN Initializes the AppDimensFixed constructor from an Int value in Dp.