material-components

Badge on BottomNavigationView

浪子不回头ぞ 提交于 2019-12-01 15:28:08
I am trying to add a badge to the BottomNavigationView Item without using any library, however somehow the BottomNavigationView is not showing the badge (custom_view) main_view.xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="

Showing and hiding BottomAppBar on scroll

我们两清 提交于 2019-12-01 10:38:10
问题 I'm trying to implement BottomAppBar where I would handle the navigation of a WebView . <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android

How to change android button text color globally in theme

你离开我真会死。 提交于 2019-11-30 16:26:13
问题 How can I change all my buttons text color? I know I can set the background color like follows : <style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> ... <item name="colorButtonNormal">@color/buttonColor</item> </style> How can I do this for the button Text? 回答1: <style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:textColor">#yourcolor</item> <item name="android:buttonStyle">@style/ButtonColor</item> <item name="colorButtonNormal"

Change dialog button color

旧巷老猫 提交于 2019-11-28 10:54:58
问题 Is there any way how to change default dialog buttons colour, or do I need to do custom dialog for that? This is my dialog: private void removeItem(final int position) { /** Create dialog which ask if user is sure about delete name from list **/ AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Delete player"); builder.setIcon(R.mipmap.ic_launcher); builder.setMessage("Do you want to delete player: \"" + mNameList.get(position).getText1() + "\"?") .setCancelable

Change font of the floating label EditText and TextInputLayout

怎甘沉沦 提交于 2019-11-27 13:10:05
Someone tried to change the font of the floating label? I changed the source of EditText but the font of the floating label did not change, I am very grateful to those who help me Code: <android.support.design.widget.TextInputLayout android:id="@+id/tilTextoDescricao" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_toRightOf="@id/tilValorUnidade" android:layout_marginTop="10dp"> <EditText android:id="@+id/etTextoDescricao" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:hint="Descrição"

Android material chip component crashing app. Unable to inflate xml

蹲街弑〆低调 提交于 2019-11-27 09:26:16
Tried Chip component from both support library com.google.android.support:design:28.0.0-rc01 and material com.google.android.material:material:1.0.0-rc01 StackTrace android.view.InflateException: Binary XML file line #72: Binary XML file line #72: Error inflating class com.google.android.material.chip.Chip at android.view.LayoutInflater.inflate(LayoutInflater.java:551) at android.view.LayoutInflater.inflate(LayoutInflater.java:429)` Layout <com.google.android.material.chip.Chip android:id="@+id/chip" style="style/Widget.MaterialComponents.Chip.Entry" android:layout_width="wrap_content" android

How to display badge for a menuItem of BottomNavigationView of material library (version 1.1.0-alpha08)?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 09:21:42
I just want to add badge for a menuItem of BottomNavigationView in my app. I'm using BottomNavigationView of Material Components library(version 1.1.0-alpha08) since its the latest version released just 7 days ago from now I didn't found any tutorial for the same, Now because there are changes made in this version of BottomNavigationView 's showBadge method we cannot use that method. I've tried calling getBadge and getOrCreateBadge method over instance of BottomNavigationView . BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav); if (bottomNavigationView.getBadge(3) ==

How to add chips from Material Components library to input field in android?

≡放荡痞女 提交于 2019-11-27 01:40:39
问题 I've seen that in android-P google add new material components library which contains material chips: Material components for android Material.io chips usage Material components on GitHub So I decided to add material input chips to my project, but unfortunately didn't find any tutorial how to make that. I want to create something like Gmail chips but without image on the start. Because I'm using appcompat library I tried to use material chips by android.support.design.chip.Chip and android

java.lang.IllegalArgumentException: This component requires that you specify a valid android:textAppearance attribute

百般思念 提交于 2019-11-26 23:18:48
问题 I have a com.google.android.material.button.MaterialButton component in one of my layout file and I get this error when I am using the latest version of the Material Components library (com.google.android.material:material:1.0.0-alpha3): java.lang.IllegalArgumentException: This component requires that you specify a valid android:textAppearance attribute. It wasn't present in 1.0.0-alpha1. Is this a bug in the library or should I just specify a textAppearance attribute from now? 回答1: Does your

How to display badge for a menuItem of BottomNavigationView of material library (version 1.1.0-alpha08)?

可紊 提交于 2019-11-26 17:50:00
问题 I just want to add badge for a menuItem of BottomNavigationView in my app. I'm using BottomNavigationView of Material Components library(version 1.1.0-alpha08) since its the latest version released just 7 days ago from now I didn't found any tutorial for the same, Now because there are changes made in this version of BottomNavigationView 's showBadge method we cannot use that method. I've tried calling getBadge and getOrCreateBadge method over instance of BottomNavigationView .