diff --git a/library/ui-styles/build.gradle b/library/ui-styles/build.gradle
index f3e9ee9991..8010786a17 100644
--- a/library/ui-styles/build.gradle
+++ b/library/ui-styles/build.gradle
@@ -46,6 +46,9 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
+ buildFeatures {
+ viewBinding true
+ }
}
dependencies {
diff --git a/library/ui-styles/src/debug/AndroidManifest.xml b/library/ui-styles/src/debug/AndroidManifest.xml
new file mode 100644
index 0000000000..b0c32f3975
--- /dev/null
+++ b/library/ui-styles/src/debug/AndroidManifest.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugBottomSheet.kt b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugBottomSheet.kt
similarity index 90%
rename from vector/src/debug/java/im/vector/app/features/debug/DebugBottomSheet.kt
rename to library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugBottomSheet.kt
index 0ac9a894ae..f5f69b1db4 100644
--- a/vector/src/debug/java/im/vector/app/features/debug/DebugBottomSheet.kt
+++ b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugBottomSheet.kt
@@ -14,14 +14,14 @@
* limitations under the License.
*/
-package im.vector.app.features.debug
+package im.vector.lib.ui.styles.debug
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
-import im.vector.app.databinding.ActivityTestMaterialThemeBinding
+import im.vector.lib.ui.styles.databinding.ActivityTestMaterialThemeBinding
class DebugBottomSheet : BottomSheetDialogFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeActivity.kt
similarity index 87%
rename from vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt
rename to library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeActivity.kt
index 69dc683bf3..492b359105 100644
--- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt
+++ b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeActivity.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 New Vector Ltd
+ * Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,16 +14,16 @@
* limitations under the License.
*/
-package im.vector.app.features.debug
+package im.vector.lib.ui.styles.debug
import android.os.Bundle
import android.view.Menu
+import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.snackbar.Snackbar
-import im.vector.app.R
-import im.vector.app.core.utils.toast
-import im.vector.app.databinding.ActivityTestMaterialThemeBinding
+import im.vector.lib.ui.styles.R
+import im.vector.lib.ui.styles.databinding.ActivityTestMaterialThemeBinding
// Rendering is not the same with VectorBaseActivity
abstract class DebugMaterialThemeActivity : AppCompatActivity() {
@@ -46,14 +46,14 @@ abstract class DebugMaterialThemeActivity : AppCompatActivity() {
}
views.debugShowToast.setOnClickListener {
- toast("Toast")
+ Toast.makeText(this, "Toast", Toast.LENGTH_SHORT).show()
}
views.debugShowDialog.setOnClickListener {
MaterialAlertDialogBuilder(this)
.setTitle("Dialog title")
.setMessage("Dialog content")
- .setIcon(R.drawable.ic_settings_x)
+ .setIcon(R.drawable.ic_debug_icon)
.setPositiveButton("Positive", null)
.setNegativeButton("Negative", null)
.setNeutralButton("Neutral", null)
diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkDefaultActivity.kt b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeDarkDefaultActivity.kt
similarity index 89%
rename from vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkDefaultActivity.kt
rename to library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeDarkDefaultActivity.kt
index 7e014577de..d24ceb6ede 100644
--- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkDefaultActivity.kt
+++ b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeDarkDefaultActivity.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 New Vector Ltd
+ * Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,6 +14,6 @@
* limitations under the License.
*/
-package im.vector.app.features.debug
+package im.vector.lib.ui.styles.debug
class DebugMaterialThemeDarkDefaultActivity : DebugMaterialThemeActivity()
diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkTestActivity.kt b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeDarkTestActivity.kt
similarity index 89%
rename from vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkTestActivity.kt
rename to library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeDarkTestActivity.kt
index 4a1ed04f6a..fea1f27dae 100644
--- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkTestActivity.kt
+++ b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeDarkTestActivity.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 New Vector Ltd
+ * Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,6 +14,6 @@
* limitations under the License.
*/
-package im.vector.app.features.debug
+package im.vector.lib.ui.styles.debug
class DebugMaterialThemeDarkTestActivity : DebugMaterialThemeActivity()
diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkVectorActivity.kt b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeDarkVectorActivity.kt
similarity index 89%
rename from vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkVectorActivity.kt
rename to library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeDarkVectorActivity.kt
index 6ac27aed45..379d55d006 100644
--- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkVectorActivity.kt
+++ b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeDarkVectorActivity.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 New Vector Ltd
+ * Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,6 +14,6 @@
* limitations under the License.
*/
-package im.vector.app.features.debug
+package im.vector.lib.ui.styles.debug
class DebugMaterialThemeDarkVectorActivity : DebugMaterialThemeActivity()
diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightDefaultActivity.kt b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeLightDefaultActivity.kt
similarity index 89%
rename from vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightDefaultActivity.kt
rename to library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeLightDefaultActivity.kt
index f6327e363b..57f172bdc3 100644
--- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightDefaultActivity.kt
+++ b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeLightDefaultActivity.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 New Vector Ltd
+ * Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,6 +14,6 @@
* limitations under the License.
*/
-package im.vector.app.features.debug
+package im.vector.lib.ui.styles.debug
class DebugMaterialThemeLightDefaultActivity : DebugMaterialThemeActivity()
diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightTestActivity.kt b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeLightTestActivity.kt
similarity index 89%
rename from vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightTestActivity.kt
rename to library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeLightTestActivity.kt
index ae6c1dd68c..d3a6c757fb 100644
--- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightTestActivity.kt
+++ b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeLightTestActivity.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 New Vector Ltd
+ * Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,6 +14,6 @@
* limitations under the License.
*/
-package im.vector.app.features.debug
+package im.vector.lib.ui.styles.debug
class DebugMaterialThemeLightTestActivity : DebugMaterialThemeActivity()
diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightVectorActivity.kt b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeLightVectorActivity.kt
similarity index 89%
rename from vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightVectorActivity.kt
rename to library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeLightVectorActivity.kt
index b4fb3c1cc8..3fafa61421 100644
--- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightVectorActivity.kt
+++ b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugMaterialThemeLightVectorActivity.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 New Vector Ltd
+ * Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,6 +14,6 @@
* limitations under the License.
*/
-package im.vector.app.features.debug
+package im.vector.lib.ui.styles.debug
class DebugMaterialThemeLightVectorActivity : DebugMaterialThemeActivity()
diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugVectorButtonStylesActivity.kt b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugVectorButtonStylesActivity.kt
similarity index 53%
rename from vector/src/debug/java/im/vector/app/features/debug/DebugVectorButtonStylesActivity.kt
rename to library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugVectorButtonStylesActivity.kt
index 783a2a3eb5..55c86d6c80 100644
--- a/vector/src/debug/java/im/vector/app/features/debug/DebugVectorButtonStylesActivity.kt
+++ b/library/ui-styles/src/debug/java/im/vector/lib/ui/styles/debug/DebugVectorButtonStylesActivity.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2021 New Vector Ltd
+ * Copyright (c) 2021 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,11 +14,17 @@
* limitations under the License.
*/
-package im.vector.app.features.debug
+package im.vector.lib.ui.styles.debug
-import im.vector.app.core.platform.VectorBaseActivity
-import im.vector.app.databinding.ActivityDebugButtonStylesBinding
+import android.os.Bundle
+import androidx.appcompat.app.AppCompatActivity
+import im.vector.lib.ui.styles.databinding.ActivityDebugButtonStylesBinding
-class DebugVectorButtonStylesActivity : VectorBaseActivity() {
- override fun getBinding() = ActivityDebugButtonStylesBinding.inflate(layoutInflater)
+class DebugVectorButtonStylesActivity : AppCompatActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ val views = ActivityDebugButtonStylesBinding.inflate(layoutInflater)
+ setContentView(views.root)
+ }
}
diff --git a/library/ui-styles/src/debug/res/drawable/ic_debug_icon.xml b/library/ui-styles/src/debug/res/drawable/ic_debug_icon.xml
new file mode 100644
index 0000000000..08af7d6539
--- /dev/null
+++ b/library/ui-styles/src/debug/res/drawable/ic_debug_icon.xml
@@ -0,0 +1,22 @@
+
+
+
+
diff --git a/vector/src/debug/res/drawable/linear_divider.xml b/library/ui-styles/src/debug/res/drawable/linear_divider.xml
similarity index 100%
rename from vector/src/debug/res/drawable/linear_divider.xml
rename to library/ui-styles/src/debug/res/drawable/linear_divider.xml
diff --git a/vector/src/debug/res/layout/activity_debug_button_styles.xml b/library/ui-styles/src/debug/res/layout/activity_debug_button_styles.xml
similarity index 100%
rename from vector/src/debug/res/layout/activity_debug_button_styles.xml
rename to library/ui-styles/src/debug/res/layout/activity_debug_button_styles.xml
diff --git a/vector/src/debug/res/layout/activity_test_material_theme.xml b/library/ui-styles/src/debug/res/layout/activity_test_material_theme.xml
similarity index 97%
rename from vector/src/debug/res/layout/activity_test_material_theme.xml
rename to library/ui-styles/src/debug/res/layout/activity_test_material_theme.xml
index c228377b98..20ad972096 100644
--- a/vector/src/debug/res/layout/activity_test_material_theme.xml
+++ b/library/ui-styles/src/debug/res/layout/activity_test_material_theme.xml
@@ -330,7 +330,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Classic"
- app:icon="@drawable/ic_settings_x" />
+ app:icon="@drawable/ic_debug_icon" />
+ app:icon="@drawable/ic_debug_icon" />
+ app:icon="@drawable/ic_debug_icon" />
+ app:icon="@drawable/ic_debug_icon" />
+ app:icon="@drawable/ic_debug_icon" />
+ app:icon="@drawable/ic_debug_icon" />
+ app:icon="@drawable/ic_debug_icon" />
+ app:icon="@drawable/ic_debug_icon" />
+ android:src="@drawable/ic_debug_icon" />
+ app:menu="@menu/menu_debug" />
diff --git a/vector/src/debug/res/layout/debug_text_view.xml b/library/ui-styles/src/debug/res/layout/debug_text_view.xml
similarity index 100%
rename from vector/src/debug/res/layout/debug_text_view.xml
rename to library/ui-styles/src/debug/res/layout/debug_text_view.xml
diff --git a/library/ui-styles/src/debug/res/menu/menu_debug.xml b/library/ui-styles/src/debug/res/menu/menu_debug.xml
new file mode 100644
index 0000000000..c58a29db8f
--- /dev/null
+++ b/library/ui-styles/src/debug/res/menu/menu_debug.xml
@@ -0,0 +1,19 @@
+
+
\ No newline at end of file
diff --git a/vector/src/debug/res/values/debug_styles.xml b/library/ui-styles/src/debug/res/values/debug_styles.xml
similarity index 100%
rename from vector/src/debug/res/values/debug_styles.xml
rename to library/ui-styles/src/debug/res/values/debug_styles.xml
diff --git a/library/ui-styles/src/main/AndroidManifest.xml b/library/ui-styles/src/main/AndroidManifest.xml
index a144066b26..19aa89e2e7 100644
--- a/library/ui-styles/src/main/AndroidManifest.xml
+++ b/library/ui-styles/src/main/AndroidManifest.xml
@@ -1,2 +1,2 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/vector/src/release/res/values/styles.xml b/library/ui-styles/src/release/res/values/styles.xml
similarity index 100%
rename from vector/src/release/res/values/styles.xml
rename to library/ui-styles/src/release/res/values/styles.xml
diff --git a/vector/src/debug/AndroidManifest.xml b/vector/src/debug/AndroidManifest.xml
index 95066bb44f..b97384099f 100644
--- a/vector/src/debug/AndroidManifest.xml
+++ b/vector/src/debug/AndroidManifest.xml
@@ -5,27 +5,6 @@
-
-
-
-
-
-
-
diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMenuActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMenuActivity.kt
index 65a24c9aeb..90dccc0437 100644
--- a/vector/src/debug/java/im/vector/app/features/debug/DebugMenuActivity.kt
+++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMenuActivity.kt
@@ -37,6 +37,13 @@ import im.vector.app.core.utils.toast
import im.vector.app.databinding.ActivityDebugMenuBinding
import im.vector.app.features.debug.sas.DebugSasEmojiActivity
import im.vector.app.features.qrcode.QrCodeScannerActivity
+import im.vector.lib.ui.styles.debug.DebugMaterialThemeDarkDefaultActivity
+import im.vector.lib.ui.styles.debug.DebugMaterialThemeDarkTestActivity
+import im.vector.lib.ui.styles.debug.DebugMaterialThemeDarkVectorActivity
+import im.vector.lib.ui.styles.debug.DebugMaterialThemeLightDefaultActivity
+import im.vector.lib.ui.styles.debug.DebugMaterialThemeLightTestActivity
+import im.vector.lib.ui.styles.debug.DebugMaterialThemeLightVectorActivity
+import im.vector.lib.ui.styles.debug.DebugVectorButtonStylesActivity
import org.matrix.android.sdk.internal.crypto.verification.qrcode.toQrCodeData
import timber.log.Timber
diff --git a/vector/src/debug/res/menu/menu_debug.xml b/vector/src/debug/res/menu/menu_debug.xml
deleted file mode 100644
index c4fdaa435d..0000000000
--- a/vector/src/debug/res/menu/menu_debug.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
\ No newline at end of file