Skip to content

Commit

Permalink
Merge pull request #68 from kaczmarkiewiczp/dev
Browse files Browse the repository at this point in the history
Updates and fixes
  • Loading branch information
patrykcoding authored May 1, 2018
2 parents e5a3c2c + f19cb3a commit b67fe1c
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 7 deletions.
21 changes: 14 additions & 7 deletions app/src/main/java/ca/pkay/rcloneexplorer/SharingActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,21 @@ private class CopyFile extends AsyncTask<Void, Void, Boolean> {
@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;
Expand Down
43 changes: 43 additions & 0 deletions app/src/main/res/layout-sw720dp/fragment_share_list.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:background="?attr/backgroundColor" >

<include
layout="@layout/empty_directory_state" />

<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="600dp"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_above="@+id/bottom_bar" >

<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/recycler_view"
android:clipToPadding="false"
android:paddingBottom="54dp"
app:layoutManager="LinearLayoutManager"
tools:listitem="@layout/fragment_file_explorer_item" />
</android.support.v4.widget.SwipeRefreshLayout>

<include
android:id="@+id/move_bar"
android:layout_width="600dp"
android:layout_height="56dp"
android:orientation="horizontal"
android:layout_gravity="bottom|center"
android:background="@color/colorPrimary"
android:elevation="8dp"
android:visibility="gone"
android:clickable="true"
android:focusable="true"
layout="@layout/move_bar"/>
</android.support.design.widget.CoordinatorLayout>

0 comments on commit b67fe1c

Please sign in to comment.