Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reliable uploads #919

Closed
wants to merge 86 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
5af3c6d
cleanup uploader. add comments. uncomment unused functions. rename.
Oct 31, 2014
ac002ce
rename DbHandler to UploadDbHandler. Increase DB version. Fix UploadS…
Oct 31, 2014
64827cf
refactoring, commenting, understanding code. added TODO for FileUploa…
Oct 31, 2014
efe1849
using enums
Nov 4, 2014
1369ef8
made UploadDbObject serializable
Nov 5, 2014
87d1c0e
mActiveUploads
Nov 5, 2014
0d12225
Merge remote-tracking branch 'upstream/develop' into retry_uploads
Nov 5, 2014
05d29d9
test commit
Nov 5, 2014
8ddb9db
test commit
Nov 6, 2014
9d28e9e
commenting, commenting, commenting!
Nov 6, 2014
6d3a3e2
Merge remote-tracking branch 'upstream/develop' into reliable_uploads
Nov 6, 2014
3e9ecca
now upload works again as good (or as bad) as before.
Nov 6, 2014
503bcc3
remove mDb.recreateDb()
Nov 6, 2014
ba7e62e
added first draft of uploadListActivity
Nov 7, 2014
79c3756
undo unintended change
Nov 7, 2014
d59fd3b
consistently use UploadList (instead UploadsList)
Nov 7, 2014
1664d9e
Merge branch 'develop' of github.com:owncloud/android into reliable_u…
Nov 14, 2014
2b85ed5
working on UploadListActivity
Nov 14, 2014
263164a
fix: do upload removed files
Nov 16, 2014
b2d8cec
sort by date
Nov 16, 2014
2ec1c65
fix onclick
Nov 16, 2014
537434d
use file icon
Nov 16, 2014
97aa4e2
Merge branch 'develop' of github.com:owncloud/android into reliable_u…
Nov 20, 2014
4d07fcc
Merge remote-tracking branch 'upstream/develop' into reliable_uploads
Nov 25, 2014
1096f40
making UploadService an IntentService
Nov 25, 2014
71c1bfb
removed obsolete file
Nov 25, 2014
b1e5654
undo classpath change
Nov 25, 2014
df7ca60
fixing double upload issues
Nov 25, 2014
07147e8
start FileUploadService on app start
Nov 26, 2014
e0e9a7c
remove debug cmd
Nov 26, 2014
8f768d8
added click action for UploadListActivity
Nov 26, 2014
d3be204
use FileStorageUtils.fillOCFile in SynchronizeFolderOperation
Nov 26, 2014
8e9cf48
added log output
Nov 26, 2014
39abd71
fixed multiple calls of ConnectivityActionReceiver
Nov 26, 2014
d1386ea
Use OCFile inside UploadDbObject,
Nov 26, 2014
6ca1c34
remove debug tag
Nov 26, 2014
d08e436
open UploadListActivity on click on upload failure notification
Nov 26, 2014
949c2ae
restructuring
Nov 27, 2014
d7499fd
moved upload helpers to UploadUtils
Nov 27, 2014
28de702
prepare delayed uploads
Nov 27, 2014
4018af1
commenting
Nov 27, 2014
37d3a72
add ExpandableListFragment which is inherits from ExtendedListFragment
Nov 27, 2014
eaab185
introduce divisions in upload list view
Nov 27, 2014
397dd7b
fix on click handler
Nov 27, 2014
cf63d7c
remove on long click, add context menu instead
Nov 27, 2014
86eccab
show details on simple click
Nov 27, 2014
7d2f573
added debug output
Nov 27, 2014
4518da5
fix progress notifications
Nov 28, 2014
9445692
fix cancel upload
Nov 28, 2014
9e6d8c1
set charging only default to false
Nov 30, 2014
3dacd24
update db when retrying upload
Nov 30, 2014
7428485
remove not needed service looper
Nov 30, 2014
142b894
display complete LATER reason
Nov 30, 2014
0ff6921
git added filesize
Nov 30, 2014
34b630b
fix store upload debug msg
Nov 30, 2014
982befe
fix GUI output
Nov 30, 2014
99d8243
Merge branch 'develop' of github.com:owncloud/android into reliable_u…
Dec 1, 2014
6ce8112
fix GUI options
Dec 1, 2014
82c7771
comments and less debug output
Dec 1, 2014
30f9abb
comment
Dec 1, 2014
2d0c347
Merge remote-tracking branch 'upstream/develop' into HEAD
Dec 8, 2014
0c0ef54
change upload list layout according to https://github.com/owncloud/an…
Dec 8, 2014
fd6d57f
removed unnecessary items from upload_list_item
Dec 10, 2014
11efd02
use settings layout for upload list (remove group header background, …
Dec 10, 2014
61de793
hide empty upload groups
Dec 10, 2014
3fdb78d
added right button for items in upload list (for cancel, retry, and r…
Dec 12, 2014
0da591d
give upload items as much vertical space as they need (wrap content)
Dec 12, 2014
5632045
refresh upload list on swipe down (this refreshes shown (relative) up…
Dec 12, 2014
6dae38c
allow separately clearing failed and finished uploads
Dec 12, 2014
a8e2cf6
tried to add clear button for upload groups. would be too much.
Dec 12, 2014
b8db750
allow user to force uploads which are delayed (due to wifi-only, char…
Dec 12, 2014
5879e1b
added laterReason for once failed uploads
Dec 12, 2014
1922752
typo
Dec 12, 2014
64c07f6
on click on item in upload list: open with default app
Dec 12, 2014
a22fbdf
make FileUploadService a Service (instead of IntentService)
Dec 14, 2014
875589a
move uploading to separate thread
Dec 14, 2014
5afd94b
service.stopself after uploads done
Dec 15, 2014
a690877
added cancel debug output
Dec 15, 2014
e764c7d
added progressbar for current item in upload list
Dec 15, 2014
0e05a97
fix
Dec 15, 2014
7741bd2
fix progressbar issues
Dec 15, 2014
d6625ee
fix progress notification
Dec 15, 2014
2ad3ef2
checks and debug output
Dec 15, 2014
e5e5b36
Merge branch 'develop' into reliable_uploads
Aug 18, 2015
3e6bcda
Merge branch 'develop' into reliable_uploads
Aug 20, 2015
3c2da89
Merge branch 'master' into reliable_uploads
Aug 21, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ oc_workaround/local.properties
oc_framework/local.properties
oc_framework-test-project/local.properties
tests/local.properties
lint.xml

# Mac .DS_Store files
.DS_Store
Expand Down
17 changes: 12 additions & 5 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@

<service android:name=".services.OperationsService" />
<service android:name=".files.services.FileDownloader" />
<service android:name=".files.services.FileUploader" />
<service android:name=".files.services.FileUploadService" />
<service android:name=".media.MediaService" />

<activity android:name=".ui.activity.PassCodeActivity" />
Expand All @@ -158,8 +158,18 @@
<activity android:name=".ui.activity.ErrorsWhileCopyingHandlerActivity"/>

<activity android:name=".ui.activity.LogHistoryActivity"/>

<activity android:name=".ui.errorhandling.ErrorShowActivity" />
<activity android:name=".ui.activity.UploadListActivity" />

<receiver android:name=".files.InstantUploadBroadcastReceiver">
<receiver android:name=".files.services.ConnectivityActionReceiver"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good feelings here.

android:enabled="true" android:label="ConnectivityActionReceiver">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
<action android:name="android.net.wifi.STATE_CHANGE"/>
</intent-filter>
</receiver>
<receiver android:name=".files.InstantUploadBroadcastReceiver">
<intent-filter>
<!-- unofficially supported by many Android phones but not by HTC devices: -->
<action android:name="com.android.camera.NEW_PICTURE" />
Expand All @@ -171,9 +181,6 @@
<action android:name="android.hardware.action.NEW_VIDEO" />
<data android:mimeType="video/*" />
</intent-filter>
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
</intent-filter>
</receiver>
<receiver android:name=".files.BootupBroadcastReceiver">
<intent-filter>
Expand Down
46 changes: 46 additions & 0 deletions res/drawable/btn_small_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<!-- pressed state of button, only change: color of actual button -->
<item android:state_pressed="true" >
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- shadow, a little down and a little to the right -->
<item><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<gradient android:angle="270" android:endColor="#99000000" android:startColor="#99000000" />
</shape></item>
<!-- this is the actual button -->
<item android:bottom="1px" android:right="1px"><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<gradient android:angle="270" android:endColor="#47ffffff" android:startColor="#97ffffff" />
</shape></item>
</layer-list>
</item>

<!-- focused state of button, only change: color of actual button -->
<item android:state_focused="true" >
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- shadow, a little down and a little to the right -->
<item><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<gradient android:angle="270" android:endColor="#22000000" android:startColor="#22000000" />
</shape></item>
<!-- this is the actual button -->
<item android:bottom="1px" android:right="1px"><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<gradient android:angle="270" android:endColor="#47ffffff" android:startColor="#97ffffff" />
</shape></item>
</layer-list>
</item> <!-- normal state of button. Template for other states. -->
<item>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- shadow, a little down and a little to the right -->
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<gradient android:angle="270" android:endColor="#55000000" android:startColor="#55000000" />
</shape></item>
<!-- this is the actual button -->
<item android:bottom="1px" android:right="1px">
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<gradient android:angle="270" android:endColor="#47ffffff" android:startColor="#97ffffff" />
</shape>
</item>
</layer-list>
</item>
</selector>
Expand Down
Binary file added res/drawable/upload_failed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable/upload_finished.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable/upload_in_progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions res/layout/errorhandling_showerror.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<TextView
android:id="@+id/errorTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</ScrollView>
45 changes: 45 additions & 0 deletions res/layout/list_fragment_expandable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This must be a clone of list_fragment.xml

EXCEPT: ExpandableListView must be used for @+id/swipe_refresh_files_emptyView
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" >

<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_files"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ExpandableListView
android:id="@+id/list_root"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</android.support.v4.widget.SwipeRefreshLayout>

<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_files_emptyView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" >

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >

<TextView
android:id="@+id/empty_list_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:text="@string/empty"
android:layout_gravity="center"
android:visibility="visible" />

</ScrollView>
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>
34 changes: 34 additions & 0 deletions res/layout/upload_list_group.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="3dp" >

<TextView
android:id="@+id/uploadListGroupName"
style="?android:attr/listSeparatorTextViewStyle"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_toLeftOf="@+id/upload_group_right_button"
android:divider="@null"
android:dividerHeight="0dp"
android:ellipsize="middle"
android:showDividers="none"
/>

<!-- This would be just too many buttons.
<Button
android:id="@+id/upload_group_right_button"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignBottom="@+id/uploadListGroupName"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
style="?android:attr/buttonStyleSmall"
android:focusable="false"
android:focusableInTouchMode="false"
android:text="CLEAR"
/>
-->


</RelativeLayout>
121 changes: 121 additions & 0 deletions res/layout/upload_list_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ListItemLayout"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:layout_height="wrap_content">

<FrameLayout
android:layout_width="56dp"
android:layout_height="match_parent"
android:focusable="false"
android:focusableInTouchMode="false">

<ImageView
android:id="@+id/imageView1"
android:layout_width="@dimen/file_icon_size"
android:layout_height="@dimen/file_icon_size"
android:layout_gravity="center"
android:src="@drawable/ic_menu_archive" />

</FrameLayout>

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="vertical" >

<TextView
android:id="@+id/upload_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:ellipsize="middle"
android:singleLine="true"
android:textColor="#303030"
android:textSize="16dip" />


<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="1">

<TextView
android:id="@+id/upload_local_path"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:textColor="@color/list_item_lastmod_and_filesize_text"
android:textSize="12dip"/>

<TextView
android:id="@+id/upload_file_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:textColor="@color/list_item_lastmod_and_filesize_text"
android:layout_weight=".5"
android:textSize="12dip"/>

</LinearLayout>

<ProgressBar
android:id="@+id/upload_progress_bar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="1">

<TextView
android:id="@+id/upload_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:textColor="@color/list_item_lastmod_and_filesize_text"
android:textSize="12dip"/>

<TextView
android:id="@+id/upload_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:textColor="@color/list_item_lastmod_and_filesize_text"
android:layout_weight=".5"
android:textSize="12dip"/>

</LinearLayout>

</LinearLayout>


<FrameLayout
android:layout_width="40dp"
android:layout_height="match_parent"
android:focusable="false"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
>

<Button
android:id="@+id/upload_right_button"
android:background ="@drawable/btn_small_round"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:focusable="false"
android:focusableInTouchMode="false"
/>

</FrameLayout>


</LinearLayout>
15 changes: 15 additions & 0 deletions res/layout/upload_list_layout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<fragment
android:id="@+id/UploadListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="25dp"
android:paddingRight="25dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
class="com.owncloud.android.ui.fragment.UploadListFragment" />

</FrameLayout>
7 changes: 7 additions & 0 deletions res/menu/main_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
android:title="@string/actionbar_sort"
android:contentDescription="@string/actionbar_sort"/>

<item

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this option must be in the navigation drawer

android:id="@+id/action_upload_list"
android:icon="@drawable/ic_action_settings"
android:orderInCategory="2"
app:showAsAction="never"
android:title="Open upload list"/>

<!-- <item android:id="@+id/search"
android:title="@string/actionbar_search"
android:icon="@drawable/ic_action_search"></item> -->
Expand Down
10 changes: 10 additions & 0 deletions res/menu/upload_actions_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item android:id="@+id/action_open_file_with" android:title="@string/actionbar_open_with" android:icon="@android:drawable/ic_menu_set_as" android:orderInCategory="1" />
<item android:id="@+id/action_cancel_upload" android:title="@string/common_cancel_upload" android:icon="@android:drawable/ic_menu_close_clear_cancel" android:orderInCategory="1" />
<item android:id="@+id/action_remove_upload" android:title="@string/common_remove_upload" android:icon="@android:drawable/ic_menu_close_clear_cancel" android:orderInCategory="1" />
<item android:id="@+id/action_retry_upload" android:title="@string/common_retry_upload" android:icon="@android:drawable/ic_menu_close_clear_cancel" android:orderInCategory="1" />
<item android:id="@+id/action_see_details" android:title="@string/actionbar_see_details" android:icon="@android:drawable/ic_menu_info_details" android:orderInCategory="1" />

</menu>
31 changes: 31 additions & 0 deletions res/menu/upload_list_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud 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" >

<item
android:id="@+id/action_retry_uploads"
android:title="Retry current uploads"/>
<item
android:id="@+id/action_clear_failed_uploads"
android:title="Clear failed uploads"/>
<item
android:id="@+id/action_clear_finished_uploads"
android:title="Clear finished uploads"/>
</menu>
Loading