material-components-android

Theme.MaterialComponents style ruins Firebase AuthUI layout

不想你离开。 提交于 2021-02-11 17:36:05
问题 I am writing my first app in kotlin and am using FirebaseAuth & AuthUI for authentication. My login screen works perfectly, and looked like: Now I am trying to change my AppTheme's parent to "Theme.MaterialComponents.NoActionBar" (from "Theme.AppCompat.NoActionBar") but the login screen changed to: I call the login screen like so: startActivityForResult( authUI.createSignInIntentBuilder() .setAvailableProviders(providers) .build(), RC_SIGN_IN ) I tried to add .setTheme(R.style.FirebaseUI)

Add custom shape ripple with selector on navigationview menu item

假装没事ソ 提交于 2021-02-10 05:47:28
问题 I want to add a ripple effect with rounded corners rectangle with a selector for navigation view item. But it keeps adding the gray rectangle ripple effect. navigation view <android.support.design.widget.NavigationView android:id="@+id/navigation_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" app:itemIconTint="@color/drawer_item" app

Mirror (flip) a View / ProgressBar

邮差的信 提交于 2021-02-08 13:16:19
问题 I have a custom built circular progress bar used for a seconds counter on a clock, which I'd like to flip, so that the clock is counting counter-clockwise. Searching here for a solution, I found this: Right to Left ProgressBar? Which obviously works for a horizontal progress bar, but I can't simply rotate it 180 degrees, since that will just move the clock 180 degrees and it will still be ticking clockwise. Is there any other way to mirror a ProgressBar, or any View? Edit: Just found "android

Changing NavigationView background to round shape not working when pressed

人盡茶涼 提交于 2021-02-06 13:46:48
问题 I am setting navigation item background using app:itemBackground in layout: <android.support.design.widget.NavigationView android:id="@+id/nav_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:fitsSystemWindows="true" app:itemBackground="@drawable/nav_selector_background" app:headerLayout="@layout/nav_header_main" app:menu="@menu/activity_main_drawer"/> Here is nav_selector_background.xml <ripple xmlns:android="http://schemas

Navigation drawer rounded corner background for items

我是研究僧i 提交于 2021-02-06 12:13:37
问题 I want to have a rounded corner for the items in navigation drawer like this : it's an example of material design in material.io website is it possible ? 回答1: Just use the app:itemShapeAppearanceOverlay attribute: <com.google.android.material.navigation.NavigationView app:itemShapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Nav" ...> with: <style name="ShapeAppearanceOverlay.Nav" parent=""> <item name="cornerFamily">rounded</item> <item name="cornerSize">8dp</item> </style> 回答2: First, I

Navigation drawer rounded corner background for items

ε祈祈猫儿з 提交于 2021-02-06 12:11:08
问题 I want to have a rounded corner for the items in navigation drawer like this : it's an example of material design in material.io website is it possible ? 回答1: Just use the app:itemShapeAppearanceOverlay attribute: <com.google.android.material.navigation.NavigationView app:itemShapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Nav" ...> with: <style name="ShapeAppearanceOverlay.Nav" parent=""> <item name="cornerFamily">rounded</item> <item name="cornerSize">8dp</item> </style> 回答2: First, I

How to set round corners for a custom Dialog?

…衆ロ難τιáo~ 提交于 2021-02-04 06:20:05
问题 This is code for my custom Dialog: public class DialogBrightness extends AppCompatDialogFragment { @NonNull @Override public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { LayoutInflater inflater = getActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.layout_dialog, null); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); /*Build and create the dialog here*/ } } I followed instructions from other answers by first creating this drawable xml

How to set round corners for a custom Dialog?

折月煮酒 提交于 2021-02-04 06:16:21
问题 This is code for my custom Dialog: public class DialogBrightness extends AppCompatDialogFragment { @NonNull @Override public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { LayoutInflater inflater = getActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.layout_dialog, null); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); /*Build and create the dialog here*/ } } I followed instructions from other answers by first creating this drawable xml

Filter with chips android

陌路散爱 提交于 2021-01-29 05:19:09
问题 I would like to ask you if exist in component which is an radiobutton, but it is format from chips like this image. it is an component presents in Google Play Games when you want search an game thank for ours response 回答1: It is not exactly what you are looking for but you can use: a container with rounded corners, like a CardView or a LinearLayout single Button with rounded corners for each items add animations on the onClick event Something like: <LinearLayout android:id="@+id/ll_container"

how to make image view with three corner and shadow

我的未来我决定 提交于 2021-01-27 14:08:42
问题 How to make an image with only three corners like this I tried using frame layout the insert image view and make it's resource with original image the add another image view with src of border that has 3 corner bu it doesn't work 回答1: With the Material Components library you can use the MaterialShapeDrawable . Just use something like: <com.google.android.material.imageview.ShapeableImageView app:shapeAppearanceOverlay="@style/onlyonecorner" app:srcCompat="@drawable/xxx" ../> with: <style name