From 1802b45f41b9a4aa0e1291e05576bdc39964e06d Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 29 Apr 2018 22:28:45 +0200 Subject: use styled borderless button --- .../messenger/ui/ConferenceDetailsActivity.java | 44 +++++++++++++--------- src/main/res/layout/activity_change_password.xml | 4 +- src/main/res/layout/activity_contact_details.xml | 4 +- src/main/res/layout/activity_edit_account.xml | 8 ++-- src/main/res/layout/activity_muc_details.xml | 8 ++-- .../layout/activity_publish_profile_picture.xml | 4 +- src/main/res/layout/activity_recording.xml | 4 +- src/main/res/layout/activity_share_locaction.xml | 4 +- src/main/res/layout/activity_trust_keys.xml | 6 +-- src/main/res/layout/activity_verify_otr.xml | 4 +- src/main/res/layout/magic_create.xml | 2 +- src/main/res/layout/message_status.xml | 2 +- src/main/res/layout/welcome.xml | 6 +-- src/main/res/values/styles.xml | 4 ++ src/main/res/values/themes.xml | 2 +- 15 files changed, 59 insertions(+), 47 deletions(-) diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index 72c9a811f..7c2f51bbb 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -64,7 +64,25 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers inviteToConversation(mConversation); } }; - + private OnClickListener destroyListener = new OnClickListener() { + @Override + public void onClick(View v) { + final AlertDialog.Builder DestroyMucDialog = new AlertDialog.Builder(ConferenceDetailsActivity.this); + DestroyMucDialog.setNegativeButton(getString(R.string.cancel), null); + DestroyMucDialog.setTitle(getString(R.string.destroy_muc)); + DestroyMucDialog.setMessage(getString(R.string.destroy_muc_text, mConversation.getName())); + DestroyMucDialog.setPositiveButton(getString(R.string.delete), (dialogInterface, i) -> { + Intent intent = new Intent(xmppConnectionService, ConversationsActivity.class); + intent.setAction(ConversationsActivity.ACTION_DESTROY_MUC); + intent.putExtra("MUC_UUID", mConversation.getUuid()); + Log.d(Config.LOGTAG, "Sending DESTROY intent for " + mConversation.getName()); + startActivity(intent); + deleteBookmark(); + finish(); + }); + DestroyMucDialog.create().show(); + } + }; private ActivityMucDetailsBinding binding; private String uuid = null; private User mSelectedUser = null; @@ -257,6 +275,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers this.binding.invite.setVisibility(View.GONE); this.binding.invite.setOnClickListener(inviteListener); this.binding.destroy.setVisibility(View.GONE); + this.binding.destroy.setOnClickListener(destroyListener); this.binding.leaveMuc.setVisibility(View.GONE); this.binding.addContactButton.setVisibility(View.GONE); this.binding.mucMoreDetails.setVisibility(View.GONE); @@ -587,23 +606,12 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers this.binding.mucInfoMam.setText(R.string.server_info_unavailable); } if (self.getAffiliation().ranks(MucOptions.Affiliation.OWNER)) { - this.binding.destroy.setVisibility(View.VISIBLE); - this.binding.destroy.setOnClickListener(v -> { - final AlertDialog.Builder DestroyMucDialog = new AlertDialog.Builder(ConferenceDetailsActivity.this); - DestroyMucDialog.setNegativeButton(getString(R.string.cancel), null); - DestroyMucDialog.setTitle(getString(R.string.destroy_muc)); - DestroyMucDialog.setMessage(getString(R.string.destroy_muc_text, mConversation.getName())); - DestroyMucDialog.setPositiveButton(getString(R.string.delete), (dialogInterface, i) -> { - Intent intent = new Intent(xmppConnectionService, ConversationsActivity.class); - intent.setAction(ConversationsActivity.ACTION_DESTROY_MUC); - intent.putExtra("MUC_UUID", mConversation.getUuid()); - Log.d(Config.LOGTAG, "Sending DESTROY intent for " + mConversation.getName()); - startActivity(intent); - deleteBookmark(); - finish(); - }); - }); - this.binding.destroy.getBackground().setColorFilter(getWarningButtonColor(), PorterDuff.Mode.MULTIPLY); + if (mAdvancedMode) { + this.binding.destroy.getBackground().setColorFilter(getWarningButtonColor(), PorterDuff.Mode.MULTIPLY); + this.binding.destroy.setVisibility(View.VISIBLE); + } else { + this.binding.destroy.setVisibility(View.GONE); + } this.binding.changeConferenceButton.setVisibility(View.VISIBLE); } else { this.binding.destroy.setVisibility(View.GONE); diff --git a/src/main/res/layout/activity_change_password.xml b/src/main/res/layout/activity_change_password.xml index bebbd32ef..f6dfc5d0e 100644 --- a/src/main/res/layout/activity_change_password.xml +++ b/src/main/res/layout/activity_change_password.xml @@ -80,7 +80,7 @@