Skip to content

Commit d76ed5a

Browse files
committed
ui fixes
Signed-off-by: alperozturk <[email protected]>
1 parent c4ccea7 commit d76ed5a

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

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

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ class FileDetailsSharingProcessFragment :
198198
setCheckboxStates()
199199
themeView()
200200
setVisibilitiesOfShareOption()
201-
toggleNextButtonAvailability(isAnySharePermissionChecked())
202201
logShareInfo()
203202
}
204203

@@ -496,11 +495,14 @@ class FileDetailsSharingProcessFragment :
496495
return
497496
}
498497

499-
val currentLimit = share?.remainingDownloadLimit() ?: return
498+
// user can set download limit thus no need to rely on current limit to show download limit
499+
showFileDownloadLimitInput(true)
500500
binding.shareProcessSetDownloadLimitSwitch.visibility = View.VISIBLE
501+
binding.shareProcessSetDownloadLimitInput.visibility = View.VISIBLE
502+
503+
val currentLimit = share?.remainingDownloadLimit() ?: return
501504
if (currentLimit > 0) {
502505
binding.shareProcessSetDownloadLimitSwitch.isChecked = true
503-
showFileDownloadLimitInput(true)
504506
binding.shareProcessSetDownloadLimitInput.setText(currentLimit.toString())
505507
}
506508
}
@@ -587,7 +589,6 @@ class FileDetailsSharingProcessFragment :
587589

588590
val isCustomPermissionSelected = (optionId == R.id.custom_permission_radio_button)
589591
customPermissionLayout.setVisibilityWithAnimation(isCustomPermissionSelected)
590-
toggleNextButtonAvailability(true)
591592
}
592593
// endregion
593594
}
@@ -612,13 +613,6 @@ class FileDetailsSharingProcessFragment :
612613
)
613614
}
614615

615-
private fun toggleNextButtonAvailability(value: Boolean) {
616-
binding.run {
617-
shareProcessBtnNext.isEnabled = value
618-
shareProcessBtnNext.isClickable = value
619-
}
620-
}
621-
622616
@Suppress("NestedBlockDepth")
623617
private fun setCheckboxStates() {
624618
val currentPermissions = share?.permissions ?: permission
@@ -676,7 +670,6 @@ class FileDetailsSharingProcessFragment :
676670

677671
private fun togglePermission(isChecked: Boolean, permissionFlag: Int) {
678672
permission = SharePermissionManager.togglePermission(isChecked, permission, permissionFlag)
679-
toggleNextButtonAvailability(true)
680673
}
681674

682675
private fun showExpirationDateDialog(chosenDateInMillis: Long = chosenExpDateInMills) {
@@ -781,14 +774,6 @@ class FileDetailsSharingProcessFragment :
781774
return
782775
}
783776

784-
if (!isSharePermissionChecked() && !isCustomPermissionSelectedAndAnyCustomPermissionTypeChecked()) {
785-
DisplayUtils.showSnackMessage(
786-
binding.root,
787-
R.string.file_details_sharing_fragment_custom_permission_not_selected
788-
)
789-
return
790-
}
791-
792777
// if modifying existing share information then execute the process
793778
if (share != null) {
794779
updateShare()

app/src/main/res/values/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,6 @@
14481448
<string name="sync_duplication">Sync duplication</string>
14491449
<string name="server_not_reachable">Could not load content</string>
14501450
<string name="server_not_reachable_content">The device is likely not connected to the internet</string>
1451-
<string name="file_details_sharing_fragment_custom_permission_not_selected">Please select custom permission</string>
14521451
<string name="unknown">Unknown</string>
14531452
<string name="upload_missing_storage_permission_title">Upload Stopped – Storage Permission Required</string>
14541453
<string name="upload_missing_storage_permission_description">Your files cannot be uploaded without access to local storage. Tap to grant permission.</string>

0 commit comments

Comments
 (0)