Skip to content

idapgroup/BlurOverflowText

Repository files navigation

BlurOverflowText Android Compose

Blur overflow text effect for compose enjoyers.

image image

Setup

Please, add to repositories jitpack:

repositories {
  mavenCentral()
  ...
  maven { url 'https://jitpack.io' }
}

Add to your module next dependency:

dependencies {
  implementation 'com.github.idapgroup:BlurOverflowText:<latest-version>'
}

Note: Do not forget to add compose dependencies 🙃

Usage sample

BlurOverflowText has all the base Text parameters except of overflow and softWrap to avoid unexpected library behavior.

The library works only if maxLines parameter is set.

If text exeeds the boundary limit, the last line of the text will be blured. blurLineWidth have all responsibilities for this.

Just provide expected blur length (default value is 0.2f which means 20% on the line width).

        BlurOverflowText(
            text = "Some very long string that should overflow this line.",
            modifier = Modifier.align(Alignment.Center),
            maxLines = 1,
            fontSize = 24.sp,
            blurLineWidth = 0.2f,
        )

About

Blur overflow text effect using android compose

Topics

Resources

License

Stars

13 stars

Watchers

4 watching

Forks

Packages

 
 
 

Contributors

Languages