Android - Floating action button on top of Dialog Fragment - android

I've got a Floating Action Button and when I click on it I open a DialogFragment.
When the dialog is opened, the button is below the dialog. My question is, how do I position the button after the onclick event on top of the DialogFragment?

Well, I would do this trick : use Fragment and adjust it to look like dialog( you even can use dialog fragment theme ). Then use the same FAB on fragment layout ( Even better you can make transition view for fab. something like zoom out/in )... Here is the complete example uploaded on Github for you :-)
https://github.com/mabuthraa/Android-FabOverDialog
I will try later to improve that example by using Fragment theme and transition.
Good luck,'.

Related

Issue with dialog box using AppCompatActivity

When I switch from Activity to AppCompatActivity in Android development, the dialog box seems to have a UI issue.
Here's how the dialog buttons look like using Activity:
Here's how the dialog buttons look like using AppCompatActivity:
Crop Photo is the Positive button, Full Photo is the neutral button, and the cancel buttons looks out of place. Can this be fixed or do I overlook anything?
I have also tried using import android.support.v7.app.AlertDialog or the default android AlertDialog, both result is the same.
This is how material design works. The affirmative action (the positive button) is always placed on the right, then on the left of it is the dismissive action.
Technically the guideline says that "Dialogs should not include more than two actions.", but it is fine if it doesn't leave the dialog in an indeterminate state. However, you may want to create your own dialog layout with a list instead of relying simply on the action buttons if you think the look-and-feel is bad.

How to display fragment in android with background grayed out?

When a RelativeLayout in an activity is clicked, it should open a fragment that shows a few checkboxes. The fragment should be in the center of the screen but should not cover the whole screen. The original contents activity should appear in the background but it should be grayed out. When I click 'OK' button in the fragment, the fragment should disappear and the original contents of the activity should appear normal (without graying out). I've tried writing a lot of code but what I get is completely different from what I have in mind. How can I achieve this functionality?
you should use DialogFragment , see this thread: https://developer.android.com/reference/android/app/DialogFragment.html

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.

Android custom layout animation

all
I have a tabbar in my Android app like pic
now I want to add a layout on the back of my tab bar like pic
and when I click the press button the layout appear with a flip animation to the top like pic
Help
u can use frame layout in tab with bottom gravity. and on click you can adjust its size.
You can use SlidingDrawer which already includes android sdk.
Here is simple tutorial : link.
You should have to create One Layout let say pressLayout which contain that Press Button.
initially that layout is invisible. Now while you press on Tab or any other button, that Layout will show with the translate(or Scroll) animation from Bottom to Top.
Now while you click on Press Button. Set another animation on the Layout/view you want to effect.
Hope you got the point. For Translate Animation, you can see this: translate Animation
Enjoy coding...

Android Slide in a Button

I am working on a Menu that slides in from right to left. The sliding menu is done, also a Button that triggers the Slidein/out.
Now i want to animate the Button too. Currently i let it move by setting Margin, but thats ugly because its jumping like hell... Is there any simple way to attach the Button to the Menu? Or any simple way to animate it?
The Menu is a LinearView in a RelativeView. The RelativeView contains the Button.
best way to do that is to use nineoldandroids library. here is the link and you can see in usage section how you can do it.

Categories

Resources