diff options
author | Stefan Niedermann <info@niedermann.it> | 2021-10-19 09:04:12 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2021-10-19 09:04:12 +0300 |
commit | 22aa08acced74b39a56bfeb96087272a63fe09b0 (patch) | |
tree | f5911436154bf4a84084bcfb0475777acb96d42a /app | |
parent | 225e4b747ae0fc04f07d4dbe0cd37ec47fc338ed (diff) |
- 🚫 Removed "Create note widget" in favor of quick settings tile (in your notification area) and shortcuts (press long on the app icon)
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app')
4 files changed, 0 insertions, 88 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a913213f..7d38f90c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -140,20 +140,6 @@ </activity> <receiver - android:name=".widget.createnote.CreateNoteWidget" - android:label="@string/widget_create_note" - android:exported="true"> - - <intent-filter> - <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> - </intent-filter> - - <meta-data - android:name="android.appwidget.provider" - android:resource="@xml/create_note_widget_provider" /> - </receiver> - - <receiver android:name=".widget.singlenote.SingleNoteWidget" android:label="@string/widget_single_note_title" android:exported="true"> diff --git a/app/src/main/java/it/niedermann/owncloud/notes/widget/createnote/CreateNoteWidget.java b/app/src/main/java/it/niedermann/owncloud/notes/widget/createnote/CreateNoteWidget.java deleted file mode 100644 index 67eb48ee..00000000 --- a/app/src/main/java/it/niedermann/owncloud/notes/widget/createnote/CreateNoteWidget.java +++ /dev/null @@ -1,52 +0,0 @@ -package it.niedermann.owncloud.notes.widget.createnote; - -import static it.niedermann.owncloud.notes.shared.util.WidgetUtil.pendingIntentFlagCompat; - -import android.app.PendingIntent; -import android.appwidget.AppWidgetManager; -import android.appwidget.AppWidgetProvider; -import android.content.Context; -import android.content.Intent; -import android.widget.RemoteViews; - -import it.niedermann.owncloud.notes.R; -import it.niedermann.owncloud.notes.edit.EditNoteActivity; - -/** - * Implementation of App Widget functionality. - */ -public class CreateNoteWidget extends AppWidgetProvider { - - private static void updateAppWidget(Context context, AppWidgetManager appWidgetManager, - int appWidgetId) { - - // Construct the RemoteViews object - final var views = new RemoteViews(context.getPackageName(), R.layout.widget_create_note); - final var intent = new Intent(context, EditNoteActivity.class); - - views.setOnClickPendingIntent(R.id.widget_create_note, PendingIntent.getActivity(context, 0, intent, pendingIntentFlagCompat(PendingIntent.FLAG_UPDATE_CURRENT))); - - // Instruct the widget manager to update the widget - appWidgetManager.updateAppWidget(appWidgetId, views); - } - - @Override - public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { - - // There may be multiple widgets active, so update all of them - for (final int appWidgetId : appWidgetIds) { - updateAppWidget(context, appWidgetManager, appWidgetId); - } - } - - @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 - } -} - diff --git a/app/src/main/res/layout/widget_create_note.xml b/app/src/main/res/layout/widget_create_note.xml deleted file mode 100644 index b101f38d..00000000 --- a/app/src/main/res/layout/widget_create_note.xml +++ /dev/null @@ -1,9 +0,0 @@ -<ImageView xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/widget_create_note" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_margin="@dimen/widget_margin" - android:clickable="true" - android:contentDescription="@string/widget_create_note" - android:focusable="true" - android:src="@drawable/ic_widget_create" />
\ No newline at end of file diff --git a/app/src/main/res/xml/create_note_widget_provider.xml b/app/src/main/res/xml/create_note_widget_provider.xml deleted file mode 100644 index f449ff1e..00000000 --- a/app/src/main/res/xml/create_note_widget_provider.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:initialKeyguardLayout="@layout/widget_create_note" - android:initialLayout="@layout/widget_create_note" - android:minWidth="40dp" - android:minHeight="40dp" - android:previewImage="@drawable/ic_widget_create" - android:resizeMode="none" - android:text="@string/widget_create_note" - android:updatePeriodMillis="86400000" - android:widgetCategory="home_screen" - tools:targetApi="jelly_bean_mr1" />
\ No newline at end of file |