material-components

How to use MaterialAlertDialogBuilder fine?

你。 提交于 2020-08-27 09:12:07
问题 When i use dialog.builder the font size is correct but when i use MaterialAlertDialogBuilder the font size of body text is smaller. its ok? implementation 'com.google.android.material:material:1.1.0-alpha06' Im use this theme <style name="AppTheme" parent="Theme.MaterialComponents.Light"> MaterialComponent code MaterialAlertDialogBuilder(this) .setMessage("This is a test of MaterialAlertDialogBuilder") .setPositiveButton("Ok", null) .show() AlertDialog.Builder AlertDialog.Builder(this)

How to use MaterialAlertDialogBuilder fine?

走远了吗. 提交于 2020-08-27 09:11:30
问题 When i use dialog.builder the font size is correct but when i use MaterialAlertDialogBuilder the font size of body text is smaller. its ok? implementation 'com.google.android.material:material:1.1.0-alpha06' Im use this theme <style name="AppTheme" parent="Theme.MaterialComponents.Light"> MaterialComponent code MaterialAlertDialogBuilder(this) .setMessage("This is a test of MaterialAlertDialogBuilder") .setPositiveButton("Ok", null) .show() AlertDialog.Builder AlertDialog.Builder(this)

Android: Is there a simple way to create rounded corners for a view without having to create a separate drawable each time?

回眸只為那壹抹淺笑 提交于 2020-08-25 21:17:01
问题 I have gone through various solutions on the internet, which enable us to create views with rounded corners. Most of them require the use of creating custom views, or to create a drawable in xml or a nine-patch each time we need a rounded corner view. The problem is that when I implement such views, I need to create a drawable for every such view, even if two views have everything but just the background color in common. This is kind of irritating for me and I've heard the iOS framework

Android: Is there a simple way to create rounded corners for a view without having to create a separate drawable each time?

六月ゝ 毕业季﹏ 提交于 2020-08-25 21:16:57
问题 I have gone through various solutions on the internet, which enable us to create views with rounded corners. Most of them require the use of creating custom views, or to create a drawable in xml or a nine-patch each time we need a rounded corner view. The problem is that when I implement such views, I need to create a drawable for every such view, even if two views have everything but just the background color in common. This is kind of irritating for me and I've heard the iOS framework

Android: Is there a simple way to create rounded corners for a view without having to create a separate drawable each time?

二次信任 提交于 2020-08-25 21:15:33
问题 I have gone through various solutions on the internet, which enable us to create views with rounded corners. Most of them require the use of creating custom views, or to create a drawable in xml or a nine-patch each time we need a rounded corner view. The problem is that when I implement such views, I need to create a drawable for every such view, even if two views have everything but just the background color in common. This is kind of irritating for me and I've heard the iOS framework

bottomSheetDialogFragment full screen

佐手、 提交于 2020-07-31 07:31:28
问题 What I'm trying to achieve is something like Instagram in-app web browser, used when you click an ad: what I did, is I used a WebView bottomSheetDialogFragment, and I override onCreateDialog to get the full screen like this : @Override public Dialog onCreateDialog(Bundle savedInstanceState) { BottomSheetDialog bottomSheetDialog=(BottomSheetDialog)super.onCreateDialog(savedInstanceState); bottomSheetDialog.setOnShowListener(dialog -> { BottomSheetDialog dialogc = (BottomSheetDialog) dialog;

How to display progress drawable animation in Chip Material Component?

不想你离开。 提交于 2020-07-22 07:21:06
问题 According to the official Design docs for Action Chips, we are supposed to be able to add a progress state to chips. Sadly, the Development docs don't mention this at all. Has anyone managed to figure out how to achieve the effect shown here? 回答1: It is possible to implement this behavior using the chipIcon attribute and androidx.swiperefreshlayout.widget.CircularProgressDrawable . xml app:chipIconWithProgress="@{viewModel.taskIsStarting ? null : @drawable/ic_play_arrow}" and BindingAdapter

Implementation of Google design guidelines for Sliders

眉间皱痕 提交于 2020-07-18 08:42:28
问题 Yesterday I was looking for sliders in Android and found this website with the Google search: https://material.io/guidelines/components/sliders.html#sliders-discrete-slider I know that I can use a SeekBar in Android to implement sliders. However, Google seems to have very nice examples of discrete sliders but I cannot find any code examples. I already implemented a normal SeekBar that is looking like this: How can I make it look like this? (Difference: When I move my slider, there is no big

How to create a circular outlined Material Button in Android?

折月煮酒 提交于 2020-07-18 04:25:58
问题 I am trying to create a button with an icon in the center. The top and bottom part of the circle are a little flat. Is there a way to do this without using corner radius? Here is my layout for the button. <com.google.android.material.button.MaterialButton android:id="@+id/start_dispenser_btn" style="@style/Widget.MaterialComponents.Button.OutlinedButton" android:layout_width="175dp" android:layout_height="175dp" android:padding="14dp" app:cornerRadius="150dp" app:icon="@drawable/ic_play_arrow