|
@@ -16,6 +16,7 @@ import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewGroup;
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
|
|
+import android.widget.LinearLayout;
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.owncloud.android.R;
|
|
import com.owncloud.android.R;
|
|
@@ -53,20 +54,23 @@ import java.util.List;
|
|
public class SendShareDialog extends BottomSheetDialogFragment {
|
|
public class SendShareDialog extends BottomSheetDialogFragment {
|
|
|
|
|
|
private static final String KEY_OCFILE = "KEY_OCFILE";
|
|
private static final String KEY_OCFILE = "KEY_OCFILE";
|
|
|
|
+ private static final String KEY_HIDE_NCSHARING_OPTIONS = "KEY_HIDE_NCSHARING_OPTIONS";
|
|
private static final String TAG = SendShareDialog.class.getSimpleName();
|
|
private static final String TAG = SendShareDialog.class.getSimpleName();
|
|
public static final String PACKAGE_NAME = "PACKAGE_NAME";
|
|
public static final String PACKAGE_NAME = "PACKAGE_NAME";
|
|
public static final String ACTIVITY_NAME = "ACTIVITY_NAME";
|
|
public static final String ACTIVITY_NAME = "ACTIVITY_NAME";
|
|
|
|
|
|
private View view;
|
|
private View view;
|
|
private OCFile file;
|
|
private OCFile file;
|
|
|
|
+ private boolean hideNcSharingOptions;
|
|
private FileOperationsHelper fileOperationsHelper;
|
|
private FileOperationsHelper fileOperationsHelper;
|
|
|
|
|
|
- public static SendShareDialog newInstance(OCFile file) {
|
|
|
|
|
|
+ public static SendShareDialog newInstance(OCFile file, boolean hideNcSharingOptions) {
|
|
|
|
|
|
SendShareDialog dialogFragment = new SendShareDialog();
|
|
SendShareDialog dialogFragment = new SendShareDialog();
|
|
|
|
|
|
Bundle args = new Bundle();
|
|
Bundle args = new Bundle();
|
|
args.putParcelable(KEY_OCFILE, file);
|
|
args.putParcelable(KEY_OCFILE, file);
|
|
|
|
+ args.putBoolean(KEY_HIDE_NCSHARING_OPTIONS, hideNcSharingOptions);
|
|
dialogFragment.setArguments(args);
|
|
dialogFragment.setArguments(args);
|
|
|
|
|
|
return dialogFragment;
|
|
return dialogFragment;
|
|
@@ -81,6 +85,7 @@ public class SendShareDialog extends BottomSheetDialogFragment {
|
|
view = null;
|
|
view = null;
|
|
|
|
|
|
file = getArguments().getParcelable(KEY_OCFILE);
|
|
file = getArguments().getParcelable(KEY_OCFILE);
|
|
|
|
+ hideNcSharingOptions = getArguments().getBoolean(KEY_HIDE_NCSHARING_OPTIONS, false);
|
|
}
|
|
}
|
|
|
|
|
|
@Nullable
|
|
@Nullable
|
|
@@ -89,6 +94,9 @@ public class SendShareDialog extends BottomSheetDialogFragment {
|
|
|
|
|
|
view = inflater.inflate(R.layout.send_share_fragment, container, false);
|
|
view = inflater.inflate(R.layout.send_share_fragment, container, false);
|
|
|
|
|
|
|
|
+ LinearLayout sendShareButtons = view.findViewById(R.id.send_share_buttons);
|
|
|
|
+ View divider = view.findViewById(R.id.divider);
|
|
|
|
+
|
|
// Share with people
|
|
// Share with people
|
|
TextView sharePeopleText = view.findViewById(R.id.share_people_button);
|
|
TextView sharePeopleText = view.findViewById(R.id.share_people_button);
|
|
sharePeopleText.setOnClickListener(v -> shareFile(file));
|
|
sharePeopleText.setOnClickListener(v -> shareFile(file));
|
|
@@ -105,7 +113,10 @@ public class SendShareDialog extends BottomSheetDialogFragment {
|
|
themeShareButtonImage(shareLinkImageView);
|
|
themeShareButtonImage(shareLinkImageView);
|
|
shareLinkImageView.setOnClickListener(v -> shareFile(file));
|
|
shareLinkImageView.setOnClickListener(v -> shareFile(file));
|
|
|
|
|
|
- if (file.isSharedWithMe() && !file.canReshare()) {
|
|
|
|
|
|
+ if (hideNcSharingOptions) {
|
|
|
|
+ sendShareButtons.setVisibility(View.GONE);
|
|
|
|
+ divider.setVisibility(View.GONE);
|
|
|
|
+ } else if (file.isSharedWithMe() && !file.canReshare()) {
|
|
showResharingNotAllowedSnackbar();
|
|
showResharingNotAllowedSnackbar();
|
|
|
|
|
|
if (file.isFolder()) {
|
|
if (file.isFolder()) {
|