From e5e2626f68ee5903826ddd04383331596fd62127 Mon Sep 17 00:00:00 2001 From: Patryk Kaczmarkiewicz Date: Tue, 1 May 2018 15:37:27 -0600 Subject: [PATCH 1/2] Update tablet layout --- .../layout-sw720dp/fragment_share_list.xml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 app/src/main/res/layout-sw720dp/fragment_share_list.xml diff --git a/app/src/main/res/layout-sw720dp/fragment_share_list.xml b/app/src/main/res/layout-sw720dp/fragment_share_list.xml new file mode 100644 index 0000000..3136545 --- /dev/null +++ b/app/src/main/res/layout-sw720dp/fragment_share_list.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + \ No newline at end of file From f19cb3ad5e5525cb6dde2f892b2b983736f65f86 Mon Sep 17 00:00:00 2001 From: Patryk Kaczmarkiewicz Date: Tue, 1 May 2018 15:49:03 -0600 Subject: [PATCH 2/2] Fix receiving files --- .../pkay/rcloneexplorer/SharingActivity.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/SharingActivity.java b/app/src/main/java/ca/pkay/rcloneexplorer/SharingActivity.java index 807831a..b60f8ef 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/SharingActivity.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/SharingActivity.java @@ -244,14 +244,21 @@ private class CopyFile extends AsyncTask { @Override protected Boolean doInBackground(Void... voids) { for (Uri uri : uris) { - Cursor returnCursor = getContentResolver().query(uri, null, null, null, null); - if (returnCursor == null) { - return false; + String fileName; + if (uri.getScheme().equals("content")) { + Cursor returnCursor = getContentResolver().query(uri, null, null, null, null); + if (returnCursor == null) { + return false; + } + int nameIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME); + returnCursor.moveToFirst(); + fileName = returnCursor.getString(nameIndex); + returnCursor.close(); + } else { + fileName = uri.getPath(); + int index = fileName.lastIndexOf("/"); + fileName = fileName.substring(index + 1); } - int nameIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME); - returnCursor.moveToFirst(); - String fileName = returnCursor.getString(nameIndex); - returnCursor.close(); File cacheDir = getExternalCacheDir(); InputStream inputStream;