Loading app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java +9 −11 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap shortcutManager.addDynamicShortcuts(newShortcuts); } } }).run(); }).start(); } @Override Loading Loading @@ -381,11 +381,11 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap adapterCategories.setSelectedItem(item.id); // update current selection if (itemRecent == item) { if (itemRecent.equals(item)) { navigationSelection = new Category(null, null); } else if (itemFavorites == item) { } else if (itemFavorites.equals(item)) { navigationSelection = new Category(null, true); } else if (itemUncategorized == item) { } else if (itemUncategorized.equals(item)) { navigationSelection = new Category("", null); } else { navigationSelection = new Category(item.label, null); Loading Loading @@ -531,18 +531,16 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap NavigationAdapter adapterMenu = new NavigationAdapter(new NavigationAdapter.ClickListener() { @Override public void onItemClick(NavigationAdapter.NavigationItem item) { if (item == itemSettings) { if (itemSettings.equals(item)) { Intent settingsIntent = new Intent(getApplicationContext(), PreferencesActivity.class); startActivityForResult(settingsIntent, server_settings); } else if (item == itemAbout) { } else if (itemAbout.equals(item)) { Intent aboutIntent = new Intent(getApplicationContext(), AboutActivity.class); startActivityForResult(aboutIntent, about); } else if (item == itemTrashbin) { if (localAccount != null) { } else if (itemTrashbin.equals(item) && localAccount != null) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(localAccount.getUrl() + "/index.php/apps/files/?dir=/&view=trashbin"))); } } } @Override public void onIconClick(NavigationAdapter.NavigationItem item) { Loading app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidget.java +1 −1 Original line number Diff line number Diff line Loading @@ -147,7 +147,7 @@ public class NoteListWidget extends AppWidgetProvider { case NoteListWidget.NLW_DISPLAY_STARRED: return context.getString(R.string.label_favorites); case NoteListWidget.NLW_DISPLAY_CATEGORY: if (category.equals("")) { if ("".equals(category)) { return context.getString(R.string.action_uncategorized); } else { return category; Loading app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidgetConfiguration.java +2 −2 Original line number Diff line number Diff line Loading @@ -86,9 +86,9 @@ public class NoteListWidgetConfiguration extends AppCompatActivity { public void onItemClick(NavigationAdapter.NavigationItem item) { SharedPreferences.Editor sp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit(); if (item == itemRecent) { if (itemRecent.equals(item)) { sp.putInt(NoteListWidget.WIDGET_MODE_KEY + appWidgetId, NoteListWidget.NLW_DISPLAY_ALL); } else if (item == itemFavorites) { } else if (itemFavorites.equals(item)) { sp.putInt(NoteListWidget.WIDGET_MODE_KEY + appWidgetId, NoteListWidget.NLW_DISPLAY_STARRED); } else { String category = ""; Loading app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidgetFactory.java +2 −4 Original line number Diff line number Diff line Loading @@ -20,19 +20,17 @@ import it.niedermann.owncloud.notes.persistence.NoteSQLiteOpenHelper; public class NoteListWidgetFactory implements RemoteViewsService.RemoteViewsFactory { private final Context context; private final int displayMode; private final int appWidgetId; private final boolean darkTheme; private String category; private final SharedPreferences sp; private NoteSQLiteOpenHelper db; private List<DBNote> dbNotes; private long accountId; NoteListWidgetFactory(Context context, Intent intent) { this.context = context; appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, final int appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); sp = PreferenceManager.getDefaultSharedPreferences(this.context); final SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this.context); displayMode = sp.getInt(NoteListWidget.WIDGET_MODE_KEY + appWidgetId, -1); darkTheme = sp.getBoolean(NoteListWidget.DARK_THEME_KEY + appWidgetId, false); category = sp.getString(NoteListWidget.WIDGET_CATEGORY_KEY + appWidgetId, ""); Loading app/src/main/java/it/niedermann/owncloud/notes/android/fragment/BaseNoteFragment.java +6 −6 Original line number Diff line number Diff line Loading @@ -48,12 +48,6 @@ public abstract class BaseNoteFragment extends Fragment implements CategoryDialo private static final String TAG = BaseNoteFragment.class.getSimpleName(); public interface NoteFragmentListener { void close(); void onNoteUpdated(DBNote note); } private static final int MENU_ID_PIN = -1; public static final String PARAM_NOTE_ID = "noteId"; public static final String PARAM_ACCOUNT_ID = "accountId"; Loading Loading @@ -393,4 +387,10 @@ public abstract class BaseNoteFragment extends Fragment implements CategoryDialo db.setCategory(note, category, null); listener.onNoteUpdated(note); } public interface NoteFragmentListener { void close(); void onNoteUpdated(DBNote note); } } Loading
app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java +9 −11 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap shortcutManager.addDynamicShortcuts(newShortcuts); } } }).run(); }).start(); } @Override Loading Loading @@ -381,11 +381,11 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap adapterCategories.setSelectedItem(item.id); // update current selection if (itemRecent == item) { if (itemRecent.equals(item)) { navigationSelection = new Category(null, null); } else if (itemFavorites == item) { } else if (itemFavorites.equals(item)) { navigationSelection = new Category(null, true); } else if (itemUncategorized == item) { } else if (itemUncategorized.equals(item)) { navigationSelection = new Category("", null); } else { navigationSelection = new Category(item.label, null); Loading Loading @@ -531,18 +531,16 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap NavigationAdapter adapterMenu = new NavigationAdapter(new NavigationAdapter.ClickListener() { @Override public void onItemClick(NavigationAdapter.NavigationItem item) { if (item == itemSettings) { if (itemSettings.equals(item)) { Intent settingsIntent = new Intent(getApplicationContext(), PreferencesActivity.class); startActivityForResult(settingsIntent, server_settings); } else if (item == itemAbout) { } else if (itemAbout.equals(item)) { Intent aboutIntent = new Intent(getApplicationContext(), AboutActivity.class); startActivityForResult(aboutIntent, about); } else if (item == itemTrashbin) { if (localAccount != null) { } else if (itemTrashbin.equals(item) && localAccount != null) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(localAccount.getUrl() + "/index.php/apps/files/?dir=/&view=trashbin"))); } } } @Override public void onIconClick(NavigationAdapter.NavigationItem item) { Loading
app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidget.java +1 −1 Original line number Diff line number Diff line Loading @@ -147,7 +147,7 @@ public class NoteListWidget extends AppWidgetProvider { case NoteListWidget.NLW_DISPLAY_STARRED: return context.getString(R.string.label_favorites); case NoteListWidget.NLW_DISPLAY_CATEGORY: if (category.equals("")) { if ("".equals(category)) { return context.getString(R.string.action_uncategorized); } else { return category; Loading
app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidgetConfiguration.java +2 −2 Original line number Diff line number Diff line Loading @@ -86,9 +86,9 @@ public class NoteListWidgetConfiguration extends AppCompatActivity { public void onItemClick(NavigationAdapter.NavigationItem item) { SharedPreferences.Editor sp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit(); if (item == itemRecent) { if (itemRecent.equals(item)) { sp.putInt(NoteListWidget.WIDGET_MODE_KEY + appWidgetId, NoteListWidget.NLW_DISPLAY_ALL); } else if (item == itemFavorites) { } else if (itemFavorites.equals(item)) { sp.putInt(NoteListWidget.WIDGET_MODE_KEY + appWidgetId, NoteListWidget.NLW_DISPLAY_STARRED); } else { String category = ""; Loading
app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidgetFactory.java +2 −4 Original line number Diff line number Diff line Loading @@ -20,19 +20,17 @@ import it.niedermann.owncloud.notes.persistence.NoteSQLiteOpenHelper; public class NoteListWidgetFactory implements RemoteViewsService.RemoteViewsFactory { private final Context context; private final int displayMode; private final int appWidgetId; private final boolean darkTheme; private String category; private final SharedPreferences sp; private NoteSQLiteOpenHelper db; private List<DBNote> dbNotes; private long accountId; NoteListWidgetFactory(Context context, Intent intent) { this.context = context; appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, final int appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); sp = PreferenceManager.getDefaultSharedPreferences(this.context); final SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this.context); displayMode = sp.getInt(NoteListWidget.WIDGET_MODE_KEY + appWidgetId, -1); darkTheme = sp.getBoolean(NoteListWidget.DARK_THEME_KEY + appWidgetId, false); category = sp.getString(NoteListWidget.WIDGET_CATEGORY_KEY + appWidgetId, ""); Loading
app/src/main/java/it/niedermann/owncloud/notes/android/fragment/BaseNoteFragment.java +6 −6 Original line number Diff line number Diff line Loading @@ -48,12 +48,6 @@ public abstract class BaseNoteFragment extends Fragment implements CategoryDialo private static final String TAG = BaseNoteFragment.class.getSimpleName(); public interface NoteFragmentListener { void close(); void onNoteUpdated(DBNote note); } private static final int MENU_ID_PIN = -1; public static final String PARAM_NOTE_ID = "noteId"; public static final String PARAM_ACCOUNT_ID = "accountId"; Loading Loading @@ -393,4 +387,10 @@ public abstract class BaseNoteFragment extends Fragment implements CategoryDialo db.setCategory(note, category, null); listener.onNoteUpdated(note); } public interface NoteFragmentListener { void close(); void onNoteUpdated(DBNote note); } }