diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cbff8652cf..5151a618f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,7 @@ Supported filename extensions are: - ``.bugfix``: Signifying a bug fix. - ``.doc``: Signifying a documentation improvement. - ``.removal``: Signifying a deprecation or removal of public API. Can be used to notifying about API change in the Matrix SDK -- ``.misc``: A ticket has been closed, but it is not of interest to users. Note that in this case, the content of the file will not be output, but just the issue/PR number. +- ``.misc``: Any other changes. See https://github.com/twisted/towncrier#news-fragments if you need more details. diff --git a/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeActivity.kt b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeActivity.kt index 675edde4f2..553d495e22 100644 --- a/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeActivity.kt +++ b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeActivity.kt @@ -24,6 +24,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.snackbar.Snackbar import im.vector.lib.ui.styles.R import im.vector.lib.ui.styles.databinding.ActivityDebugMaterialThemeBinding +import im.vector.lib.ui.styles.dialogs.MaterialProgressDialog // Rendering is not the same with VectorBaseActivity abstract class DebugMaterialThemeActivity : AppCompatActivity() { @@ -50,14 +51,20 @@ abstract class DebugMaterialThemeActivity : AppCompatActivity() { } views.debugShowDialog.setOnClickListener { - MaterialAlertDialogBuilder(this) - .setTitle("Dialog title") - .setMessage("Dialog content") - .setIcon(R.drawable.ic_debug_icon) - .setPositiveButton("Positive", null) - .setNegativeButton("Negative", null) - .setNeutralButton("Neutral", null) - .show() + showTestDialog(0) + } + + views.debugShowDialogDestructive.setOnClickListener { + showTestDialog(R.style.ThemeOverlay_Vector_MaterialAlertDialog_Destructive) + } + + views.debugShowDialogNegativeDestructive.setOnClickListener { + showTestDialog(R.style.ThemeOverlay_Vector_MaterialAlertDialog_NegativeDestructive) + } + + views.debugShowProgressDialog.setOnClickListener { + MaterialProgressDialog(this) + .show(message = "Progress Dialog\nLine 2", cancellable = true) } views.debugShowBottomSheet.setOnClickListener { @@ -65,6 +72,17 @@ abstract class DebugMaterialThemeActivity : AppCompatActivity() { } } + private fun showTestDialog(theme: Int) { + MaterialAlertDialogBuilder(this, theme) + .setTitle("Dialog title") + .setMessage("Dialog content\nLine 2") + .setIcon(R.drawable.ic_debug_icon) + .setPositiveButton("Positive", null) + .setNegativeButton("Negative", null) + .setNeutralButton("Neutral", null) + .show() + } + override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.menu_debug, menu) return true diff --git a/library/ui-styles/src/debug/res/layout/activity_debug_material_theme.xml b/library/ui-styles/src/debug/res/layout/activity_debug_material_theme.xml index 7df0facb12..4828810e34 100644 --- a/library/ui-styles/src/debug/res/layout/activity_debug_material_theme.xml +++ b/library/ui-styles/src/debug/res/layout/activity_debug_material_theme.xml @@ -452,6 +452,27 @@ android:layout_gravity="center_horizontal" android:text="Show Dialog" /> +