Skip to content

Commit acbf282

Browse files
committed
fix radio button isChecked logic
Signed-off-by: alperozturk <alper_ozturk@proton.me>
1 parent ec67099 commit acbf282

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -292,19 +292,17 @@ class FileDetailsSharingProcessFragment :
292292

293293
// custom permissions / read only / allow upload and editing / file drop
294294
binding.run {
295-
if (SharingMenuHelper.isUploadAndEditingAllowed(share)) {
296-
editingRadioButton.isChecked = true
297-
} else if (SharingMenuHelper.isFileDrop(share) && share?.isFolder == true) {
298-
fileDropRadioButton.isChecked = true
299-
} else if (SharingMenuHelper.isReadOnly(share)) {
300-
viewOnlyRadioButton.isChecked = true
301-
}
302-
303-
if (sharePermissionManager.isCustomPermission(share) ||
304-
shareProcessStep == SCREEN_TYPE_CUSTOM_PERMISSION)
305-
{
306-
customPermissionRadioButton.isChecked = true
307-
customPermissionLayout.setVisibilityWithAnimation(true)
295+
when {
296+
SharingMenuHelper.isUploadAndEditingAllowed(share) -> editingRadioButton.isChecked = true
297+
SharingMenuHelper.isFileDrop(share) && share?.isFolder == true -> fileDropRadioButton.isChecked = true
298+
SharingMenuHelper.isReadOnly(share) -> viewOnlyRadioButton.isChecked = true
299+
else -> {
300+
if (sharePermissionManager.isCustomPermission(share) ||
301+
shareProcessStep == SCREEN_TYPE_CUSTOM_PERMISSION) {
302+
customPermissionRadioButton.isChecked = true
303+
customPermissionLayout.setVisibilityWithAnimation(true)
304+
}
305+
}
308306
}
309307
}
310308

0 commit comments

Comments
 (0)