AndroidImageSlider
AndroidImageSlider copied to clipboard
slider height , Can't set to wrap_content
Hi, How can I set the Slider's height to wrap_content instead of specific height ?
I have the same problem. It makes the whole library unusable!
i fix it with
` Picasso.get().load(imageUrl)).into(new Target() { @Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
int width = bitmap.getWidth();
int height = bitmap.getHeight();
int tempWidth = (int) (width / Resources.getSystem().getDisplayMetrics()
.density);
int sliderHeight = (int) (height / Resources.getSystem().getDisplayMetrics()
.density) * slider.getWidth() / tempWidth;
;
slider.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams
.MATCH_PARENT, sliderHeight));
}
@Override
public void onBitmapFailed(Exception e, Drawable errorDrawable) {
}
@Override
public void onPrepareLoad(Drawable placeHolderDrawable) {
}
});`