#238 Introduce a trashbin (Link to Webinterface)

This commit is contained in:
Niedermann IT-Dienstleistungen 2018-08-24 11:00:46 +02:00 committed by Niedermann IT-Dienstleistungen
parent f265e6a531
commit 27303d6c21
3 changed files with 15 additions and 0 deletions

View file

@ -2,11 +2,14 @@ package it.niedermann.owncloud.notes.android.activity;
import android.app.SearchManager;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Canvas;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
@ -331,10 +334,12 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
}
private void setupNavigationMenu() {
final NavigationAdapter.NavigationItem itemTrashbin = new NavigationAdapter.NavigationItem("trashbin", getString(R.string.action_trashbin), null, R.drawable.ic_delete_grey600_24dp);
final NavigationAdapter.NavigationItem itemSettings = new NavigationAdapter.NavigationItem("settings", getString(R.string.action_settings), null, R.drawable.ic_settings_grey600_24dp);
final NavigationAdapter.NavigationItem itemAbout = new NavigationAdapter.NavigationItem("about", getString(R.string.simple_about), null, R.drawable.ic_info_outline_grey600_24dp);
ArrayList<NavigationAdapter.NavigationItem> itemsMenu = new ArrayList<>();
itemsMenu.add(itemTrashbin);
itemsMenu.add(itemSettings);
itemsMenu.add(itemAbout);
@ -347,6 +352,10 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
} else if (item == itemAbout) {
Intent aboutIntent = new Intent(getApplicationContext(), AboutActivity.class);
startActivityForResult(aboutIntent, about);
} else if (item == itemTrashbin) {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
preferences.getString(SettingsActivity.SETTINGS_URL, SettingsActivity.DEFAULT_SETTINGS);
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(preferences.getString(SettingsActivity.SETTINGS_URL, SettingsActivity.DEFAULT_SETTINGS) + "index.php/apps/files/?dir=/&view=trashbin")));
}
}

View file

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#757575"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF757575" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>

View file

@ -7,6 +7,7 @@
<string name="label_favorites">Favorites</string>
<string name="action_create">New note</string>
<string name="action_settings">Settings</string>
<string name="action_trashbin">Deleted notes</string>
<string name="action_search">Search</string>
<string name="action_create_save">Save</string>
<string name="simple_cancel">Cancel</string>