fade in effect is gone when setProgressbarImage or setRoundingParams
in 0.7.0
when I use GenericDraweeHierarchyBuilder to setProgressBarImage or setRoundingParams
the default fade in effect is gone,the image comes out directly...
If I delete setProgressBarImage and setRoundingParams, everything is normal and effect comes back
same problem also occur in older relases
We have tried the use case and everything is fine. Could you provide other details of the problem please? Are you using the Drawee in the layout document or instantiate directly in the code?
I wrote a class which extends SimpleDraweeView and in constructor method
GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources());
GenericDraweeHierarchy hierarchy = builder
.setPlaceholderImage(mProgressDrawable)
.setFadeDuration(400)
.setRoundingParams(new RoundingParams() {
@Override
public boolean getRoundAsCircle() {
return true;
}
})
.build();
setHierarchy(hierarchy);
In other files, I use this custom class to show images.
I use my custom class in XML just like SimpleDraweeView
I don't see a problem in your code using SimpleDraweeView. What do you mean by my custom class in XML just like SimpleDraweeView. Can you please share the code and provide more detail what your custom class looks like?
Sorry for late response...
My code looks like:
public class MyDrawee extends SimpleDraweeView {
public MyDrawee (Context context) {
this(context);
init();
}
public MyDrawee (Context context, AttributeSet attrs) {
this(context, attrs);
init();
}
public MyDrawee (Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
private void init() {
GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources());
GenericDraweeHierarchy h = builder
.setProgressBarImage(new MyProgressImage() )
.setFadeDuration(400)
.setRoundingParams(new RoundingParams() {
@Override
public boolean getRoundAsCircle() {
return true;
}
})
.build();
this.setHierarchy(h);
}
public void setImageUrl(String url) {
Uri uri = Uri.parse(url);
setImageURI(uri);
}
}
int XML:
<com.hello.frescotest.MyDrawee
android:id="@+id/my_image"
android:layout_width="100dp"
android:layout_height="100dp" />
int Activity:
MyDrawee img = findViewById(R.id.my_image);
img.setImageUrl("http://ichef.bbci.co.uk/news/660/cpsprodpb/17A21/production/_85310869_85310700.jpg");
There's an issue with your constructor. please check your constructor if it's typo. Also if setImageUrl, setProgressBarImage, setFadeDuration and setRoundingParams are all you need. You don't see a custom view, using SimpleDraweeView and refer to Demo app. May I ask what device & os are you using for the test app?
you are right, there is a typo in first two constructors , I used super(....) in my actual code.
all the settings are necessary for my project.
I don't want to do the same setting work everywhere, so I choose to use a custom view.
my device is Nexus 5 , Android 5.1.1
I'm cleaning up very old issues. If this still causes problems please comment and we can re-open.
As another thought, these properties can be set via XML, either in the layout file or as part of a style.