From a3b8ad0b8b259a0ba71df039a26b5a6fe3484d09 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Thu, 31 Mar 2016 18:27:46 +0200 Subject: [PATCH] Fixes after rebase --- src/com/owncloud/android/ui/activity/Uploader.java | 6 +++--- .../android/ui/adapter/ExpandableUploadListAdapter.java | 1 + src/com/owncloud/android/ui/adapter/UploaderAdapter.java | 6 +++--- src/com/owncloud/android/utils/DisplayUtils.java | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/com/owncloud/android/ui/activity/Uploader.java b/src/com/owncloud/android/ui/activity/Uploader.java index a85ac284152..271daa53546 100644 --- a/src/com/owncloud/android/ui/activity/Uploader.java +++ b/src/com/owncloud/android/ui/activity/Uploader.java @@ -459,16 +459,16 @@ private void populateDirectoryList() { for (OCFile f : files) { if (f.isFolder()) { HashMap h = new HashMap(); - h.put("dirname", f.getFileName()); - h.put("last_mod", DisplayUtils.getRelativeTimestamp(this, f)); + h.put("dirname", f); data.add(h); + } } UploaderAdapter sa = new UploaderAdapter(this, data, R.layout.uploader_list_item_layout, new String[] {"dirname"}, - new int[] {R.id.filename, R.id.last_mod}); + new int[] {R.id.filename}, getStorageManager(), getAccount()); mListView.setAdapter(sa); diff --git a/src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java b/src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java index 97c9cb66832..ddc4c289f6e 100755 --- a/src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java +++ b/src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java @@ -246,6 +246,7 @@ private View getView(OCUpload[] uploadsItems, int position, View convertView, Vi accountNameTextView.setVisibility(View.VISIBLE); statusTextView.setVisibility(View.VISIBLE); progressBar.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); /// Update information depending of upload details String status = getStatusText(upload); diff --git a/src/com/owncloud/android/ui/adapter/UploaderAdapter.java b/src/com/owncloud/android/ui/adapter/UploaderAdapter.java index 796959eda40..af83af8b2ad 100644 --- a/src/com/owncloud/android/ui/adapter/UploaderAdapter.java +++ b/src/com/owncloud/android/ui/adapter/UploaderAdapter.java @@ -35,6 +35,7 @@ import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.datamodel.ThumbnailsCacheManager; import com.owncloud.android.datamodel.ThumbnailsCacheManager.AsyncDrawable; +import com.owncloud.android.utils.DisplayUtils; import com.owncloud.android.utils.MimetypeIconUtil; import java.util.HashMap; @@ -74,9 +75,8 @@ public View getView(int position, View convertView, ViewGroup parent) { ImageView fileIcon = (ImageView) vi.findViewById(R.id.thumbnail); fileIcon.setTag(file.getFileId()); - // TODO enable after #1277 is merged -// TextView lastModV = (TextView) vi.findViewById(R.id.last_mod); -// lastModV.setText(DisplayUtils.getRelativeTimestamp(mContext, file)); + TextView lastModV = (TextView) vi.findViewById(R.id.last_mod); + lastModV.setText(DisplayUtils.getRelativeTimestamp(mContext, file)); // get Thumbnail if file is image if (file.isImage() && file.getRemoteId() != null){ diff --git a/src/com/owncloud/android/utils/DisplayUtils.java b/src/com/owncloud/android/utils/DisplayUtils.java index 562fef940df..2aed66f1aa9 100644 --- a/src/com/owncloud/android/utils/DisplayUtils.java +++ b/src/com/owncloud/android/utils/DisplayUtils.java @@ -195,7 +195,7 @@ public static CharSequence getRelativeTimestamp(Context context, OCFile file) { } @SuppressWarnings("deprecation") - private static CharSequence getRelativeDateTimeString ( + public static CharSequence getRelativeDateTimeString ( Context c, long time, long minResolution, long transitionResolution, int flags ){