android-alertdialog

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)

Kotlin: Show AlertDialog when RecycleView item clicked

元气小坏坏 提交于 2020-07-10 08:17:25
问题 Now I'm studying to show AlertDialog when RecyclerView item clicked. However, I don't know how to set the adapter for click listener. Could you give me a tip? Firstly, I tried to put the AlertDialog in this Main Activity. Is this right position? MainActivity class MainActivity : AppCompatActivity() { private val foodList = listOf( FoodModel("Noodle", 2), FoodModel("Cake", 3), FoodModel("Pizza", 4), FoodModel("Stake", 5), FoodModel("Chicken", 4) ) override fun onCreate(savedInstanceState:

MaterialComponents AlertDialog text color

安稳与你 提交于 2020-07-07 06:53:49
问题 Reading MaterialComponents theme alert dialog buttons and https://medium.com/@lcdsmao/material-design-custom-alert-dialog-5a9cab3ade11 I set AlertDialog buttons and text colors of new Material Theme. <!-- Base application theme. --> <style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color

Refresh or change the AlertDialog Message

会有一股神秘感。 提交于 2020-07-03 05:50:29
问题 I create an AlertDialog AlertDialog.Builder builder = new AlertDialog.Builder(this); ... AlertDialog alert = builder.create(); alert.show(); After a moment I want to change the AlertDialog message without closing it. Is it possible? 回答1: Yes ,you can. For example, if you create your own dialog, with your own layout, you can set an id for each of the views, and then access each of them (for example the textView) and set its new text whenever you wish to. 回答2: Agreed with android developer. You