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