Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: remove dead widget theme overlay, use system corner radius

Ammar Ahmed93337b656074
diff --git a/apps/mobile/android/app/src/main/res/drawable/layout_bg.xml b/apps/mobile/android/app/src/main/res/drawable/layout_bg.xml
index 4e9108ff5..af55a9847 100644
--- a/apps/mobile/android/app/src/main/res/drawable/layout_bg.xml
+++ b/apps/mobile/android/app/src/main/res/drawable/layout_bg.xml
@@ -2,6 +2,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/background"/>
<stroke android:width="0dp" android:color="#B1BCBE" />
- <corners android:radius="10dp"/>
+ <corners android:radius="@dimen/widget_background_radius"/>
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>
\ No newline at end of file
diff --git a/apps/mobile/android/app/src/main/res/layout/new_note_widget.xml b/apps/mobile/android/app/src/main/res/layout/new_note_widget.xml
index 622886bd1..70bb73b1b 100644
--- a/apps/mobile/android/app/src/main/res/layout/new_note_widget.xml
+++ b/apps/mobile/android/app/src/main/res/layout/new_note_widget.xml
@@ -2,8 +2,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@android:color/transparent"
- android:theme="@style/ThemeOverlay.Notesnook.AppWidgetContainer">
+ android:background="@android:color/transparent">
<LinearLayout
android:layout_width="match_parent"
diff --git a/apps/mobile/android/app/src/main/res/layout/note_widget.xml b/apps/mobile/android/app/src/main/res/layout/note_widget.xml
index 2eecacfb2..2f37a370c 100644
--- a/apps/mobile/android/app/src/main/res/layout/note_widget.xml
+++ b/apps/mobile/android/app/src/main/res/layout/note_widget.xml
@@ -2,8 +2,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@android:color/transparent"
- android:theme="@style/ThemeOverlay.Notesnook.AppWidgetContainer">
+ android:background="@android:color/transparent">
<LinearLayout
android:layout_width="match_parent"
diff --git a/apps/mobile/android/app/src/main/res/layout/note_widget_preview.xml b/apps/mobile/android/app/src/main/res/layout/note_widget_preview.xml
index 710b74aa9..35c3cd7c6 100644
--- a/apps/mobile/android/app/src/main/res/layout/note_widget_preview.xml
+++ b/apps/mobile/android/app/src/main/res/layout/note_widget_preview.xml
@@ -5,8 +5,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@android:color/transparent"
- android:theme="@style/ThemeOverlay.Notesnook.AppWidgetContainer">
+ android:background="@android:color/transparent">
<LinearLayout
android:layout_width="match_parent"
diff --git a/apps/mobile/android/app/src/main/res/values-night/colors.xml b/apps/mobile/android/app/src/main/res/values-night/colors.xml
index f1c79618b..3b836d0a6 100644
--- a/apps/mobile/android/app/src/main/res/values-night/colors.xml
+++ b/apps/mobile/android/app/src/main/res/values-night/colors.xml
@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <color name="light_blue_50">#FFE1F5FE</color>
- <color name="light_blue_200">#FF81D4FA</color>
- <color name="light_blue_600">#FF039BE5</color>
- <color name="light_blue_900">#FF01579B</color>
<color name="bootsplash_background">#1f1f1f</color>
<color name="background">#1D1D1D</color>
<color name="border">#2E2E2E</color>
diff --git a/apps/mobile/android/app/src/main/res/values-v31/dimens.xml b/apps/mobile/android/app/src/main/res/values-v31/dimens.xml
new file mode 100644
index 000000000..c3e87c9e4
--- /dev/null
+++ b/apps/mobile/android/app/src/main/res/values-v31/dimens.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <!-- Android 12 onwards the launcher tells us what radius widgets should use, so ours line up
+ with every other widget on the home screen instead of being a fixed 10dp. -->
+ <dimen name="widget_background_radius">@android:dimen/system_app_widget_background_radius</dimen>
+
+</resources>
diff --git a/apps/mobile/android/app/src/main/res/values/attrs.xml b/apps/mobile/android/app/src/main/res/values/attrs.xml
deleted file mode 100644
index 97531a256..000000000
--- a/apps/mobile/android/app/src/main/res/values/attrs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<resources>
- <declare-styleable name="AppWidgetAttrs">
- <attr name="appWidgetBackgroundColor" format="color" />
- <attr name="appWidgetTextColor" format="color" />
- </declare-styleable>
-</resources>
\ No newline at end of file
diff --git a/apps/mobile/android/app/src/main/res/values/colors.xml b/apps/mobile/android/app/src/main/res/values/colors.xml
index 4ac8bc762..ab4d9ecc4 100644
--- a/apps/mobile/android/app/src/main/res/values/colors.xml
+++ b/apps/mobile/android/app/src/main/res/values/colors.xml
@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <color name="light_blue_50">#FFE1F5FE</color>
- <color name="light_blue_200">#FF81D4FA</color>
- <color name="light_blue_600">#FF039BE5</color>
- <color name="light_blue_900">#FF01579B</color>
<color name="bootsplash_background">#FFFFFF</color>
<color name="background">#DCEDEDED</color>
<color name="border">#BFBFBF</color>
diff --git a/apps/mobile/android/app/src/main/res/values/dimens.xml b/apps/mobile/android/app/src/main/res/values/dimens.xml
index 4db8c5906..7aa2b16bc 100644
--- a/apps/mobile/android/app/src/main/res/values/dimens.xml
+++ b/apps/mobile/android/app/src/main/res/values/dimens.xml
@@ -7,4 +7,8 @@ http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
-->
<dimen name="widget_margin">0dp</dimen>
+ <!-- Overridden in values-v31 with the platform's own widget radius, so our widgets match the
+ rest of the home screen. This is the fallback for older versions. -->
+ <dimen name="widget_background_radius">10dp</dimen>
+
</resources>
\ No newline at end of file
diff --git a/apps/mobile/android/app/src/main/res/values/themes.xml b/apps/mobile/android/app/src/main/res/values/themes.xml
deleted file mode 100644
index 935088e01..000000000
--- a/apps/mobile/android/app/src/main/res/values/themes.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<resources>
-
- <style name="ThemeOverlay.Notesnook.AppWidgetContainer" parent="">
- <item name="appWidgetBackgroundColor">@color/light_blue_600</item>
- <item name="appWidgetTextColor">@color/light_blue_50</item>
- </style>
-</resources>
\ No newline at end of file