diff options
Diffstat (limited to 'src/eu/siacs/conversations/ui/XmppActivity.java')
-rw-r--r-- | src/eu/siacs/conversations/ui/XmppActivity.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java index 26a33d1a..cd77557c 100644 --- a/src/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/eu/siacs/conversations/ui/XmppActivity.java @@ -15,6 +15,7 @@ import eu.siacs.conversations.entities.Presences; import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.services.XmppConnectionService.XmppConnectionBinder; import eu.siacs.conversations.utils.ExceptionHelper; +import android.annotation.SuppressLint; import android.app.Activity; import android.app.AlertDialog; import android.app.PendingIntent; @@ -58,11 +59,12 @@ public abstract class XmppActivity extends Activity { protected int mPrimaryTextColor; protected int mSecondaryTextColor; + protected int mSecondaryBackgroundColor; protected int mColorRed; protected int mColorOrange; protected int mColorGreen; protected int mPrimaryColor; - + protected boolean mUseSubject = true; private DisplayMetrics metrics; @@ -206,6 +208,8 @@ public abstract class XmppActivity extends Activity { mColorOrange = getResources().getColor(R.color.orange); mColorGreen = getResources().getColor(R.color.green); mPrimaryColor = getResources().getColor(R.color.primary); + mSecondaryBackgroundColor = getResources().getColor( + R.color.secondarybackground); if (getPreferences().getBoolean("use_larger_font", false)) { setTheme(R.style.ConversationsTheme_LargerText); } @@ -216,7 +220,7 @@ public abstract class XmppActivity extends Activity { return PreferenceManager .getDefaultSharedPreferences(getApplicationContext()); } - + public boolean useSubjectToIdentifyConference() { return mUseSubject; } @@ -245,6 +249,7 @@ public abstract class XmppActivity extends Activity { | Intent.FLAG_ACTIVITY_CLEAR_TOP); } startActivity(viewConversationIntent); + finish(); } public void switchToContactDetails(Contact contact) { @@ -254,7 +259,7 @@ public abstract class XmppActivity extends Activity { intent.putExtra("contact", contact.getJid()); startActivity(intent); } - + public void switchToAccount(Account account) { Intent intent = new Intent(this, EditAccountActivity.class); intent.putExtra("jid", account.getJid()); @@ -292,6 +297,8 @@ public abstract class XmppActivity extends Activity { if (conversation != null) { conversation .setNextEncryption(Message.ENCRYPTION_PGP); + xmppConnectionService.databaseBackend + .updateConversation(conversation); } } @@ -389,6 +396,7 @@ public abstract class XmppActivity extends Activity { quickEdit(previousValue, callback, true); } + @SuppressLint("InflateParams") private void quickEdit(final String previousValue, final OnValueEdited callback, boolean password) { AlertDialog.Builder builder = new AlertDialog.Builder(this); @@ -514,6 +522,10 @@ public abstract class XmppActivity extends Activity { return this.mPrimaryColor; } + public int getSecondaryBackgroundColor() { + return this.mSecondaryBackgroundColor; + } + class BitmapWorkerTask extends AsyncTask<Message, Void, Bitmap> { private final WeakReference<ImageView> imageViewReference; private Message message = null; |