From a199abb381bb152a468f1b9b52788be53baf6e22 Mon Sep 17 00:00:00 2001 From: tobiaskaminsky Date: Wed, 13 Dec 2017 10:22:25 +0100 Subject: [PATCH] hide dialog if not needed --- .../owncloud/android/ui/dialog/SendShareDialog.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/dialog/SendShareDialog.java b/src/main/java/com/owncloud/android/ui/dialog/SendShareDialog.java index 80bf065fca..d2d3486521 100644 --- a/src/main/java/com/owncloud/android/ui/dialog/SendShareDialog.java +++ b/src/main/java/com/owncloud/android/ui/dialog/SendShareDialog.java @@ -93,19 +93,19 @@ public class SendShareDialog extends BottomSheetDialogFragment { view = inflater.inflate(R.layout.send_share_fragment, container, false); // Share with people - TextView sharePeopleText = (TextView) view.findViewById(R.id.share_people_button); + TextView sharePeopleText = view.findViewById(R.id.share_people_button); sharePeopleText.setOnClickListener(v -> shareFile(file)); - ImageView sharePeopleImageView = (ImageView) view.findViewById(R.id.share_people_icon); + ImageView sharePeopleImageView = view.findViewById(R.id.share_people_icon); sharePeopleImageView.getBackground().setColorFilter(ThemeUtils.elementColor(), PorterDuff.Mode.SRC_IN); sharePeopleImageView.getDrawable().setColorFilter(ThemeUtils.fontColor(), PorterDuff.Mode.SRC_IN); sharePeopleImageView.setOnClickListener(v -> shareFile(file)); // Share via link button - TextView shareLinkText = (TextView) view.findViewById(R.id.share_link_button); + TextView shareLinkText = view.findViewById(R.id.share_link_button); shareLinkText.setOnClickListener(v -> fileOperationsHelper.showShareFile(file)); - ImageView shareLinkImageView = (ImageView) view.findViewById(R.id.share_link_icon); + ImageView shareLinkImageView = view.findViewById(R.id.share_link_icon); shareLinkImageView.getBackground().setColorFilter(ThemeUtils.elementColor(), PorterDuff.Mode.SRC_IN); shareLinkImageView.getDrawable().setColorFilter(ThemeUtils.fontColor(), PorterDuff.Mode.SRC_IN); shareLinkImageView.setOnClickListener(v -> shareFile(file)); @@ -130,6 +130,7 @@ public class SendShareDialog extends BottomSheetDialogFragment { shareLinkImageView.setVisibility(View.GONE); sharePeopleText.setVisibility(View.GONE); sharePeopleImageView.setVisibility(View.GONE); + getDialog().hide(); } else { shareLinkText.setEnabled(false); shareLinkText.setAlpha(0.3f); @@ -186,7 +187,7 @@ public class SendShareDialog extends BottomSheetDialogFragment { dismiss(); }; - RecyclerView sendButtonsView = (RecyclerView) view.findViewById(R.id.send_button_recycler_view); + RecyclerView sendButtonsView = view.findViewById(R.id.send_button_recycler_view); sendButtonsView.setHasFixedSize(true); sendButtonsView.setLayoutManager(new GridLayoutManager(getActivity(), 3)); sendButtonsView.setAdapter(new SendButtonAdapter(sendButtonDataList, clickListener));