How to fill the entire FloatingActionButton with icon - android

I am trying to create a FAB button that has a circle icon in it. I want to fill the entire button with the icon as shown in the image, but Android seems always to add space between icon and button.
Can someone please explain how to get rid of the space? I have multiple FAB buttons in my app, and I only want to do this with one of them. How can I do this by setting the attributes of the button or programmatically?

Related

How bottom toolbar will always be pushed up when keypad is used?

I want to place a toolbar at the bottom similar to the below, sample post compose, screenshot highlighted in green.
But the toolbar should be pushed up when the keypad comes up while entering text as below sample screenshot.
I can design the button toolbar, but no idea how to make it always visible when using keypad. Request to provide sample code for achieving this.
There are two modes for how Android can display the screen with the keyboard up- resize or pan. In pan, the application is scrolled up such that the cursor is assured to be on the page. In resize, the app is resized to fill the space left after the keyboard isplays.
You want resize. But that's not sufficient. Your layout for the screen needs to be such that the toolbar is fixed to the bottom of the screen and that the stuff above it is flexible in size. The best way to do this is to use a RelativeLayout or ConstraintLayout for the root, and to put the toolbar to align to the parent on its bottom. Make that top bar with the post button do the same with the top. Then have the stuff between them be fill_parent and have it layout below the top bar and above the bottom bar.
The end result of all that is that the top and bottom bars will be put in a fixed position, and the center part will be laid out inbetween. Note that this could result in some elements not appearing on screen until the keyboard is dismissed, because they won't fit. Putting the contents in a ScrollView can mitigate that problem, so the user could scroll to it.

Transition animation for Android in full screen dialog example

How do we achieve animations like the full screen example at this link:
https://material.io/components/dialogs/#full-screen-dialog
What I mean is the toolbar animations (hamburger icon to close icon, menu items), and the content expanding from right bottom to full screen. I also wonder how toolbar stays at the same place whereas content expands.
Are these custom view based animations packed together or is it somehow available to be used?

Floating action button background image not fits to the button.and background change on fab click

I am duplicating an ios app design to my android app.In ios, it contains a button similar to fab in Android.
First Issue:
I tried the fab with four options and it is ok with the options.but the fab background image not fits the fab.
Android screen :
As in the above screen i got all the options but i dont know how to make the background image fit to fab.and some shadows are coming in the fab
Second Issue
what i need is once the button clicked four options raises and the background becomes blurry.
IOS screen before fab click:
IOS screen after fab click
Hope i gave my questions clearly.Thanks in advance.

Printing text based on the position of a button

I have a SlidingDrawer menu in my app, and when the drawer is open I want the name for each button on the drawer to display as the buttons go pass it.
Do you all have any ideas to whether this is possible or not? I have been searching for about an hour and I can't find any answers.
Assuming I understood what you want correctly (adding text from the drawer on top of buttons on the main layout) you can try this. I don't know how accurate it would be:
Place the sliding drawer as the topmost element in your layout with a transparent background.
Use exactly the same layout you're using for your "main" layout (where the buttons are) and use a textView where your buttons are.
When your sliding drawer opens, the text from its content will appear on top of the button

trash layout like launcher android? is it possible?

is possible implement trash layout like launcher android?
In my app, move icon from layout and I would remove it in this layout like "disappearance".
For example press and hold icon I want to remove. then drag it into the layout "trashcan", after this layout disappears.
thanks

Categories

Resources