I want to know the basic difference between Flat button and Raised Button. According to the new Android material design guidelines i want to use raised button but i don't know what are they. there are forums on the web that display a button which is raised but they call it Flat.
can any one tell me the base difference between the two ? (By Look specifically)
Both Buttons are following the new Flat Design concept instead of the old Gradient Design concept.
Those concept used to give the user the feeling of this is a Clickable button not just a colored area with text or image.
Raised button
This is the Raised Button that gives you the feeling that it is relatively above the surface on part of it. Which give the user the feeling that he/she can push it down expecting a specific action. More Elegant and give better UX
Example
Flat button
This is the Flat Button. Which is only depend on change part of the surface color to give the user the feeling of this is a different place that might give you different action if you clicked on it.
Example
FAB button
This is the FAB Button. (FAB stands for Floating Action Button) Which is following the same concept of the Raised Button in Material Design, but with a floating feature. This FAB button can be used to indicate a primary action in an app.
Example
Choosing the type of button to use
Choosing a button style depends on the primacy of the button, the number of containers on screen, and the screen layout. - Material Design guidelines
According to the Material Design guidelines, you can choose which type of button to use based on these 3 factors:
Function: Is it important and ubiquitous enough to be a floating action button?
Dimension: Choose raised or flat depending on the container it will be in and how many z-space layers you have on screen. There should not be many layers of objects on the screen.
Layout: Use primarily one type of button per container. Only mix button types when you have a good reason to, such as emphasizing an important function.
Possible usages
Dialogs -> flat buttons
Inline -> flat/raised buttons
Always available -> FAB button/persistent footer button
Both have same functionality but the appearance is only the difference. It is more appealing to use raised button instead of a normal one. We can set that property in xml as android:elevation="8dp". And the button is called Fab not Flat.
Related
I'm implementing talkback descriptions in my app, and I want to know if is posible add content description in this button.
I'm searching information, but I don't know how to looking for exactly.
TalkBack should already say "Back Button" whenever you focus on the button you highlighted above.
As for changing the contentDescription to whatever you want, I don't think this is possible especially since not all devices have this button anymore -- See some of the new Pixel devices as an example.
Is there a way to set a progress indicator inside a button (preferably using the native Material Button from Material Components - Android)? There is a video on the website showing exactly what I need, but there's nothing in the documentation about it. Here is a screenshot of the same. Wanted to use it on a login button.
I also though of using a CircularProgressDrawable, which I've used before on a chip (as a chip icon), but in case of a button, I don't think there's a way to centre an icon horizontally on a button (my button width matches parent).
If anyone knows how to do this via either of the two ways, I'd be thankful.
On Samsung mobiles you can pin an application, to have it in a floating window, and can be minimized to a floating circled button / icon ... What is the best approach to accomplish this? Do I go for using Service that holds ImageView or do I go for the Floating Action Button (If it's possible to drag it around).
By any chance if there's an open source project that has this feature, could you please guide me to it.
Thank you
I have fitted my app with a NavDrawer following the Android Material Design spec.
But initially the idea I had for my App's Navigation Drawer was different, I would like to maintain that design, but I need advice with the approach.
I have uploaded an image of what I would like to achieve.
http://i.stack.imgur.com/uzRBe.jpg
The user can click on button 2 and due to the nature of button 2, only that portion of the NavDrawer will slide out, or the user can slide the drawer out manually using a finger, and the drawer slides out and snaps to the edge of the screen just like the Android notification menu that u can slide from the top of your device.
Clicking on button four will slide the entire Group of buttons (due to the nature of content on button 4), button two would remain on the right if it were already there to start with.
Button 1 which would be the home button would check that all other buttons are in place (to the left) otherwise it draws them in then loads the home content into the main view.
I am not sure which way to approach this, using the Material Spec NavDrawer, or I custom design multiple linear layouts that follow the user's Xposition gestures.
Currently, I have a Material Spec NavDrawer, so the code is standard
Better to use the default Android Drawer Actvitity that comes with Android studio 2.0 and modify it.
it will save you allot of bugs
if you still want to create a cosutm one
you can either use what was suggested here >
http://simonvt.github.io/android-menudrawer/
or you can just choose one from this site >
https://android-arsenal.com/search?q=Drawer
it has some open library drawer helpers to help you write one.
i woul'd suggest against writing everything from scrach, it looks like allot of works and introduce allot of bugs, as to what needs to be on top of what every time, that you can fix by either using a library or taking the default one.
I have a button that says "Sort" and when a user normal/short presses the button, I want a menu to appear with the various sort options. Looking around online there doesn't seem to be a straight forward answer to which route is considered best practice. I'm looking to have a menu that looks similar to this:
with icons and text.
For an example, click the Layers button in the Google Maps app. It opens a list of options on a single short click. It has a title at the top and icons for each option. (The icons aren't super crucial)
Should I use a Context Menu? If so, how do I do it without a long press. Should it be a Spinner? If so how do I change the appearance to use a button instead of the normal drop down box.
Spinners are for stateful selection, which sounds like what you want here. The user will select one sort option from a list, and there is a concept of a "current" sort that stays visible to the user.
For something like the activity picker in your screenshot, Falmarri's suggestion of an AlertDialog is reasonable. The difference between choosing a sort and the activity picker is the "stateful selection" distinction. Spinners have a concept of a currently selected item already provided for you, dialogs are more general.
http://developer.android.com/reference/android/app/AlertDialog.html