Comments (19)
Shouldn't the ShimmerFrameLayout
contain the views? Or are you thinking of using RelativeLayout
or FrameLayout
parent view group that holds the shimmer and the image view and overlays them?
I was also able to achieve clearing by doing this:
shimmerFrameLayout.setShimmer(
new Shimmer.AlphaHighlightBuilder()
.setBaseAlpha(1)
.setIntensity(0)
.build());
shimmerFrameLayout.stopShimmer();
shimmerFrameLayout.clearAnimation();
But it's pretty ugly
from shimmer-android.
The appropriate use there would be to use a ShimmerDrawable
directly as the placeholder for Picasso while the image loads.
from shimmer-android.
It seems like a good compromise is letting users call setShimmer(null)
to remove the shimmer. I can make that change.
from shimmer-android.
Shouldn't the
ShimmerFrameLayout
contain the views? Or are you thinking of usingRelativeLayout
orFrameLayout
parent view group that holds the shimmer and the image view and overlays them?I was also able to achieve clearing by doing this:
shimmerFrameLayout.setShimmer( new Shimmer.AlphaHighlightBuilder() .setBaseAlpha(1) .setIntensity(0) .build()); shimmerFrameLayout.stopShimmer(); shimmerFrameLayout.clearAnimation();
But it's pretty ugly
Nice workaround, also using setShimmer(null)
much cleaner~
from shimmer-android.
Do you need to have the image inside of the ShimmerFrameLayout
? Could you instead just hide the ShimmerFrameLayout
when you're done loading your image?
from shimmer-android.
Typically you have a "dummy" view inside of ShimmerFrameLayout
that takes the form of the content you expect to be shown. When your content is ready you remove the ShimmerFrameLayout
+ the "dummy" view and show your loaded content.
from shimmer-android.
Interesting, I can give that a shot. I think this would be a nice enhancement to the API though. I'm using Picasso to load an image into my image view so it shimmers while the call is being made over the placeholder image. Then when the callback is either successful or a failure I clear the shimmer and show the image or the error image.
from shimmer-android.
This used to be the case in 0.1.0 where calling stopShimmerAnimation() would remove the overlay completely. This was useful when there is content already on the screen which is being "reloaded", or the user performs an action that requires additional loading. In cases like this I don't want to replace preexisting content with a dummy view.
from shimmer-android.
from shimmer-android.
@xiphirx any word on release with this change?
from shimmer-android.
0.4.0 was just pushed to sonatype.
from shimmer-android.
Old issue, but what if you want to remove the shimmer and then show it later, e.g. refreshing a page? Does setShimmer(null)
mean you will have to rebuild the Shimmer
instance from scratch?
from shimmer-android.
You can use the new show/hide methods 97ca4d1
from shimmer-android.
@xiphirx Can you cut a new release?
from shimmer-android.
https://github.com/facebook/shimmer-android/releases/tag/0.5.0
Give it a few minutes to propagate to maven central
from shimmer-android.
When I am using shimmer.stopShimmer(); my app is force stoped.
shimmer is working in loop on my project.
How can i stop it.
from shimmer-android.
what happens to shimmer when onDestroy() is called after starting the animation? deos it destroy itself or does it need to be handled manually
from shimmer-android.
You can use the new show/hide methods 97ca4d1
thank you so much ! it helped.
from shimmer-android.
Shouldn't the
ShimmerFrameLayout
contain the views? Or are you thinking of usingRelativeLayout
orFrameLayout
parent view group that holds the shimmer and the image view and overlays them?I was also able to achieve clearing by doing this:
shimmerFrameLayout.setShimmer( new Shimmer.AlphaHighlightBuilder() .setBaseAlpha(1) .setIntensity(0) .build()); shimmerFrameLayout.stopShimmer(); shimmerFrameLayout.clearAnimation();
But it's pretty ugly
where we use this code and what we write inside .placeholder in glide library
from shimmer-android.
Related Issues (20)
- Animation is not working in the dark mode HOT 5
- What is BUCK file for?
- ❓ ❓ ❓ How to show shining or glare/mirror/shimmer/shine effect on a view ❓ ❓ ❓ HOT 1
- Stop shimmer is not working Facebook shimmer HOT 1
- Shimmer layout crashing illegal state exception Unable create shimmer layout
- Change Facebook Icon to Meta Icon ?
- When is the release of the new version (0.6.0) of the library expected?
- TramondeaPlease don't delete the code style settings.
- Does facebook-Shimmer include log4j internally?
- Android resource linking failed
- use recycled bitmap error HOT 2
- Support for passing default style by theme attribute
- ShimmerDrawable not working with View.LAYER_TYPE_HARDWARE HOT 1
- Release 0.6.0 version HOT 3
- Asynchronous animation for items in a RecyclerView
- How to create shimmer effect around a custom path in android
- Viewpager2: Shimmer on RecyclerViews freezes UI HOT 1
- Question - Can we ignore any child view(s) from shimmering?
- Animation status when set visibility to GONE HOT 2
- 导入不进去,啥情况 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shimmer-android.