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.
Related
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 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.
I have a news app.It is supposed to launch by swiping on the screen(homescreen or while in any other activity like switchr app).I learned to code swiping patterns but in my case I have to do exactly in the following way(swiping bottom right to top left)..Kindly have a look over following pictorial representation
1.Firstly app should launch by swiping bottom right to top left on the screen
2.next,show the user with list of scrollable arc menu buttons embedded in it like second image
3.when a user clicks on particular button it has to show a brief description about the content like third image
my problems:
creating arc like scrollable menu on bottom right side of the screen(I googled sia ahmed's solution over here ,it helped me a bit)
creating that parachute like structure(image 3) when user clicks particular bubble like button in arc menu..
please guide me
For the menu check out arcmenu by daCapricorn on github. Also see this question.
The balloon bit is trickier. I know of a balloon hint code for android but i haven't seen it in action.
Hope this helps!
I have a bar in my app with 2 buttons side by side. One button represents the page the user is currently on and the other redirects the user to another page with the same button bar. What I want is for the button that represents the page the user is currently on to look like it is pressed (i.e. the color it would be if it is pressed). I already have it set so it can't be clicked. Is there a setting or attribute or do I HAVE to create my own selector (because I don't really understand how to implement that)?
Have never tried this but
button.setPressed(true)
should work.
Edit: You can also add
button.setClickable(false)
Edit: This does work but the order is important. Use this
btn.setClickable(false);
btn.setPressed(true);
in my app i am trying to get the following designs.
Above is the first image
Above is the second image
When the activity is opened the first image is shown, currently i have shown it as an tab bar but i am not able to place an red colored rounded imageview near the Why? button. According to my app the number in the rounded image view must get changed often.
When the next Why? button is clicked i want to show the UI as in second image with another three buttons over it.
In ios apps, this design can be made by the help of UISegmentControl. In android apps how to implement this.....
This is the nice tutorial about Tab activity and also put badge inside it
see below link
Click Here