move appwidget-code into separate package

This commit is contained in:
korelstar 2018-02-28 19:23:24 +01:00
parent 42bc66aedd
commit 62d15b4fd7
12 changed files with 27 additions and 43 deletions

View file

@ -91,7 +91,7 @@
</activity>
<activity
android:name="it.niedermann.owncloud.notes.android.activity.NoteListWidgetConfiguration">
android:name=".android.appwidget.NoteListWidgetConfiguration">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
@ -99,7 +99,7 @@
</activity>
<receiver
android:name=".android.activity.CreateNoteWidget"
android:name=".android.appwidget.CreateNoteWidget"
android:label="@string/widget_create_note">
<intent-filter>
@ -112,7 +112,7 @@
</receiver>
<receiver
android:name="it.niedermann.owncloud.notes.android.activity.SingleNoteWidget"
android:name="it.niedermann.owncloud.notes.android.appwidget.SingleNoteWidget"
android:label="@string/widget_single_note_title">
<intent-filter>
@ -125,7 +125,7 @@
</receiver>
<receiver
android:name="it.niedermann.owncloud.notes.android.activity.NoteListWidget"
android:name="it.niedermann.owncloud.notes.android.appwidget.NoteListWidget"
android:label="@string/widget_note_list_title">
<intent-filter>
@ -138,11 +138,11 @@
</receiver>
<service
android:name=".persistence.SingleNoteWidgetService"
android:name=".android.appwidget.SingleNoteWidgetService"
android:permission="android.permission.BIND_REMOTEVIEWS" />
<service
android:name=".persistence.NoteListWidgetService"
android:name=".android.appwidget.NoteListWidgetService"
android:permission="android.permission.BIND_REMOTEVIEWS" />
</application>

View file

@ -11,6 +11,7 @@ import android.view.Menu;
import android.view.View;
import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.android.appwidget.SingleNoteWidget;
import it.niedermann.owncloud.notes.model.DBNote;
import it.niedermann.owncloud.notes.model.Item;
import it.niedermann.owncloud.notes.model.ItemAdapter;

View file

@ -1,4 +1,4 @@
package it.niedermann.owncloud.notes.android.activity;
package it.niedermann.owncloud.notes.android.appwidget;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
@ -8,6 +8,7 @@ import android.content.Intent;
import android.widget.RemoteViews;
import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.android.activity.CreateNoteActivity;
/**
* Implementation of App Widget functionality.

View file

@ -1,4 +1,4 @@
package it.niedermann.owncloud.notes.android.activity;
package it.niedermann.owncloud.notes.android.appwidget;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
@ -10,11 +10,9 @@ import android.net.Uri;
import android.widget.RemoteViews;
import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.persistence.NoteListWidgetService;
/**
* Created by dan0xii on 13/09/2017.
*/
import it.niedermann.owncloud.notes.android.activity.CreateNoteActivity;
import it.niedermann.owncloud.notes.android.activity.EditNoteActivity;
import it.niedermann.owncloud.notes.android.activity.NotesListViewActivity;
public class NoteListWidget extends AppWidgetProvider {

View file

@ -1,4 +1,4 @@
package it.niedermann.owncloud.notes.android.activity;
package it.niedermann.owncloud.notes.android.appwidget;
import android.app.Activity;
import android.appwidget.AppWidgetManager;

View file

@ -1,4 +1,4 @@
package it.niedermann.owncloud.notes.model;
package it.niedermann.owncloud.notes.android.appwidget;
import android.content.Context;
import android.content.Intent;
@ -12,18 +12,15 @@ import java.util.List;
import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.android.activity.EditNoteActivity;
import it.niedermann.owncloud.notes.model.DBNote;
import it.niedermann.owncloud.notes.persistence.NoteSQLiteOpenHelper;
/**
* Created by dan0xii on 13/09/2017.
*/
public class NoteListWidgetFactory implements RemoteViewsService.RemoteViewsFactory {
private final Context mContext;
private NoteSQLiteOpenHelper db;
private List<DBNote> dbNotes;
public NoteListWidgetFactory(Context context, Intent intent) {
NoteListWidgetFactory(Context context, Intent intent) {
mContext = context;
}

View file

@ -1,14 +1,8 @@
package it.niedermann.owncloud.notes.persistence;
package it.niedermann.owncloud.notes.android.appwidget;
import android.content.Intent;
import android.widget.RemoteViewsService;
import it.niedermann.owncloud.notes.model.NoteListWidgetFactory;
/**
* Created by dan0xii on 13/09/2017.
*/
public class NoteListWidgetService extends RemoteViewsService {
@Override
public RemoteViewsFactory onGetViewFactory(Intent intent) {

View file

@ -1,4 +1,4 @@
package it.niedermann.owncloud.notes.android.activity;
package it.niedermann.owncloud.notes.android.appwidget;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
@ -12,7 +12,7 @@ import android.preference.PreferenceManager;
import android.widget.RemoteViews;
import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.persistence.SingleNoteWidgetService;
import it.niedermann.owncloud.notes.android.activity.EditNoteActivity;
import static android.appwidget.AppWidgetManager.ACTION_APPWIDGET_UPDATE;

View file

@ -1,4 +1,4 @@
package it.niedermann.owncloud.notes.model;
package it.niedermann.owncloud.notes.android.appwidget;
import android.appwidget.AppWidgetManager;
import android.content.Context;
@ -12,7 +12,7 @@ import android.widget.RemoteViewsService;
import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.android.activity.EditNoteActivity;
import it.niedermann.owncloud.notes.android.activity.SingleNoteWidget;
import it.niedermann.owncloud.notes.model.DBNote;
import it.niedermann.owncloud.notes.persistence.NoteSQLiteOpenHelper;
public class SingleNoteWidgetFactory implements RemoteViewsService.RemoteViewsFactory {
@ -25,7 +25,7 @@ public class SingleNoteWidgetFactory implements RemoteViewsService.RemoteViewsFa
private static final String TAG = SingleNoteWidget.class.getSimpleName();
public SingleNoteWidgetFactory(Context context, Intent intent) {
SingleNoteWidgetFactory(Context context, Intent intent) {
mContext = context;
mAppWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
AppWidgetManager.INVALID_APPWIDGET_ID);

View file

@ -1,15 +1,8 @@
package it.niedermann.owncloud.notes.persistence;
package it.niedermann.owncloud.notes.android.appwidget;
import android.content.Intent;
import android.widget.RemoteViewsService;
import it.niedermann.owncloud.notes.model.SingleNoteWidgetFactory;
/**
* Created by dan0xii on 06/09/17.
*
*/
public class SingleNoteWidgetService extends RemoteViewsService {
@Override
public RemoteViewsFactory onGetViewFactory(Intent intent) {

View file

@ -21,8 +21,8 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import it.niedermann.owncloud.notes.android.activity.NoteListWidget;
import it.niedermann.owncloud.notes.android.activity.SingleNoteWidget;
import it.niedermann.owncloud.notes.android.appwidget.NoteListWidget;
import it.niedermann.owncloud.notes.android.appwidget.SingleNoteWidget;
import it.niedermann.owncloud.notes.model.CloudNote;
import it.niedermann.owncloud.notes.model.DBNote;
import it.niedermann.owncloud.notes.model.DBStatus;

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:initialLayout="@layout/widget_note_list"
android:configure="it.niedermann.owncloud.notes.android.activity.NoteListWidgetConfiguration"
android:configure="it.niedermann.owncloud.notes.android.appwidget.NoteListWidgetConfiguration"
android:minHeight="110dp"
android:minWidth="180dp"
android:minResizeHeight="40dp"