Layout with scrollview: how to reach the bottom as fast as possible? - android

I have a minor problem which i can't solve.
I have a layout with scrollview embedding a lot of views.
Everything work fine with the android studio preview in design mode but when i want to access to a view at the bottom, i have to scroll the mouse wheel very long time in order to reach the bottom of the layout. So it works but as soon as i make a change of the view located at the bottom i have to scroll the mouse wheel very very long time so:
Is there a shortcut to go to the bottom of the layout or something else?
Even if i click on the view in the component tree window beside the preview, it selects the view but doesn't displays it.
Thank you.

Related

Make a horizontal scrollview clickable at a specific spot?

I'm developing an App on Android Studio and I want to have an easter egg. To do this easter egg, I want people to click on the moon to unlock a new avatar.
The problem:
As you can see in the image, the background image is a whole horizontal scrollview and I can't make only a certain part of the horizontal view clickable. This leaderboard page shows up as it is shown on the schema 1 so if you move your finger in the arrow direction, you'll end up on the schema 2, because you've scrolled all the way to the left of the image.
What i've tried:
I tried do put the ImageButton inside de image scrollview, I tried to put the ImageButton inside the scrollview after and before the background image, I tried to put it outside the scrollview, after and before also, I tried to put a scrollview inside the existing scrollview, again, after and before the image.
My question:
How can I make it so that only the moon on the whole scrollview is clickable? Or is there a away to go around this problem and do this by other means? All help is acceptable, thanks!

Coverflow android for 3 view at a time

I have to show image carousel in android like -
In this library or other libraries,what i have found the adjacent view visible partially and rest part covered behind the screen but in my case all part of adjacent view would be covered from center view and partially visible its left/right part.
Using FeatureCoverFlow i partially created this kind of view but apart from left and right view it showing stack of views like -
and sometime it also gives out of memory issue after scrolling.
I have tried
FeatureCoverFlow,FancyCoverFlow and and few others but nothing worked for me.
CarouselLayoutManagerLibrary has done the work for me.

Sliding Android window (two rates)

I don't know how to describe this very well but I see it in a lot of apps such as Transit.
There is a main window and then a view below it such that when you scroll down, the top window slides up at a slower rate within its own view while the bottom view scrolls up at the same rate the user drags.
Is there a name for this technique?
I believe the effect you are talking about is of Coordinator Layout. You need to implement Coordinator Layout and define view that you want to scroll upward.
One of the example that you can use to learn is Mastering the Coordinator Layout.
Hope this helps. :)

Android WhatsApp style floating header view

If you are familiar with WhatsApp, when you start scrolling, a view with the message's date slides down from the top of the screen. I'm trying to achieve something like that, my view is the top most view with decreased alpha and blue background, just below the ActionBar.
I did not use a ListView, below the ActionBar I have a ScrollView, and inside that ScrollView I have a LinearLayout.
I add my messages to this LinearLayout.
I could not figure a way out how to know if the date changed and need to refresh my header view.
I tried to get their positions on the screen with the
activityRootView.getViewTreeObserver().addOnScrollChangedListener() but this doesn't get triggered if you scroll fast.
Setting an onTouchListener to the ScrollView didn't work either, as the scroll may continue after I release the touch event.
It's been a long week and I'm out of ideas.
I'm open to any suggestions, thank you.
You can look at the Standout Library , you can handle floating windows with it.
You can also create a semi transparent activity / dialog.

Android - keeping a single element contained on screen

I'm experimenting to see if the layout scheme I want to use is possible. I want to have an XML layout that's scrollable. Within that scrollable layout, I want to have a single line going horizontally across the screen (I used just a View with a fixed height and different color). When that horizontal line reaches the top of the screen, and as I scroll down through the layout, I want it to stop and remain at the top of the screen while being able to scroll through everything below it.
I've been messing around in XML trying to get it to work, basically putting a bunch of junk before it and after it.
Any ideas as to how that might work? Would I have to do something fancy with the java code to fix the red line at the top when the scroll position reaches a certain point? Your help would be greatly appreciated.
I am assuming you want something like Gmail app where when you scroll a mail the header sticks on top... To do this, you need 2 views. You have your regular scroller below and overlay a fixed view on top (you can use a relative layout to do this). When your cell goes past a certain spot, you want to populate and set the visibility of the fixed view to VISIBLE. This would give the impression that the view you want to 'stick' to the top really just got stuck rather than scrolled out of view. You'll have to work out the opposite scrolling scenario too based on the location and height of the scrolled cell/view.
HTH

Categories

Resources