|
@@ -674,6 +674,7 @@ public class ShareFileFragment extends Fragment
|
|
getPasswordSection().setVisibility(View.VISIBLE);
|
|
getPasswordSection().setVisibility(View.VISIBLE);
|
|
if (mFile.isFolder() && !mCapabilities.getFilesSharingPublicUpload().isFalse()) {
|
|
if (mFile.isFolder() && !mCapabilities.getFilesSharingPublicUpload().isFalse()) {
|
|
getEditPermissionSection().setVisibility(View.VISIBLE);
|
|
getEditPermissionSection().setVisibility(View.VISIBLE);
|
|
|
|
+ getFileListingPermissionSection().setVisibility(View.VISIBLE);
|
|
} else {
|
|
} else {
|
|
getEditPermissionSection().setVisibility(View.GONE);
|
|
getEditPermissionSection().setVisibility(View.GONE);
|
|
}
|
|
}
|
|
@@ -754,6 +755,26 @@ public class ShareFileFragment extends Fragment
|
|
mOnEditPermissionInteractionListener
|
|
mOnEditPermissionInteractionListener
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ /// update state of the hide file listing permission switch
|
|
|
|
+ SwitchCompat hideFileListingPermissionSwitch = getHideFileListingPermissionSwitch();
|
|
|
|
+
|
|
|
|
+ // set null listener before setChecked() to prevent infinite loop of calls
|
|
|
|
+ hideFileListingPermissionSwitch.setOnCheckedChangeListener(null);
|
|
|
|
+ if (mPublicShare.getPermissions() > OCShare.READ_PERMISSION_FLAG) {
|
|
|
|
+ if (!hideFileListingPermissionSwitch.isChecked()) {
|
|
|
|
+ hideFileListingPermissionSwitch.toggle();
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (hideFileListingPermissionSwitch.isChecked()) {
|
|
|
|
+ hideFileListingPermissionSwitch.toggle();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // recover listener
|
|
|
|
+ // TODO Tobi
|
|
|
|
+// hideFileListingPermissionSwitch.setOnCheckedChangeListener(
|
|
|
|
+// mOnEditPermissionInteractionListener
|
|
|
|
+// );
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
/// no public share -> collapse section
|
|
/// no public share -> collapse section
|
|
SwitchCompat shareViaLinkSwitch = getShareViaLinkSwitch();
|
|
SwitchCompat shareViaLinkSwitch = getShareViaLinkSwitch();
|
|
@@ -810,6 +831,14 @@ public class ShareFileFragment extends Fragment
|
|
return (SwitchCompat) getView().findViewById(R.id.shareViaLinkEditPermissionSwitch);
|
|
return (SwitchCompat) getView().findViewById(R.id.shareViaLinkEditPermissionSwitch);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private View getFileListingPermissionSection() {
|
|
|
|
+ return getView().findViewById(R.id.shareViaLinkHideListPermissionSection);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private SwitchCompat getHideFileListingPermissionSwitch() {
|
|
|
|
+ return (SwitchCompat) getView().findViewById(R.id.shareViaLinkHideListPermissionSwitch);
|
|
|
|
+ }
|
|
|
|
+
|
|
private AppCompatButton getGetLinkButton() {
|
|
private AppCompatButton getGetLinkButton() {
|
|
return (AppCompatButton) getView().findViewById(R.id.shareViaLinkGetLinkButton);
|
|
return (AppCompatButton) getView().findViewById(R.id.shareViaLinkGetLinkButton);
|
|
}
|
|
}
|