Closed Jejid closed 5 years ago
Use CENTER_CROP
probably?
Done but, not good.
FIT_CENTER and CENTER_INSIDE work very fine with drawables but downloaded images with (view.setImageUrl(urlImg);) dont
see flipper code:
for ( int i =0;i <establecimientos.size();i++){ FlipperView view = new FlipperView(getActivity()); String urlImg = establecimientos.get(i).getImagen(); view.setImageUrl(urlImg); view.setImageScaleType(ImageView.ScaleType.FIT_CENTER); view.setDescriptionBackgroundAlpha(0.2f); final Establecimiento establecimientoClicked = establecimientos.get(i); view.setOnFlipperClickListener(new FlipperView.OnFlipperClickListener() { @Override public void onFlipperClick(FlipperView flipperView) { Intent intent = new Intent(getActivity(),EstablecimientoActivity.class); intent.putExtra("Establecimiento a Abrir", establecimientoClicked); intent.putExtra("vista", 1); if(!internet)intent.putExtra("banner", BannerSecondShot); else intent.putExtra("banner", bannerOneShot); startActivity(intent); } }); flipper.setScrollTimeInSec(4); flipper.addFlipperView(view);
with CENTER_CROP
Actually, it all depends upon the resolution of the image used.
FIT_CENTER
or CENTER_INSIDE
, you'll now see that even this drawable image will have the same problem. The problem is because of the image size and resolution you'll have to think of a workaround for the same
Many thanks, ill try fix it changing size of images but when i load the image directly from the drawable its works fine.
see
Hi Sir, me again. Thanks for support with your library
Scaling image in the flipper is failing CENTER_INSIDE and FIT_CENTER, it doesnt work correectly when you download a image from a url, flipper dont center images. With drawable works fine
see Screenshots of organization inside fliper. Flipper just move up the images
Version of the library used 'com.github.therealshabi:AutoImageFlipper:1.5.6'
Thanks for attention