Scrolling hide effect like on Firefox and Chrome - android

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.

Related

Sliding menu: closed, half-opened and opened

in an android application, I need to do the following:
I have a view, that acts like a menu, I can slide it from the bottom-up.
However I want to have 3 states: closed, half-opened and opened.
Please refer to this pic:
The blue section is the Handle, the user will use it to slide up/down or fling...
This is a bit similar to the android 5 notification bar, where you drag down to reveal half the view, then another drag down will reveal the whole view.
I can start implementing it in the onTouch of the blue section but that would require me to handle a lot of cases, especially the ones where the user flings vs slowly drag....
Is there any easier way or library that can help?
Thank you very much

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.

Clicking a textview in a Webview causes screen to jump and Webview scroll to become infinite

I am writing an app with the Salesforce Android SDK.
We have a custom website that is used for the login landing page that has a username and password field.
Clicking on the first field brings focus and keyboard as expected. Clicking on the second field (regardless of which is clicked first) causes the screen to jump up and down for half a second and then leaves the screen so that you can scroll infinitely, even beyond the background image. No matter how far you scroll the scrollbar is stuck at the top. However to scroll back up you have to scroll the same distance you scrolled down.
While this is from the LoginActivity from the Salesforce SDK, I have modified the file to show the action bar at the top.
What is causing this behavior and how can I make it stop, changing zoom controls in the webviews settings does not seem to help.
The same screen in iOS does not seem to have this same behavior.
Worth noting, the defect does not appear in the devices chrome browser.
The Class in Salesforce SDK
According to the Salesforce SDK
There is a ScrollView in a WebView. This shouldn't be necessary and may cause a problem such as the one you described. Changing the ScrollView to LinearLayout should fix the issue.

Android keyboard slide animation

I have little (read: no) experience with animations in Android, but wanted to implement an animation for when the keyboard appears. Effectively, it would appear that the entire activity was sliding upwards (like the keyboard was below the activity and pushed it upwards), as opposed to only moving up so far as the selected EditText.
Does anyone know how to do this?
In the latest version of Android OS (Android version 11), they added new set of APIs let you synchronize your app’s content with the IME (input method editor, aka soft keyboard) and system bars as they animate on and offscreen, making it much easier to create natural, intuitive and jank-free IME transitions.
WindowInsetsAnimation.Callback
For frame-perfect transitions, a new insets animation listener notifies apps of per-frame changes to insets while the system bars or the IME animate.
WindowInsetsAnimationController
Apps can take control of the IME and system bar transitions through the WindowInsetsAnimationController API.
An app receives no notification of when a keyboard appears, and the android framework itself is responsible for either sliding the app or laying it out again. So customization isn't really possible. Which is probably a good thing- a keyboard is a separate app, and having written one I wouldn't want to even try to write the keyboard half of such an animation, we'd never get it to look right with all the various ways the app could do it.
The closest you'll get is to specify the fields to pan rather than resize when the keyboard is opened.

Disable Android Notification Bar in Full Screen (in SGIII)

In Samsung Galaxy S3, even though my app is set to be full screen, and this makes the notification bar not to be visible, if I swipe from the very edge of the screen side, this action will make the notification bar to appear again, allowing the user to expand it over the full screen app.
Is there any way to disable this, or to cancel the expand of the notification bar?
The problem is that I have a listview covering the whole screen, and if I swipe to scroll the items, every time I do it from the very edge due to the instinctive action of scrolling faster, then the notification bar appears again.
I've tried tricks such as creating an overlay window on the edge, but not working at all for SG3.
Thanks
If you haven't tried already, you might attempt to use the View flag for hiding navigation, SYSTEM_UI_FLAG_HIDE_NAVIGATION, documented here.
However it may be important to note this found at the bottom of their description :
There is a limitation: because navigation controls are so important, the least user interaction will cause them to reappear immediately. When this happens, both this flag and SYSTEM_UI_FLAG_FULLSCREEN will be cleared automatically, so that both elements reappear at the same time.
which is probably related to what you're seeing. I find it hard to believe there's a way around this... I just tried and every fullscreen app I have on my S3 behaves this exact same way.
I suspect that if there was a way around it (assuming the above doesn't work, which I don't expect it to), it would be considered to be a bug by the Android team, and I would advise against it.

Categories

Resources