Skip to content

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

mobile: set default widget size

Ammar Ahmede67e6374c30f
diff --git a/apps/mobile/native/android/app/src/main/AndroidManifest.xml b/apps/mobile/native/android/app/src/main/AndroidManifest.xml
index 791fa0098..2d487798c 100644
--- a/apps/mobile/native/android/app/src/main/AndroidManifest.xml
+++ b/apps/mobile/native/android/app/src/main/AndroidManifest.xml
@@ -70,7 +70,7 @@
<meta-data
android:name="android.appwidget.provider"
- android:resource="@xml/note_widget_info" />
+ android:resource="@xml/new_note_widget_info" />
</receiver>
<activity
diff --git a/apps/mobile/native/android/app/src/main/java/com/streetwriters/notesnook/NoteWidget.java b/apps/mobile/native/android/app/src/main/java/com/streetwriters/notesnook/NoteWidget.java
index 5c3d4efe7..e719c22ae 100644
--- a/apps/mobile/native/android/app/src/main/java/com/streetwriters/notesnook/NoteWidget.java
+++ b/apps/mobile/native/android/app/src/main/java/com/streetwriters/notesnook/NoteWidget.java
@@ -50,14 +50,4 @@ public class NoteWidget extends AppWidgetProvider {
updateAppWidget(context, appWidgetManager, appWidgetId,null);
}
}
-
- @Override
- public void onEnabled(Context context) {
- // Enter relevant functionality for when the first widget is created
- }
-
- @Override
- public void onDisabled(Context context) {
- // Enter relevant functionality for when the last widget is disabled
- }
}
\ No newline at end of file
diff --git a/apps/mobile/native/android/app/src/main/res/xml-v31/new_note_widget_info.xml b/apps/mobile/native/android/app/src/main/res/xml-v31/new_note_widget_info.xml
new file mode 100644
index 000000000..459445aa5
--- /dev/null
+++ b/apps/mobile/native/android/app/src/main/res/xml-v31/new_note_widget_info.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
+ android:initialKeyguardLayout="@layout/note_widget"
+ android:initialLayout="@layout/note_widget"
+ android:minWidth="50dp"
+ android:minHeight="50dp"
+ android:targetCellWidth="5"
+ android:targetCellHeight="1"
+ android:previewImage="@drawable/widget_preview"
+ android:resizeMode="horizontal|vertical"
+ android:updatePeriodMillis="86400000"
+ android:widgetCategory="home_screen"/>
\ No newline at end of file
diff --git a/apps/mobile/native/android/app/src/main/res/xml/note_widget_info.xml b/apps/mobile/native/android/app/src/main/res/xml/new_note_widget_info.xml
similarity index 100%
rename from apps/mobile/native/android/app/src/main/res/xml/note_widget_info.xml
rename to apps/mobile/native/android/app/src/main/res/xml/new_note_widget_info.xml