SDP-Compose: a scalable size unit for Jetpack Compose

Do you miss SDP library from XML world? SDP-Compose bring to you SDP in your Jetpack Compose project.

Bonus: You don’t need SSP library, SDP-Compose have it too!

Usage

@Preview(showBackground = true)
@Composable
fun Greeting(name: String = "Android") {
    Text(
        text = "Hello $name!",
        color = Color.White,
        fontSize = 16.ssp,
        modifier = Modifier
            .fillMaxWidth()
            .padding(16.sdp)
            .clip(RoundedCornerShape(16.sdp))
            .background(Teal200)
            .padding(16.sdp),
    )
}

Setup

  1. Add it in your setting.gradle at the end of repositories:

dependencyResolutionManagement {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}
  1. Add the dependency

dependencies {
	implementation 'com.github.Kaaveh:sdp-compose:1.1.0'
}
  1. Enjoy!

GitHub

View Github