material-components-android

how to make image view with three corner and shadow

烂漫一生 提交于 2021-01-27 14:03:18
问题 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

ActionBar background with MaterialComponents theme

扶醉桌前 提交于 2021-01-27 05:29:33
问题 I want to customize my ActionBar. My Theme looks as below: <style name="AppTheme" parent="Theme.MaterialComponents.DayNight"> <item name="actionBarStyle">@style/MyActionBar</item> </style> <style name="MyActionBar" parent="@style/ThemeOverlay.MaterialComponents.ActionBar"> <item name="background">@drawable/actionBarBackground</item> </style> In values folder: <drawable name="actionBarBackground">#FFFFFFFF</drawable> In values-night folder: <drawable name="actionBarBackground">#FF000000<

AndroidX BottomAppBar navigation icon color

被刻印的时光 ゝ 提交于 2021-01-27 04:41:50
问题 I've defined a bottom bar in a layout like that: <com.google.android.material.bottomappbar.BottomAppBar android:id="@+id/bottomBar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" app:navigationIcon="@drawable/ic_menu_black_24dp" /> The navigation icon is a generic icon generated from the "new vector drawable" wizard. Is there a way to apply a tint to it? The bottom bar is not the activity action bar. What I've tried so far: applied a

Android material lib ShapeableImageView is not showing preview with app:shapeAppearanceOverlay

孤街醉人 提交于 2021-01-24 07:41:12
问题 There is a problem using ShapeableImageView material component and set shapeAppearanceOverlay to make it a circle image. It doesn't show up in viewport. Seems like we set the visibility to GONE . However, it shows perfectly on the device. Is there any way to fix it? or since it is still in 1.2.0-alpha05 so under development or a known bug? Viewport Screenshot Device Screenshot Material Library implementation 'com.google.android.material:material:1.2.0-alpha05' XML Code <com.google.android

Smooth animation between tabs when using selector - Android

荒凉一梦 提交于 2021-01-20 19:45:25
问题 I would like to get the background of the tab animated smoothly to the selected position (just like the default tabIndicator animates between tabs). Here is how my TabLayout looks like <android.support.design.widget.TabLayout android:layout_marginTop="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/tabLayout" app:tabBackground="@drawable/tab_selector" app:tabTextColor="@color/white" android:background="@drawable/tab_layout_bg" app

Smooth animation between tabs when using selector - Android

半腔热情 提交于 2021-01-20 19:44:58
问题 I would like to get the background of the tab animated smoothly to the selected position (just like the default tabIndicator animates between tabs). Here is how my TabLayout looks like <android.support.design.widget.TabLayout android:layout_marginTop="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/tabLayout" app:tabBackground="@drawable/tab_selector" app:tabTextColor="@color/white" android:background="@drawable/tab_layout_bg" app

Set com.google.android.material.chip.Chip selected color

泪湿孤枕 提交于 2021-01-20 15:28:59
问题 How do I set the selected com.google.android.material.chip.Chip color? I don't want it to be the default gray. This is a single selection chip group. Original documentation here <com.google.android.material.chip.ChipGroup android:id="@+id/chipgroup" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="16dp" android:layout_marginTop="16dp" android:layout_marginEnd="16dp" app:checkedChip="@+id/chip_program" app:chipSpacingHorizontal="32dp" app

Set com.google.android.material.chip.Chip selected color

久未见 提交于 2021-01-20 15:25:51
问题 How do I set the selected com.google.android.material.chip.Chip color? I don't want it to be the default gray. This is a single selection chip group. Original documentation here <com.google.android.material.chip.ChipGroup android:id="@+id/chipgroup" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="16dp" android:layout_marginTop="16dp" android:layout_marginEnd="16dp" app:checkedChip="@+id/chip_program" app:chipSpacingHorizontal="32dp" app

TextInputLayout styling

跟風遠走 提交于 2021-01-20 07:28:28
问题 I have problem with my custom TextInputLayout . Here is my code <com.google.android.material.textfield.TextInputLayout android:id="@+id/phone" android:layout_width="0dp" android:layout_height="wrap_content" android:theme="@style/CustomTextInputLayout" android:hint="@string/phone_number" android:layout_marginTop="8dp" android:layout_marginStart="16dp" android:layout_marginEnd="16dp" app:startIconDrawable="@drawable/account" android:background="@color/bg_light_gray" app:layout_constraintLeft

Android button background is taking the primary color

拜拜、爱过 提交于 2021-01-20 07:13:32
问题 I've this issue, I don't know where it come from, I've created this buttons with custom background, but the background color talking the primary color and cannot change it unless change the primary color. <Button android:id="@+id/btn_teacher" style="@style/normalText" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/_16sdp" android:background="@drawable/btn_rounded_stroke" android:text="@string/txt_teacher" /> <resources> <color name