Scroll an Image horizontal and vertical - android

I know this question has been asked before, but I couldn't get an answer for my issue. I have a large image, and I would like to display it with it's full sizes (in fact its a custom map image). I know that the image can be scrolled by swiping the finger, but my question is if there is a way to implement a vertical / horizontal scrollview for this. I would like to be able to use the scrollview features (swiping the finger an the image is scrolling by itself).
Using a HorizontalScrollView inside a ScrollView didn't work either. The horizontal scroll bar appears only sometimes, and there is no way you can scroll in both directions.
Any help is appreciated.
Thanls a lot,
Gratzi

I've just answerd that question here Images in ScrollView in android
However it does not do scrolling by itself, that would need more programming.

Related

Android horizontal scroll and horizontal flip

I have a webview, in which I load images.
When I zoom in, I want users to scroll to view the rest of the contents. But when I scroll horizontally, horizontal flip is getting triggered.
Is there anyway to stop this?
This blog is very usefull in the matter: Preserving screen state in WebView. It works even for JavaScript variables etc..

large, long images scrolling across screen at different speeds, and off of the left of the screen

So I have multiple very long images (like 2000x100) that i want to have scrolling across the screen at different speeds. and my original solution is not working out. Originally, I placed them all in a HorizontalScrollView, and made a runnable that used setPadding to adjust the position of the ImageViews within the scrollView. This works, however, the background that is supposed to remain mostly stationary on the screen, shakes back and forth as you scroll, and lags behind the scroll location significantly. It's choppy and it looks bad.
Is there any other way that I can move images across the screen to achieve the desired effect?
(could I perhaps use a frame layout, and set an ontouchlistener? then how would you move the layout across the screen?)
I set up a layout so that the images protrude off of the right of the screen correctly, but I can't seem to move them off of the left of the screen (setpadding(-50,0,0,0) does not work)
Thanks in advance!
I solved this by using relative layouts within a frame layout. I set an ontouchlistener for the frame layout and used the scrollTo method for each image with a modifying coefficient. I had not previously noticed the scrollTo and scrollBy methods of the layout.

Android fading edge disappears

I've got a pretty weird issue and can't find a solution. These two pictures show my problem:
In the first picture you can see, that there is no fading edge. If I move the bottom gallery a little bit further, the upper small gallery switches its position (I implemented this behaviour) and now there is a fading edge on both galleries.
The issue comes from the small gallery. But I don't understand why it is affecting the fading edge of the bigger gallery. The same effect appears on the right sight.
Both galleries are nested in a linear layout, which is nested again in a linear layout. I never touch the values for the fading edge.
Does somebody have an idea how to fix the issue?
It seems the fading is added automatically and disabling through XML doesn't work.
However disabling programatically seems to work:
Gallery carousel = (Gallery)findViewById(R.id.image_carousel);
carousel.setHorizontalFadingEdgeEnabled(false);

Dashboard pattern: HorizontalScrollView with pagination or ScrollView?

I am starting a new application and I am willing to use the Dashboard pattern.
For example: The Google IO app uses it:
My issue is that the amount of buttons will be more than six.
I'm not sure if I should use vertical or horizontal scrolling.
Vertical scrolling could be done with a ScrollView or a GridView but I am not sure which would be the easier way to implement the horizontal version.
I was thinking of using an HorizontalScrollView but it doesn't have pagination. It should feel similar to the tweetdeck app.
How would you implement it?
My issue is that the amount of buttons will be more than six. I'm not sure if I should use vertical or horizontal scrolling.
IMHO, do neither. Reduce the number of buttons. Watch the 2010 Google I|O presentation on this design pattern -- the point behind the dashboard is to only surface a few items.
I would go with a vertical scroll. It is way more natural to scroll down to view more content of the same view.
A horizontal scroll kind of feels like you switch to another part of the application.
I have an app that uses a gridview with vertical scrolling but I dynamically adjust the number of rows in the gridview based on the width of the actual screen so that it in landscape or in a bigger display it uses more columns and avoid scrolling alltogether in most cases.
However in my case it is more of a search results display of categories and not a dashboard. I believe the whole point of a dashboard is to have only a small number of button (e.g. max six or so).
What you could do is dynamically interrogate the screen real estate and if there is not enough room just show e.g. 6 buttons of which one is a more/utils or whatever button. Sort of like the options menu does it.. but on a bigger screen display them all.
It would be interesting to scroll based on the orientation of the device, so you would scroll horizontally or vertically if the device is oriented that way. This would let you maximize the screen real estate.

HorizontalScrollView - need to scroll by width of the images

I have a HorizontalScrollView that consists of Images (Icons). I need to scroll the view in "blocks" the width of the icons, so as to never have a "piece" of the icon on the screen. I need more, but this question will give me all the other answers I need.
Does anyone have a code example to point me to for this?
Thank You in advance.
JS
You can either use a Gallery or create your own custom View that does this (maybe extend HorizontalScrollView).
I accomplished this in two parts.
I dynamically add the buttons from resource files and account for spacing on the left, right, and between.
I modified HorizontalScrollView to simply scroll to one of X positions (whichever is closer to the currently stopped position).
Again, thanks for reading.
JS

Categories

Resources