extract theming method

This commit is contained in:
AndyScherzinger 2017-12-14 12:51:41 +01:00
parent adf12d2222
commit c42f2d4d61
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -98,8 +98,7 @@ public class SendShareDialog extends BottomSheetDialogFragment {
sharePeopleText.setOnClickListener(v -> shareFile(file));
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);
themeShareButtonImage(sharePeopleImageView);
sharePeopleImageView.setOnClickListener(v -> shareFile(file));
// Share via link button
@ -107,8 +106,7 @@ public class SendShareDialog extends BottomSheetDialogFragment {
shareLinkText.setOnClickListener(v -> shareFile(file));
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);
themeShareButtonImage(shareLinkImageView);
shareLinkImageView.setOnClickListener(v -> shareFile(file));
if (file.isSharedWithMe() && !file.canReshare()) {
@ -151,6 +149,11 @@ public class SendShareDialog extends BottomSheetDialogFragment {
return view;
}
private void themeShareButtonImage(ImageView shareImageView) {
shareImageView.getBackground().setColorFilter(ThemeUtils.elementColor(), PorterDuff.Mode.SRC_IN);
shareImageView.getDrawable().setColorFilter(ThemeUtils.fontColor(), PorterDuff.Mode.SRC_IN);
}
private void showResharingNotAllowedSnackbar() {
Snackbar snackbar = Snackbar.make(view, R.string.resharing_is_not_allowed, Snackbar.LENGTH_LONG);
snackbar.addCallback(new Snackbar.Callback() {