Floating Action Bar (not button) in Android - android

I am working on Floating Action Bar on top of keyboard if user clicks on one of the EditText. I couldn't start on it and that's why not have any code to present.
I am confused on how to approach this problem. I am considering to use bottom sheet but I am still not getting confidence on it (I think android should have something better to use as base for this view).
I don't need any code snippet but need a direction. I am new to Android and before jumping to implementation, I needed a direction to start with.
Any suggestions? I am implementing
something similar to Outlook app.

So this floating toolbar is just a view that contains icons to press. This view should be located as the bottommost view on the screen. If you're using a ConstraintLayout use app:layout_constraintBottom_toBottomOf="parent".
And the android:windowSoftInputMode for hosting activity can be set to adjustResize (doc).
So when the keyboard opens it pushes this bottommost view up (and now this view is right above the keyboard).

Related

Overlay layout that go over Navigation Bar Android 7+

I'm trying to do an Accessibility Service where the purpose it's to create some "layer" between the user when he touches the screen and the tap.
For example : when I touch the screen I when to double tap at this precise position I touch the Screen.
I think, but I'm really open to suggestion, that I will have to create an invisible layout that will cover all the screen where a would be able to activate an onTouchListener to get the position and use my accessibility service to create gesture and transfer the touch behind the layout to click anywhere.
As far I only found a solution for Android 4.1 or less.
I also want to use a kind of cursor, the app Open Sesame do it well and the cursor can go over the navigation bar and interact with.
I also found the open source project Eva facial mouse but they don't perform complex gesture and don't go over the navigation bar.
So my big question is, I am in the right way by wanting to create an invisible layout to detect touch even on the navigation bar and is there someone would help me to enlighten my search in the right direction.
I succeed in putting an overlay layout over the status bar, just add the right Flags to your LayoutParams.
For my case I use: FLAG_FULLSCREEN, FLAG_LAYOUT_IN_SCREEN and FLAG_LAYOUT_NO_LIMITS.

Is it possible to use adjustPan and keep the selection action mode on screen?

I have an EditText element at the bottom of the screen (like Whatsapp i.e), and I'm using android:windowSoftInputMode="adjustPan" in order not to hide the EditText when the keyboard appears. It works fine, it pushes the whole layout up so that the EditText can be seen.
Now, the problem is that when I select the text, the action mode bar doesn't appear, as if it was pushed up along with the layout.
I'm not using an explicit action bar in my layout, it's the one that appears on pre M devices when a text selection is made.
The layout hierarchy goes like this:
<FrameLayout>
<GLSurfaceView/>
<EditText/>
</FrameLayout>
So all I want to do is this action mode to keep it's position even when the keyboard is opened, using the pan behaviour.
adjustResize doesn't work for me. When set, the keyboard is over the EditText, and nothing resizes, probably due to GLSurfaceView.
Thanks!

Force Floating Action Button to be on top of Keyboard

I use the Android Studio Navigation Drawer Project with one MainActivity and multiple Fragments which are replacing the container inside my MainActivity.
Sometimes when I open my software keyboard the Floating action button appears above the keyboard and sometimes the keyboard covers the fab. Does somebody know why?
It seems that somehow/sometimes your layout is not correctly changed. You should try to use android:windowSoftInputMode="adjustResize" in your activity tag in the manifest.
That should resize the content to the size above the keyboard and therefore the FAB should be always above.
From a UX point of view: Maybe you change the "submit" functionality and move it from a FAB to the toolbar (like the gmail app does). So FAB for a "new" or "add" functionality and as soon as the user can provide input, you show a "send"/"submit" button in the toolbar.

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.

Keyboard layout hiding android action bar?

In my Android application running in a XOOM device, when I click in an Edittext the keyboard opens and hides the Actionbar. I don't want this to happen, how can I solve this? This is done by the Google Contacts app for the tablet for example.
EDIT:
I have several edittexts in which the user needs fo fill. At first, when the user clicked on one edittext on the bottom, the keyboard showed up and hide the edittext in which the user was typing, so he couldn't see what he was typing. I found it really bad, and to solve it I just added to the manifest: android:windowSoftInputMode="stateVisible|adjustPan"
But after that, now the screen adjust itselfs and hides the action bar.
The Google Contacts app does the same, but it magically doesn't hide the Action bar. How do they do it?
Use adjustResize instead of adjustPan. The framework will always try to keep the focused element on-screen by scrolling any parent views if necessary.
If your EditText field is not nested in some sort of scrolling container such as a ScrollView then your layout may be too tall to completely display when the keyboard resizes your activity. Try wrapping your form's layout in a ScrollView. This will also allow your app's content to scroll if it is running on a smaller screen device where it may have similar issues.

Categories

Resources