Questions tagged [material-design]
Material design is Google's guide for visual, motion, and interaction design across platforms and devices, introduced with Android 5.0 Lollipop.
material-design
8,620
questions
599
votes
42
answers
796k
views
How to change progress bar's progress color in Android
I'm using an horizontal progress bar in my Android application, and I want to change its progress color (which is Yellow by default). How can I do it using code (not XML)?
597
votes
27
answers
453k
views
This Activity already has an action bar supplied by the window decor
Trying to move over my stuff to use Toolbar instead of action bar but I keep getting an error saying
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tyczj.weddingalbum/com.xxx....
381
votes
36
answers
292k
views
How to implement endless list with RecyclerView?
I would like to change ListView to RecyclerView. I want to use the onScroll of the OnScrollListener in RecyclerView to determine if a user scrolled to the end of the list.
How do I know if a user ...
346
votes
12
answers
624k
views
Android Material Design Button Styles
I'm confused on button styles for material design. I'd like to get colorful raised buttons like in the attached link., like the "force stop" and "uninstall" buttons seen under the usage section. Are ...
335
votes
23
answers
334k
views
Android "elevation" not showing a shadow
I have a ListView, and with each list item I want it to show a shadow beneath it. I am using Android Lollipop's new elevation feature to set a Z on the View that I want to cast a shadow, and am ...
287
votes
16
answers
237k
views
How to use the new Material Design Icon themes: Outlined, Rounded, Two-Tone and Sharp?
Google has revamped its Material Design Icons with 4 new preset themes:
Outlined, Rounded, Two-Tone and Sharp, in addition to the regular Filled/Baseline theme:
But, unfortunately, it doesn't say ...
264
votes
25
answers
256k
views
How can a divider line be added in an Android RecyclerView?
I am developing an android application where I am using RecyclerView. I need to add a divider in RecyclerView.
I tried to add -
recyclerView.addItemDecoration(new
DividerItemDecoration(...
261
votes
28
answers
194k
views
Coloring Buttons in Android with Material Design and AppCompat
Before the AppCompat update came out today I was able to change the color of buttons in Android L but not on older versions. After including the new AppCompat update I am unable to change the color ...
222
votes
30
answers
164k
views
Round corner for BottomSheetDialogFragment
I have a custom BttomSheetDialogFragment and I want to have round corners in top of Bottom View
This is my Custom class that inflates my layout that I want to appear from bottom
View mView;
@Override
...
219
votes
14
answers
247k
views
Adjust icon size of Floating action button (fab)
The new floating action button should be 56dp x 56dp and the icon inside it should be 24dp x 24dp. So the space between icon and button should be 16dp.
<ImageButton
android:id="@+id/fab_add"
...
212
votes
1
answer
84k
views
What is the difference between Action Bar and newly introduced Toolbar?
After Google introduced Material Design, I have heard about a new widget class called Toolbar.
What is the Toolbar, and what is the exact difference between ActionBar and ToolBar?
211
votes
16
answers
282k
views
Flutter: Setting the height of the AppBar
How can I simply set the height of the AppBar in Flutter?
The title of the bar should be staying centered vertically (in that AppBar).
194
votes
12
answers
188k
views
Selected tab's color in Bottom Navigation View
I'm adding a BottomNavigationView to a project, and I would like to have a different text (and icon tint) color for the selected tab (to achieve greying out non-selected tabs effect). Using a ...
190
votes
5
answers
176k
views
Android Design Support Library expandable Floating Action Button(FAB) menu
Now that the Android Design Support Library is out, does anyone knows how to implement expanded Fab menu with it, like the fab on Inbox App?
Should look like this:
189
votes
1
answer
130k
views
Choosing bootstrap vs material design [closed]
I'm going to start new project using AngularJS (full stack). My project needs to be responsive and I'll be creating templates from scratch.
So I need an advice on whether to choose bootstrap 3 (with ...
188
votes
7
answers
124k
views
Import material design icons into an android project
Is there an easy way to import all the icons of the Material Design icons repository into an android project with out the hazard of doing it manually?
187
votes
10
answers
129k
views
Toolbar overlapping below status bar
I want to have appcompat v21 toolbar in my activity. But the toolbar I'm implementing is overlapping below status bar. How can I fix it?
Here is the activity layout xml:
<LinearLayout xmlns:...
185
votes
6
answers
165k
views
How to achieve ripple animation using support library?
I am trying to add a ripple animation on button click. I did like below but it requires minSdKVersion to 21.
ripple.xml
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
...
181
votes
16
answers
134k
views
How to set a ripple effect on textview or imageview on Android?
I want to set a ripple effect on textview and imageview in Android Studio. How can I do it?
179
votes
21
answers
150k
views
No shadow by default on Toolbar?
I'm updating my app with the new Toolbar from the support library v21. My problem is that the toolbar does not cast any shadow if I don't set the "elevation" attribute. Is that the normal behavior or ...
165
votes
8
answers
106k
views
Material Design not styling alert dialogs
I've added the appCompat material design to my app and it seems that the alert dialogs are not using my primary, primaryDark, or accent colors.
Here is my base style:
<style name="...
165
votes
4
answers
373k
views
Is there an official or exhaustive list of all mat-icons in Angular?
I have started using <mat-icon> from Angular Material, and I'm wondering if there is any official list of the names of all the included icons. A few months ago I found a page where a bunch of ...
164
votes
3
answers
106k
views
How can I use custom theme palettes in Angular?
I want to use my company's brand colors throughout the app.
I have found this issue: AngularJS 2 - Material design - set color palette where I can build an allegedly custom theme, but it's basically ...
159
votes
13
answers
171k
views
How to add multiple classes in Material UI using the classes props?
Using the css-in-js method to add classes to a react component, how do I add multiple components?
Here is the classes variable:
const styles = theme => ({
container: {
display: 'flex',
...
144
votes
21
answers
187k
views
CardView not showing Shadow in Android L
My Cardview inside Listview is not showing shadow in Android L(Nexus 5). Also the round edges are not properly shown. Here is the code for Listview's Adapter View :
<?xml version="1.0" encoding="...
143
votes
11
answers
153k
views
Flutter: How do you make a card clickable?
I just have a simple Card like new Card(child: new Text('My cool card')) and I want to be able to click anywhere on it to run some function, except there's no onPressed method for a Card. I could add ...
141
votes
9
answers
147k
views
Creating a SearchView that looks like the material design guidelines
I'm currently in the process of learning how to convert my app to Material design and I'm a bit stuck right now. I've got the Toolbar added and I have made my navigation drawer overlay all the content....
136
votes
12
answers
171k
views
How to change the new TabLayout indicator color and height
I was playing around with the new android.support.design.widget.TabLayout, and found a problem, in the class definition, there are no methods to change the indicator color, and default height.
Doing ...
132
votes
10
answers
82k
views
How can I modify ripple color when using ?attr/selectableItemBackground as background?
I've seen some SO questions and they gave some possible methods to achieve what I want. For example:
Use colorControlHighlight attribute in styles.xml.
Here is my styles-v21.xml:
<style name="...
131
votes
11
answers
180k
views
How to show Snackbar when Activity starts?
I want to show android Snackbar (android.support.design.widget.Snackbar) when the activity starts just like we show a Toast.
But the problem is we have to specify the parent layout when creating ...
127
votes
7
answers
124k
views
Material UI and Grid system
I'm playing a little bit with Material-UI. Are there any options for creating a grid layout (like in Bootstrap)?
If not, what is the way to add this functionality?
There is a GridList component but ...
123
votes
21
answers
107k
views
How to change background color of the snackbar?
I am showing snackbar in a DialogFragment within the positive touch of the alert dialog. Here is my code snippet:
Snackbar snackbar = Snackbar.make(view, "Please enter customer name", ...
119
votes
4
answers
40k
views
How to mimic Google Maps' bottom-sheet 3 phases behavior?
Background
I'm assigned to make a UI that behaves similarly to how Google Maps shows a bottom-sheet for a found result.
It has three different phases:
Bottom content. The upper area is still ...
113
votes
16
answers
132k
views
Android Support Design TabLayout: Gravity Center and Mode Scrollable
I am trying to use the new Design TabLayout in my project. I want the layout to adapt to every screen size and orientation, but it can be seen correctly in one orientation.
I am dealing with Gravity ...
113
votes
10
answers
247k
views
How get data from Material UI TextField, DropDownMenu components?
I created a form, I have several TextField, DropDownMenu Material UI components included, question is how I can collect all data from all TextFields, DropDownMenus in one obj and sent it to the server....
112
votes
6
answers
61k
views
Apply Material Design Touch Ripple to ImageButton?
I have an imagebutton that doesn't respond with a touch animation when it is clicked because it is a static image unlike regular buttons on lollipop which come with the built in ripple effect. I would ...
111
votes
17
answers
124k
views
Display badge on top of bottom navigation bar's icon
I have implemented the bottom navigation view in my app and I have looked every where to display badges on top of the icons like this
I was wondering whether this is even possible to implement. Any ...
111
votes
20
answers
139k
views
How do you adjust the height and borderRadius of a BottomSheet in Flutter?
I'm probably missing something obvious here, but my BottomSheet only takes up the bottom half the screen, even though the widgets in it take up more space. So now there is scrolling behavior inside ...
111
votes
13
answers
45k
views
How can I be notified when a Snackbar has dismissed itself?
I'm using a Snackbar from the com.android.support:design:22.2.0 library. I'm using it to undo deletions. To make my life easier, I'm going to make the UI look like things are actually deleted from the ...
107
votes
19
answers
126k
views
Change the TextInputLayout outline color
I'm trying to customize a TextInputLayout with material style. I managed to set the focused state to the colors I want:
Using
<com.google.android.material.textfield.TextInputLayout
style=&...
107
votes
12
answers
119k
views
FloatingActionButton with text instead of image
I'm trying to figure out how can be modified FloatingActionButton from android support library. Can it be used with the text instead of image?
Something like this one:
I see it extends ImageButton ...
106
votes
10
answers
86k
views
Angular - 'Could not find HammerJS'
I'm working on a simple angular project where I am trying to import Material Design into my project but some of the components aren't working properly and a console warning says:
Could not find ...
105
votes
8
answers
166k
views
Binding element 'index' implicitly has an 'any' type
Using the demo project of angular2-mdl as a guide I ported the tab component and tried to implement it as follow:
import { Component } from '@angular/core';
@Component({
selector: 'my-dashboard',...
103
votes
19
answers
104k
views
How do I change the color of icon of the selected tab of TabLayout?
I'm using a TabLayout with a ViewPager and I'm wondering how I can most efficiently change the color of the icon of the selected tab in the TabLayout.
A perfect reference for how this is implemented ...
102
votes
13
answers
80k
views
Error : IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents
Below are my dependencies
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1....
102
votes
9
answers
126k
views
How to use <md-icon> in Angular Material?
I was wondering how to use Material's icons, as this is not working:
<material-icon icon = "/img/icons/ic_access_time_24px.svg"> </material-icon>
I guess there is a problem with the ...
101
votes
3
answers
24k
views
Ionic directives VS Angular material directives with Ionic Framework
I want to use ionic with material design. I am stuck between using ionic directives with custom CSS and angular-material
I have read that using ionic directives we get lot of efficient features like ...
100
votes
17
answers
55k
views
TextInputLayout not showing EditText hint before user focus on it
I am using recently released Android Design Support Library to show floating label with EditTexts. But i am facing the problem that the Hint on the EditText is not showing when UI is rendered, but i ...
99
votes
10
answers
285k
views
How to provide shadow to Button
As you can see in image, I want shadow behind a Button. I have created Button with rounded corners. But problem is I can't generate a shadow behind that Button. How can I achieve this?
97
votes
8
answers
52k
views
MaterialComponents theme alert dialog buttons
Recently I switched from support library to com.google.android.material:material:1.0.0
But now I have a problem, in this pages there's a note https://github.com/material-components/material-...