facebookarchive / shimmer-android

An easy, flexible way to add a shimmering effect to any view in an Android app.
http://facebook.github.io/shimmer-android/
Other
5.32k stars 697 forks source link

RTL support #25

Closed maher640 closed 7 years ago

maher640 commented 7 years ago

is there a way to make the shimmer effect from Right To Left?

maher640 commented 7 years ago

found it. you have to set the angle as .setAngle(ShimmerFrameLayout.MaskAngle.CW_180); for animation from Right To Left.

anoopmaddasseri commented 4 years ago

XML Attr: app:shimmer_direction=""

Programmatically

// Set direction of the shimmer's sweep.
val builder = Shimmer.AlphaHighlightBuilder()
builder.setDirection(getShimmerDirection())
shimmerLayout.setShimmer(builder.build())

private fun getShimmerDirection() =
        if (DeviceUtils.isLTR()) Shimmer.Direction.LEFT_TO_RIGHT else Shimmer.Direction.RIGHT_TO_LEFT
abdulsalam-alhammadi commented 3 years ago

You can use this attribute on xml app:shimmer_direction="right_to_left"