mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
Restored Sharing menu for reshared file with warning if resharing isn't allowed
This commit is contained in:
parent
8e57107f87
commit
4193dd04ab
5 changed files with 32 additions and 5 deletions
|
@ -24,6 +24,7 @@ package com.owncloud.android.ui.fragment;
|
|||
import android.accounts.Account;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.widget.SwitchCompat;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
|
@ -312,8 +313,16 @@ public class FileDetailFragment extends FileFragment implements OnClickListener,
|
|||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_send_share_file: {
|
||||
mContainerActivity.getFileOperationsHelper().sendShareFile(getFile(),
|
||||
if(getFile().isSharedWithMe() && !getFile().canReshare()){
|
||||
Snackbar.make(getView(),
|
||||
R.string.resharing_is_not_allowed,
|
||||
Snackbar.LENGTH_LONG
|
||||
)
|
||||
.show();
|
||||
} else {
|
||||
mContainerActivity.getFileOperationsHelper().sendShareFile(getFile(),
|
||||
(FileDisplayActivity) mContainerActivity);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case R.id.action_open_file_with: {
|
||||
|
|
|
@ -944,8 +944,8 @@ public class OCFileListFragment extends ExtendedListFragment implements OCFileLi
|
|||
OCFile singleFile = checkedFiles.get(0);
|
||||
switch (menuId) {
|
||||
case R.id.action_send_share_file: {
|
||||
mContainerActivity.getFileOperationsHelper().sendShareFile(singleFile,
|
||||
(FileDisplayActivity) mContainerActivity);
|
||||
mContainerActivity.getFileOperationsHelper().sendShareFile(singleFile,
|
||||
(FileDisplayActivity) mContainerActivity);
|
||||
return true;
|
||||
}
|
||||
case R.id.action_open_file_with: {
|
||||
|
|
|
@ -422,8 +422,16 @@ public class PreviewImageFragment extends FileFragment {
|
|||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_send_share_file:
|
||||
mContainerActivity.getFileOperationsHelper().sendShareFile(getFile(),
|
||||
if(getFile().isSharedWithMe() && !getFile().canReshare()){
|
||||
Snackbar.make(getView(),
|
||||
R.string.resharing_is_not_allowed,
|
||||
Snackbar.LENGTH_LONG
|
||||
)
|
||||
.show();
|
||||
} else {
|
||||
mContainerActivity.getFileOperationsHelper().sendShareFile(getFile(),
|
||||
(FileDisplayActivity) mContainerActivity);
|
||||
}
|
||||
return true;
|
||||
|
||||
case R.id.action_open_file_with:
|
||||
|
|
|
@ -38,6 +38,7 @@ import android.os.Bundle;
|
|||
import android.os.IBinder;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
|
|
|
@ -22,6 +22,7 @@ package com.owncloud.android.ui.preview;
|
|||
import android.accounts.Account;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
|
@ -382,8 +383,16 @@ public class PreviewTextFragment extends FileFragment {
|
|||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_send_share_file: {
|
||||
mContainerActivity.getFileOperationsHelper().sendShareFile(getFile(),
|
||||
if(getFile().isSharedWithMe() && !getFile().canReshare()){
|
||||
Snackbar.make(getView(),
|
||||
R.string.resharing_is_not_allowed,
|
||||
Snackbar.LENGTH_LONG
|
||||
)
|
||||
.show();
|
||||
} else {
|
||||
mContainerActivity.getFileOperationsHelper().sendShareFile(getFile(),
|
||||
(FileDisplayActivity) mContainerActivity);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case R.id.action_open_file_with: {
|
||||
|
|
Loading…
Reference in a new issue