Collapsing Toolbar Enter with Scroll Inertia - android

I have a collapsing toolbar with scroll|exitUntilCollapsed set as scroll flags. I like this behaviour overall, however I dislike how it re-expands when I reach the top of the page. If I hit the top and keep scrolling, it expands, which I want, however if I scroll quickly and let the scroll inertia carry it to the top, the toolbar doesn't expand (and the top padding leaves an ugly blank area). I feel like this is how I've seen most apps behave out in the wild, so I'm worried that the answer will be "not possible without some weird hacks", but am I missing something simple to fix this issue?

Related

Scrolling / sticky FAB floating action button android

I need to add a FAB to a scrolling page, however, I need, at a specific point on the screen, to have the FAB continue and scroll up with it, as it is not related to the content at the bottom of the page.
I'm thinking it will kind of work in reverse of a sticky view, which keeps scrolling until it hits the top, then stays there, this will stay at the bottom until a certain point in which it will scroll upwards and off screen.
I can't find this googling, and am thinking I'm going to have to somehow reverse one of the many sticky libraries out there, but they're pretty daunting for someone with limited custom view experience.
Looks like your effect is against Google's guidelines:
the floating action button should not exit the screen in the same
direction as the screen exits ... it incorrectly implies that the
floating action button is at the same the z-level as the content,
rather than at the level of the primary UI elements at the root level.

Get rid of gap when hiding the toolbar and swiping to get to a new tab

I would like to copy the behavior of the Google play store where they automatically scroll content up when the tab bars are hidden, see example.
I hide the bars by overriding the onScrollChanged within a RecyclerView, something like this:
headerTranslationY = Math.min(0, Math.max(-toolbarHeight, currentTranslation + justScrolled));
mHeaderView.setTranslationY(headerTranslationY);
If I swipe down and move to the next tab (either by swiping or clicking) the content of the second tab has a gap since it didn't know that it should move up along with the first tab. Example is shown here. Google play on the other hand seems to get this perfect and I am not sure how, example.
I have tried calling mRecyclerView.scrollTo(x,y) or mRecyclerView.smoothScrollTo(x,y) within ViewPager.SimpleOnPageChangeListener, but this has a very ugly effect with lists constantly moving around.
How can I get rid of this padding to make it like google play?

scroll layout with windowSoftInputMode=“adjustPan”

I have some EditTexts(about 6-8) in one activity, so I have to use Scroll layout.
But I find that scroll layout doesn't work well with windowSoftInputMode=“adjustPan”. And there's a flash at the inputmethod's area when inputmethod hides.
How would I scroll layout with windowSoftInputMode=“adjustPan”?
I changed windowSoftInputMode=“adjustPan” to windowSoftInputMode=“adjustResize”, but when I press the "back" button to hide inputmethod, it works very slowly and the inputmethod's background does not fit my app's theme.
Any ideas why might be wrong?

Scrolling hide effect like on Firefox and Chrome

Background
on Firefox and Chrome apps for Android, if the user scrolls down, the upper actionBar starts to disappear.
if the scrolling is fast enough , it starts an animation to finish the disappearing, but if not, it returns to its normal state.
and there is a similar effect for showing the action bar, only that it's for scrolling up.
The problem
I need to have the same ability to make a customized view that is on the top of the screen (looks a bit like an action bar but it's not).
a part of the view will always be visible, but a part of it will shrink like in the effect of chrome and firefox.
I've looked for libraries that allow such a thing but without any luck.
The question
How can I achieve this behavior?
My guess is that I need to use the scrolling listener of the adapterView , but then what?
I think this library can help, in the inner sample of "animation" :
https://github.com/LarsWerkman/QuickReturnListView
sadly i also use a customized pinterest-like listView, which doesn't report about scrolling (not states, but the real positions as you scroll). in fact it doesn't even extend from AdapterView.

Android: how to get rid of scrollView's "fading edge"

I'm having a problem with a text view embedded in a ScrollView. That is, when I scroll the text a thin orange line briefly appears to show that I've gone as far as a can in a particular direction. I've tried a couple of things like "android:fadingEdge="none" and setting the background color, but it's just staying there.
How do I get rid of or control these "end of scroll" colors?
What you're seeing isn't the "fading edge" normally shown while you're scrolled into content, it's the "over-scroll" effect in Gingerbread and newer. From your XML you can set android:overScrollMode to "always", "never", or "ifContentScrolls".
"always" and "never" should be self-explanatory, "ifContentScrolls" will only show the effect if the content does not fully fit within the view without scrolling.

Categories

Resources