diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-07-16 12:34:09 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-07-16 12:34:09 +0200 |
commit | e79a34b651a626b93686b8c578280b77c54b6138 (patch) | |
tree | 0a09589dda9e69c22f069f9efa815a32673aa8cd /src/eu/siacs/conversations/ui/XmppActivity.java | |
parent | eb8253d49a432412b8a27d4f61f8f009ace4d79b (diff) |
redesigned muc details a little bit
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/ui/XmppActivity.java | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java index 217bae552..2592bebca 100644 --- a/src/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/eu/siacs/conversations/ui/XmppActivity.java @@ -23,10 +23,10 @@ import android.content.ServiceConnection; import android.net.Uri; import android.os.Bundle; import android.os.IBinder; -import android.util.Log; import android.view.MenuItem; import android.view.View; import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; public abstract class XmppActivity extends Activity { @@ -37,6 +37,10 @@ public abstract class XmppActivity extends Activity { public XmppConnectionService xmppConnectionService; public boolean xmppConnectionServiceBound = false; protected boolean handledViewIntent = false; + + protected interface OnValueEdited { + public void onValueEdited(String value); + } protected ServiceConnection mConnection = new ServiceConnection() { @@ -193,10 +197,7 @@ public abstract class XmppActivity extends Activity { try { startIntentSenderForResult(pi.getIntentSender(), REQUEST_ANNOUNCE_PGP, null, 0, 0, 0); - } catch (SendIntentException e) { - Log.d("xmppService", - "coulnd start intent for pgp anncouncment"); - } + } catch (SendIntentException e) {} } @Override @@ -256,6 +257,26 @@ public abstract class XmppActivity extends Activity { builder.create().show(); } + protected void quickEdit(final String previousValue, final OnValueEdited callback) { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + View view = (View) getLayoutInflater().inflate(R.layout.quickedit, null); + final EditText editor = (EditText) view.findViewById(R.id.editor); + editor.setText(previousValue); + builder.setView(view); + builder.setNegativeButton(R.string.cancel, null); + builder.setPositiveButton(R.string.edit, new OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + String value = editor.getText().toString(); + if (!previousValue.equals(value) && value.trim().length() > 0) { + callback.onValueEdited(value); + } + } + }); + builder.create().show(); + } + public void selectPresence(final Conversation conversation, final OnPresenceSelected listener) { Contact contact = conversation.getContact(); |