From b0d57d01c4b3c9e37fdb4786ccc123f5de866f9c Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 14 Mar 2014 23:32:48 +0100 Subject: renaming conferences over conference details --- res/layout/activity_muc_details.xml | 80 ++++++++++++++-------- .../services/XmppConnectionService.java | 15 ++++ .../siacs/conversations/ui/MucDetailsActivity.java | 24 ++++++- 3 files changed, 88 insertions(+), 31 deletions(-) diff --git a/res/layout/activity_muc_details.xml b/res/layout/activity_muc_details.xml index fd5583cf..65bce365 100644 --- a/res/layout/activity_muc_details.xml +++ b/res/layout/activity_muc_details.xml @@ -8,30 +8,28 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > - - - - + + - - - - + android:paddingLeft="8dp" + android:paddingRight="8dp" + android:paddingTop="8dp" + android:text="Your Nickname" /> + + + + + + + - + + contactsAdapter; private OnClickListener changeNickListener = new OnClickListener() { @Override @@ -50,6 +50,20 @@ public class MucDetailsActivity extends XmppActivity { } } }; + + private OnClickListener changeSubjectListener = new OnClickListener() { + + @Override + public void onClick(View arg0) { + String subject = mSubject.getText().toString(); + MucOptions options = conversation.getMucOptions(); + if (!subject.equals(options.getSubject())) { + xmppConnectionService.sendConversationSubject(conversation,subject); + finish(); + } + } + }; + private List users = new ArrayList(); @Override @@ -61,11 +75,14 @@ public class MucDetailsActivity extends XmppActivity { setContentView(R.layout.activity_muc_details); mYourNick = (EditText) findViewById(R.id.muc_your_nick); mFullJid = (TextView) findViewById(R.id.muc_jabberid); - ImageButton imageButton = (ImageButton) findViewById(R.id.muc_edit_nick); - imageButton.setOnClickListener(this.changeNickListener); + ImageButton editNickButton = (ImageButton) findViewById(R.id.muc_edit_nick); + editNickButton.setOnClickListener(this.changeNickListener); + ImageButton editSubjectButton = (ImageButton) findViewById(R.id.muc_edit_subject); + editSubjectButton.setOnClickListener(this.changeSubjectListener); membersView = (LinearLayout) findViewById(R.id.muc_members); mMoreDetails = (LinearLayout) findViewById(R.id.muc_more_details); mMoreDetails.setVisibility(View.GONE); + mSubject = (EditText) findViewById(R.id.muc_subject); getActionBar().setHomeButtonEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true); @@ -110,6 +127,7 @@ public class MucDetailsActivity extends XmppActivity { } } if (this.conversation != null) { + mSubject.setText(conversation.getMucOptions().getSubject()); setTitle(conversation.getName(useSubject)); mFullJid.setText(conversation.getContactJid().split("/")[0]); mYourNick.setText(conversation.getMucOptions().getNick()); -- cgit v1.2.3