mirror of https://github.com/nextcloud/android
add disctinct actions to the upload list categories + clear menu action via toolbar (for now)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
8a36f720e5
commit
6a2193de8d
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>
|
After Width: | Height: | Size: 404 B |
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M12,18A6,6 0 0,1 6,12C6,11 6.25,10.03 6.7,9.2L5.24,7.74C4.46,8.97 4,10.43 4,12A8,8 0 0,0 12,20V23L16,19L12,15M12,4V1L8,5L12,9V6A6,6 0 0,1 18,12C18,13 17.75,13.97 17.3,14.8L18.76,16.26C19.54,15.03 20,13.57 20,12A8,8 0 0,0 12,4Z" /></svg>
|
After Width: | Height: | Size: 521 B |
|
@ -30,6 +30,8 @@ import android.content.IntentFilter;
|
|||
import android.content.ServiceConnection;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
@ -74,6 +76,8 @@ public class UploadListActivity extends FileActivity {
|
|||
|
||||
private static final String TAG = UploadListActivity.class.getSimpleName();
|
||||
|
||||
private UploadsStorageManager uploadStorageManager;
|
||||
|
||||
private UploadMessagesReceiver mUploadMessagesReceiver;
|
||||
|
||||
private UploadListAdapter uploadListAdapter;
|
||||
|
@ -112,6 +116,8 @@ public class UploadListActivity extends FileActivity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
uploadStorageManager = new UploadsStorageManager(getContentResolver(), getApplicationContext());
|
||||
|
||||
setContentView(R.layout.upload_list_layout);
|
||||
unbinder = ButterKnife.bind(this);
|
||||
|
||||
|
@ -232,6 +238,14 @@ public class UploadListActivity extends FileActivity {
|
|||
Log_OC.v(TAG, "onPause() end");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.upload_list_menu, menu);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
boolean retval = true;
|
||||
|
@ -243,6 +257,10 @@ public class UploadListActivity extends FileActivity {
|
|||
openDrawer();
|
||||
}
|
||||
break;
|
||||
case R.id.action_clear_failed_uploads:
|
||||
uploadStorageManager.clearFailedButNotDelayedUploads();
|
||||
uploadListAdapter.loadUploadItemsFromDb();
|
||||
break;
|
||||
|
||||
default:
|
||||
retval = super.onOptionsItemSelected(item);
|
||||
|
|
|
@ -96,7 +96,19 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter<SectionedVie
|
|||
toggleSectionExpanded(section);
|
||||
});
|
||||
|
||||
headerViewHolder.delete.setOnClickListener(v -> {
|
||||
switch (group.type) {
|
||||
case CURRENT:
|
||||
headerViewHolder.action.setImageResource(R.drawable.ic_close);
|
||||
break;
|
||||
case FINISHED:
|
||||
headerViewHolder.action.setImageResource(R.drawable.ic_close);
|
||||
break;
|
||||
case FAILED:
|
||||
headerViewHolder.action.setImageResource(R.drawable.ic_sync);
|
||||
break;
|
||||
}
|
||||
|
||||
headerViewHolder.action.setOnClickListener(v -> {
|
||||
switch (group.type) {
|
||||
case CURRENT:
|
||||
FileUploader.FileUploaderBinder uploaderBinder = parentActivity.getFileUploaderBinder();
|
||||
|
@ -111,7 +123,8 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter<SectionedVie
|
|||
uploadsStorageManager.clearSuccessfulUploads();
|
||||
break;
|
||||
case FAILED:
|
||||
uploadsStorageManager.clearFailedButNotDelayedUploads();
|
||||
new Thread(() -> new FileUploader.UploadRequester()
|
||||
.retryFailedUploads(parentActivity, null, null)).start();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -591,8 +604,8 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter<SectionedVie
|
|||
@BindView(R.id.upload_list_title)
|
||||
TextView title;
|
||||
|
||||
@BindView(R.id.upload_list_delete)
|
||||
ImageView delete;
|
||||
@BindView(R.id.upload_list_action)
|
||||
ImageView action;
|
||||
|
||||
HeaderViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<!-- drawable/close.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#757575" android:pathData="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" />
|
||||
</vector>
|
|
@ -0,0 +1,8 @@
|
|||
<!-- drawable/sync.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#757575" android:pathData="M12,18A6,6 0 0,1 6,12C6,11 6.25,10.03 6.7,9.2L5.24,7.74C4.46,8.97 4,10.43 4,12A8,8 0 0,0 12,20V23L16,19L12,15M12,4V1L8,5L12,9V6A6,6 0 0,1 18,12C18,13 17.75,13.97 17.3,14.8L18.76,16.26C19.54,15.03 20,13.57 20,12A8,8 0 0,0 12,4Z" />
|
||||
</vector>
|
|
@ -21,13 +21,12 @@
|
|||
License along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/ListItemLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/standard_half_padding">
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/upload_list_title"
|
||||
|
@ -36,14 +35,23 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:ellipsize="middle"
|
||||
android:textColor="@color/color_accent"
|
||||
tools:text="Current (2)" />
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
tools:text="Current (2)"
|
||||
android:padding="@dimen/standard_half_padding"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/upload_list_delete"
|
||||
android:id="@+id/upload_list_action"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/standard_half_padding"
|
||||
android:paddingStart="@dimen/standard_half_padding"
|
||||
android:paddingEnd="@dimen/zero"
|
||||
android:paddingRight="@dimen/zero"
|
||||
android:paddingTop="@dimen/standard_half_padding"
|
||||
android:paddingBottom="@dimen/standard_half_padding"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:contentDescription="@string/delete_entries"
|
||||
android:src="@drawable/nav_trashbin" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
android:id="@+id/upload_right_button"
|
||||
android:layout_width="@dimen/upload_list_item_image_size"
|
||||
android:layout_height="@dimen/upload_list_item_image_size"
|
||||
android:layout_gravity="center"
|
||||
android:layout_gravity="center|end"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/upload_item_action_button" />
|
||||
</FrameLayout>
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Nextcloud Android client application
|
||||
|
||||
Copyright (C) 2012 Bartek Przybylski
|
||||
Copyright (C) 2012-2013 ownCloud Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2,
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<group
|
||||
android:id="@+id/upload_list_actions"
|
||||
android:checkableBehavior="none">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_clear_failed_uploads"
|
||||
android:title="@string/action_clear_failed_uploads" />
|
||||
</group>
|
||||
</menu>
|
|
@ -82,7 +82,7 @@
|
|||
<dimen name="scroll_view_height">180dp</dimen>
|
||||
<dimen name="upload_list_item_frame_layout_width">60dp</dimen>
|
||||
<dimen name="upload_list_item_text_size">12sp</dimen>
|
||||
<dimen name="upload_list_item_image_size">35dp</dimen>
|
||||
<dimen name="upload_list_item_image_size">24dp</dimen>
|
||||
<dimen name="uploader_list_item_layout_image_margin">12dp</dimen>
|
||||
<dimen name="media_grid_spacing">2dp</dimen>
|
||||
<dimen name="account_item_layout_user_image_left_start_margin">12dp</dimen>
|
||||
|
|
|
@ -513,6 +513,8 @@
|
|||
<string name="share_privilege_can_edit_change">can change</string>
|
||||
<string name="share_privilege_can_edit_delete">can delete</string>
|
||||
|
||||
<string name="action_clear_failed_uploads">Clear failed uploads</string>
|
||||
|
||||
<string name="action_switch_grid_view">Grid view</string>
|
||||
<string name="action_switch_list_view">List view</string>
|
||||
|
||||
|
|
Loading…
Reference in New Issue