Link scrollers in Android - android

What is the best way to make scrollviews move dependent of each other?
I have three scrollers (ScrollView/HorizontalScrollView), on vertical on the left and one horizontal on te top - e.g. like excel - where moving the left or center scroller should affect vertical scrolling in both and moving top or center should affect horizontal scrolling in both.
What is the best way to implement this?

Related

Android layout with vertical adjustment between 2 inner containers

I would like to know what kind of layout is this? top image part (A) is pinch zoom (so I guess ImageView with something like photoView implemented), bottom part (C) is vertical scroll (so this would be RecyclerView), but middle part (B) dragger can be dragged up and down, thus enlarging the portion of one container (A or C) / reducing the portion of another, depending where is dragged.

How to change the scroll angle of scrollView in android?

Is there any way to change the scrolling angle of the ScrollView or RecyclerView in android?
I know, by default some Android views will have horizontal and Vertical scrollings, but I want to know if it is possible to change the scroll in a particular angle or else diagonally?
How to create such custom components?
Here is an example with screenshots, I wonder how Microsoft Excel Android App achieved this.
Place your finger on the cell D10 and drag the sheet towards the cell A1
Here is the result, the sheet scrolled diagonally, i.e., scrolled vertically and horizontally simultaneously

Android: Fingerpaint with a constantly visible scrollbar

Problem statement: I would like the canvas to have the same size in both horizontal and vertical orientation. The size should be fixed and based on the vertical orientation (an A4-like canvas). Hence, I need the ability to scroll over the canvas in the horizontal orientation. But there is a conflict between the touch event used for scrolling in a ScrollView and the one used for drawing in the canvas.
What I need: I guess most could settle with this solution: fingerpaint within a horizontalscrollview and simply adding a button for allowing the user to scroll. For me this is a little counter-intuitive. What I would like is to have a thick scrollbar constantly visible on the side of the canvas, like in this app:
Following, this should also be the only way that the user can scroll.
What I have tried: Since the scrollview consumes all the touch events, I have tried overriding the scrollview's onTouch method. But this leads to the whole scrollview being unable to be touched - that includes the scrollbar.
Questions: Is it not possible to implement this with a ScrollView? Do I have to create my own scrollbar widget and align it horizontally (LinearLayout) with the view that contains the canvas? Or is there some way to have the ScrollView only consume touches on the background?
In onTouch override, you can check the coordinates and decide whether the touch was on the scroll thumb or on rest of the view.

Endless horizontally scrolling view to draw content dynamically

I want to create the following view / set of views which behave following way:
I have huge set of points which have been stored to DB in web server.
My client application downloads those and should draw curved lines about the data.
What components should I use here to get this "infinite" scrolling view to draw content dynamically.
No snapping wanted, so it should be smooth and can stop to every X position.
Should I proceed with this by using HorizontalScrollView with horizontal LinearLayout and remove/add views based on scrolling, then translate the scrolling position and provide fling that the scrolling doesn't stop suddenly.
Or is just one canvas possible to use and draw the content to simulate the scrolling?
Maybe a horizontally scrolling ListView component?
The solution should be efficient and use minimum of memory.
Which solution do you recommend, or do you have some new ideas other than above?
All suggestions are highly appreciated. Thanks.
There is several possibilities:
Create custom View class and implement GestureDetector there. You can get movement of finger, calculate currently visible area and draw only visible part of content.
May be this solution is not the easiest to implement, but it will be fast and does not require any resources.

Custom component within scrollview

I have a custom component that is vertically longer than the screen height and I'm trying to make it scroll. In my onDraw method, I'm drawing the shapes unto a fixed coordinates, and it seems that the content doesn't change even when I scroll. Do I need to draw the shapes unto a different coordinates based on the scrolled position? If so, how do I retrieve the current scroll position?
If you don't want to handle any scrolling from your end, then add your customView to ScrollView. If you want to handle the scroll from your end then you can refer to thebelow link which is for 2Dscroll which handles both Horizontal and Vertical Scrolls.
Android Two-Dimensional ScrollView

Categories

Resources