aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-29 22:28:45 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-29 22:28:45 +0200
commit1802b45f41b9a4aa0e1291e05576bdc39964e06d (patch)
tree19b6fa1a67c8a53f186ab58b587acf468b8fa082 /src/main/java/de/pixart/messenger
parent1fcc2f3cb1f219c25080bdcbb8f4d9fb6af10ea7 (diff)
use styled borderless button
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java44
1 files changed, 26 insertions, 18 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);