carousel-layout-android library first load issue - android

I am using "https://code.google.com/p/carousel-layout-android/" in my android application. When it load first time images in carousel are of different sizes, when I scroll all the images till last item, then its images size becomes ok, like center image is big in size and left and right image is bit small in size.

Related

Creating a Facebook-like image upload interface on Android

I'm trying to replicate the functionality of Facebook's image upload. To briefly describe it you click the Photo button from the main screen of the app you are taken to an image picker that will let you select up to 30 images. Once selected the images load in some kind of list view that allows you to add a caption, remove the image from the list, or do some other Facebook-y things. If you scroll around the list can move very quickly, and if you only have 5-10 images you generally spend little to no time waiting for items to reload.
Right now I have a recycler view and am using Picasso to load the images from disk, resize them, and then display them. This works, but it's not smooth or fast. Even if I only have five or six images loaded they don't come up instantly if I scroll from the bottom back to the top. I have tried increasing the LRU Cache size in Picasso, but that didn't do anything at all. It seems like the scaled image isn't getting cached so it has to be scaled to fit the screen width every time. That's just my guess though.
Any suggestions on how to get this to run more smoothly?

Imageview looks like mapview

I have a image (resolution 8328x3987). And I want to load that image in my app with zoom controls for better viewing.
As we all know that Android will not load large images directly on device (like in my example). So Android system suggested us to scale down the image to load large images. I have tried this and scale my image upto four times as:
options.inSampleSize = 4;
Using this way my image will displayed on screen, but when I zoom-in the image then this image becomes unreadable (text becomes very blurry), this is because, maybe I scale down the image before showing?
But when I see that image in to device's default gallery app (Android Lollipop, Photos app), then this image looks like a mapview (only visible portion is readable and outside is blurry, and when I move the image then visible area becomes readable) when I zoomed in at max level. So my questions is:
Is Android lollipop added any new way to load large files that looks like mapview?
If not, then do you have an idea how that apps do this or any example?
Reducing the sample size of an image that big will not work at all.(very very bad resolution and memory consumption)
I suggest you to divide image to tiles and recycle the views just like map views do.
This library may help you. Or you can do it your way too.

Android : Assigning a high resolution image to a smaller ImageView

I have this unanswered question of mine pertaining to images. I have an image of about 1 MB and I am assigning the images to an image view with width and height of 100dp and 80dp respectively. But when I assign the image to about 5 image views, the application crashes with Out of Memory Error
So, when I assign the 1 MB image to such a small image view, what happens? Doesn't android scale it down? Also, did the app crash because it couldn't take the load of 5MB in memory??
EDIT
I have 5 ImageViews on the screen. I am assigning the image to all if them this way
myImageView.setImageURI(item.getImageUri());
Android loads the whole image file to the memory and then scales it down. In order to avoid OOM you should load large bitmaps efficiently.

Android Gallery Loading a lot of images from local makes scroll not smooth

I am using the android Gallery widget loading images from Bitmap[] succesfully, but it seemms the scroll is not very smooth. Initial conditions:
Image resources comes from a local array of Bitmap (previously full filled)
If i load only three images, it seems going smoother
The size of each individual item is light weighted Bitmap (less than 30KB)
The dimensions of each individual item is like 200x350 px
What could i do to optimize it ?
Thx in advance!!

Android ListView image resize

I have a lazy-loading ListView populated with images gotten over the network. The list rows are set to wrap_content, so once the image loads it resizes and the full scale image will be displayed. It looks great when scrolling down, but when scrolling up the rows resize and force the bottom rows off the screen. How can I prevent this jumpy scrolling while scrolling up?
----- EDIT:
The images are comics of varying sizes. Some are 2 or 3 frames where they aren't very tall. Others are single frame comics where they are much taller. The image needs to take up the full width and the height should not cut off any of the comic.
Assuming all images downloaded are expected to be around the same size, a good solution most developers use is to use a "dummy" image until the real image is loaded. This image will exist locally so it can be loaded almost instantaneously. In the getView method, show this dummy image until the real image is downloaded, and then simply replace it. This will prevent your rows from resizing.
you have to see this link It downloads images in the background thread. Images are being cached on SD card and in memory, It decode images with inSampleSize to reduce memory consumption and also try to handle recycled views correctly. Play a fake image when image are not completely downloaded. "sorry fo the music!!"
I figured out the solution. When I receive the image, I get the width from the parent then set the height of the image view to parentWidth * bitmapHeight / bitmapWidth. That way the resizing occurs as the row's view is created and the list doesn't jump around as much once I know the size of the bitmap.

Categories

Resources