Skip to content

Commit 43fd840

Browse files
committed
do not show allow download and sync for public share
Signed-off-by: alperozturk <alper_ozturk@proton.me>
1 parent c64f78d commit 43fd840

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

app/src/main/java/com/owncloud/android/ui/fragment/FileDetailsSharingProcessFragment.kt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ class FileDetailsSharingProcessFragment :
211211
themeRadioButton(fileDropRadioButton)
212212
themeRadioButton(customPermissionRadioButton)
213213

214-
themeCheckbox(shareAllowDownloadAndSyncCheckbox)
214+
if (shareType != ShareType.PUBLIC_LINK) {
215+
shareAllowDownloadAndSyncCheckbox.visibility = View.VISIBLE
216+
themeCheckbox(shareAllowDownloadAndSyncCheckbox)
217+
}
215218

216219
themeCheckbox(shareReadCheckbox)
217220
themeCheckbox(shareCreateCheckbox)
@@ -544,7 +547,9 @@ class FileDetailsSharingProcessFragment :
544547
}
545548
}
546549

547-
shareAllowDownloadAndSyncCheckbox.isChecked = isAllowDownloadAndSyncEnabled(share)
550+
if (shareType != ShareType.PUBLIC_LINK) {
551+
shareAllowDownloadAndSyncCheckbox.isChecked = isAllowDownloadAndSyncEnabled(share)
552+
}
548553
}
549554
}
550555

@@ -564,8 +569,10 @@ class FileDetailsSharingProcessFragment :
564569
checkbox.setOnCheckedChangeListener { _, isChecked -> togglePermission(isChecked, flag) }
565570
}
566571

567-
binding.shareAllowDownloadAndSyncCheckbox.setOnCheckedChangeListener { _, isChecked ->
568-
share?.attributes = sharePermissionManager.toggleAllowDownloadAndSync(isChecked, share)
572+
if (shareType != ShareType.PUBLIC_LINK) {
573+
binding.shareAllowDownloadAndSyncCheckbox.setOnCheckedChangeListener { _, isChecked ->
574+
share?.attributes = sharePermissionManager.toggleAllowDownloadAndSync(isChecked, share)
575+
}
569576
}
570577
}
571578

app/src/main/res/layout/file_details_sharing_process_fragment.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
android:layout_height="wrap_content"
8181
android:layout_marginTop="@dimen/standard_margin"
8282
android:minHeight="@dimen/minimum_size_for_touchable_area"
83+
android:visibility="gone"
8384
android:text="@string/share_allow_download_and_sync_permission"
8485
tools:visibility="visible" />
8586

0 commit comments

Comments
 (0)