hide dialog if not needed

This commit is contained in:
tobiaskaminsky 2017-12-13 10:22:25 +01:00 committed by AndyScherzinger
parent 3a692e65f6
commit a199abb381
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -93,19 +93,19 @@ public class SendShareDialog extends BottomSheetDialogFragment {
view = inflater.inflate(R.layout.send_share_fragment, container, false); view = inflater.inflate(R.layout.send_share_fragment, container, false);
// Share with people // 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)); 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.getBackground().setColorFilter(ThemeUtils.elementColor(), PorterDuff.Mode.SRC_IN);
sharePeopleImageView.getDrawable().setColorFilter(ThemeUtils.fontColor(), PorterDuff.Mode.SRC_IN); sharePeopleImageView.getDrawable().setColorFilter(ThemeUtils.fontColor(), PorterDuff.Mode.SRC_IN);
sharePeopleImageView.setOnClickListener(v -> shareFile(file)); sharePeopleImageView.setOnClickListener(v -> shareFile(file));
// Share via link button // 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)); 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.getBackground().setColorFilter(ThemeUtils.elementColor(), PorterDuff.Mode.SRC_IN);
shareLinkImageView.getDrawable().setColorFilter(ThemeUtils.fontColor(), PorterDuff.Mode.SRC_IN); shareLinkImageView.getDrawable().setColorFilter(ThemeUtils.fontColor(), PorterDuff.Mode.SRC_IN);
shareLinkImageView.setOnClickListener(v -> shareFile(file)); shareLinkImageView.setOnClickListener(v -> shareFile(file));
@ -130,6 +130,7 @@ public class SendShareDialog extends BottomSheetDialogFragment {
shareLinkImageView.setVisibility(View.GONE); shareLinkImageView.setVisibility(View.GONE);
sharePeopleText.setVisibility(View.GONE); sharePeopleText.setVisibility(View.GONE);
sharePeopleImageView.setVisibility(View.GONE); sharePeopleImageView.setVisibility(View.GONE);
getDialog().hide();
} else { } else {
shareLinkText.setEnabled(false); shareLinkText.setEnabled(false);
shareLinkText.setAlpha(0.3f); shareLinkText.setAlpha(0.3f);
@ -186,7 +187,7 @@ public class SendShareDialog extends BottomSheetDialogFragment {
dismiss(); 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.setHasFixedSize(true);
sendButtonsView.setLayoutManager(new GridLayoutManager(getActivity(), 3)); sendButtonsView.setLayoutManager(new GridLayoutManager(getActivity(), 3));
sendButtonsView.setAdapter(new SendButtonAdapter(sendButtonDataList, clickListener)); sendButtonsView.setAdapter(new SendButtonAdapter(sendButtonDataList, clickListener));