Skip to content

Commit 6f0e77f

Browse files
committed
fix search view enability
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent ff56b3e commit 6f0e77f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/src/main/java/com/owncloud/android/ui/fragment/FileDetailSharingFragment.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ private void setupView() {
340340
if (file.isSharedViaLink()) {
341341
binding.searchView.setQueryHint(getResources().getString(R.string.share_not_allowed_when_file_drop));
342342
binding.searchView.setInputType(InputType.TYPE_NULL);
343-
disableSearchView(binding.searchView);
343+
toggleSearchViewEnable(binding.searchView, false);
344344
}
345345
}
346346
});
@@ -357,7 +357,7 @@ private void setupView() {
357357
binding.externalSharesHeadline.setVisibility(View.GONE);
358358
binding.searchView.setInputType(InputType.TYPE_NULL);
359359
binding.pickContactEmailBtn.setVisibility(View.GONE);
360-
disableSearchView(binding.searchView);
360+
toggleSearchViewEnable(binding.searchView, false);
361361
binding.createLink.setOnClickListener(null);
362362
}
363363

@@ -395,12 +395,11 @@ private void checkShareViaUser() {
395395
}
396396
}
397397

398-
private void disableSearchView(View view) {
399-
view.setEnabled(false);
400-
398+
private void toggleSearchViewEnable(View view, boolean enable) {
399+
view.setEnabled(enable);
401400
if (view instanceof ViewGroup viewGroup) {
402401
for (int i = 0; i < viewGroup.getChildCount(); i++) {
403-
disableSearchView(viewGroup.getChildAt(i));
402+
toggleSearchViewEnable(viewGroup.getChildAt(i), enable);
404403
}
405404
}
406405
}
@@ -744,6 +743,7 @@ public void unShare(OCShare share) {
744743
if (binding.sharesListInternal.getAdapter() instanceof ShareeListAdapter adapter) {
745744
adapter.remove(share);
746745
if (entity != null && adapter.isAdapterEmpty()) {
746+
toggleSearchViewEnable(binding.searchView, true);
747747
entity.setSharedWithSharee(0);
748748
fileDataStorageManager.updateFileEntity(entity);
749749
}

0 commit comments

Comments
 (0)