diff options
Diffstat (limited to 'src/eu/siacs/conversations/ui')
7 files changed, 53 insertions, 34 deletions
diff --git a/src/eu/siacs/conversations/ui/ChooseContactActivity.java b/src/eu/siacs/conversations/ui/ChooseContactActivity.java index 449fc5467..277d21d6a 100644 --- a/src/eu/siacs/conversations/ui/ChooseContactActivity.java +++ b/src/eu/siacs/conversations/ui/ChooseContactActivity.java @@ -82,8 +82,7 @@ public class ChooseContactActivity extends XmppActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_choose_contact); mListView = (ListView) findViewById(R.id.choose_contact_list); - mContactsAdapter = new ListItemAdapter(getApplicationContext(), - contacts); + mContactsAdapter = new ListItemAdapter(this, contacts); mListView.setAdapter(mContactsAdapter); mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @@ -98,7 +97,7 @@ public class ChooseContactActivity extends XmppActivity { ListItem mListItem = contacts.get(position); data.putExtra("contact", mListItem.getJid()); String account = request.getStringExtra("account"); - if (account==null && mListItem instanceof Contact) { + if (account == null && mListItem instanceof Contact) { account = ((Contact) mListItem).getAccount().getJid(); } data.putExtra("account", account); diff --git a/src/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/eu/siacs/conversations/ui/ContactDetailsActivity.java index 17ea5f98b..8de2ce804 100644 --- a/src/eu/siacs/conversations/ui/ContactDetailsActivity.java +++ b/src/eu/siacs/conversations/ui/ContactDetailsActivity.java @@ -325,16 +325,18 @@ public class ContactDetailsActivity extends XmppActivity { for (Iterator<String> iterator = contact.getOtrFingerprints() .iterator(); iterator.hasNext();) { final String otrFingerprint = iterator.next(); - View view = (View) inflater.inflate(R.layout.contact_key, keys,false); + View view = (View) inflater.inflate(R.layout.contact_key, keys, + false); TextView key = (TextView) view.findViewById(R.id.key); TextView keyType = (TextView) view.findViewById(R.id.key_type); - ImageButton remove = (ImageButton) view.findViewById(R.id.button_remove); + ImageButton remove = (ImageButton) view + .findViewById(R.id.button_remove); remove.setVisibility(View.VISIBLE); keyType.setText("OTR Fingerprint"); key.setText(otrFingerprint); keys.addView(view); remove.setOnClickListener(new OnClickListener() { - + @Override public void onClick(View v) { confirmToDeleteFingerprint(otrFingerprint); @@ -342,7 +344,8 @@ public class ContactDetailsActivity extends XmppActivity { }); } if (contact.getPgpKeyId() != 0) { - View view = (View) inflater.inflate(R.layout.contact_key, keys,false); + View view = (View) inflater.inflate(R.layout.contact_key, keys, + false); TextView key = (TextView) view.findViewById(R.id.key); TextView keyType = (TextView) view.findViewById(R.id.key_type); keyType.setText("PGP Key ID"); @@ -370,23 +373,25 @@ public class ContactDetailsActivity extends XmppActivity { keys.addView(view); } } - + protected void confirmToDeleteFingerprint(final String fingerprint) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.delete_fingerprint); builder.setMessage(R.string.sure_delete_fingerprint); builder.setNegativeButton(R.string.cancel, null); - builder.setPositiveButton(R.string.delete,new android.content.DialogInterface.OnClickListener() { + builder.setPositiveButton(R.string.delete, + new android.content.DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - if (contact.deleteOtrFingerprint(fingerprint)) { - populateView(); - xmppConnectionService.syncRosterToDisk(contact.getAccount()); - } - } - - }); + @Override + public void onClick(DialogInterface dialog, int which) { + if (contact.deleteOtrFingerprint(fingerprint)) { + populateView(); + xmppConnectionService.syncRosterToDisk(contact + .getAccount()); + } + } + + }); builder.create().show(); } diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java index df0112aee..5eedda1c7 100644 --- a/src/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/eu/siacs/conversations/ui/ConversationActivity.java @@ -324,7 +324,8 @@ public class ConversationActivity extends XmppActivity { } else { showInstallPgpDialog(); } - } else if (getSelectedConversation().getNextEncryption(forceEncryption()) == Message.ENCRYPTION_NONE) { + } else if (getSelectedConversation().getNextEncryption( + forceEncryption()) == Message.ENCRYPTION_NONE) { selectPresenceToAttachFile(attachmentChoice); } else { selectPresenceToAttachFile(attachmentChoice); @@ -440,7 +441,8 @@ public class ConversationActivity extends XmppActivity { popup.inflate(R.menu.encryption_choices); MenuItem otr = popup.getMenu().findItem( R.id.encryption_choice_otr); - MenuItem none = popup.getMenu().findItem(R.id.encryption_choice_none); + MenuItem none = popup.getMenu().findItem( + R.id.encryption_choice_none); if (conversation.getMode() == Conversation.MODE_MULTI) { otr.setEnabled(false); } else { diff --git a/src/eu/siacs/conversations/ui/SettingsActivity.java b/src/eu/siacs/conversations/ui/SettingsActivity.java index c522e058a..6b2807199 100644 --- a/src/eu/siacs/conversations/ui/SettingsActivity.java +++ b/src/eu/siacs/conversations/ui/SettingsActivity.java @@ -2,6 +2,7 @@ package eu.siacs.conversations.ui; import java.util.Locale; +import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Account; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; diff --git a/src/eu/siacs/conversations/ui/StartConversationActivity.java b/src/eu/siacs/conversations/ui/StartConversationActivity.java index 6adada761..6287070c4 100644 --- a/src/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/eu/siacs/conversations/ui/StartConversationActivity.java @@ -191,8 +191,7 @@ public class StartConversationActivity extends XmppActivity { } }); - mConferenceAdapter = new ListItemAdapter(getApplicationContext(), - conferences); + mConferenceAdapter = new ListItemAdapter(this, conferences); mConferenceListFragment.setListAdapter(mConferenceAdapter); mConferenceListFragment.setContextMenu(R.menu.conference_context); mConferenceListFragment @@ -205,8 +204,7 @@ public class StartConversationActivity extends XmppActivity { } }); - mContactsAdapter = new ListItemAdapter(getApplicationContext(), - contacts); + mContactsAdapter = new ListItemAdapter(this, contacts); mContactsListFragment.setListAdapter(mContactsAdapter); mContactsListFragment.setContextMenu(R.menu.contact_context); mContactsListFragment diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java index b7cce11da..f13c112a9 100644 --- a/src/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/eu/siacs/conversations/ui/XmppActivity.java @@ -21,6 +21,7 @@ import android.app.AlertDialog.Builder; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; +import android.content.SharedPreferences; import android.content.DialogInterface.OnClickListener; import android.content.IntentSender.SendIntentException; import android.content.res.Resources; @@ -33,6 +34,7 @@ import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.os.IBinder; +import android.preference.PreferenceManager; import android.text.InputType; import android.util.DisplayMetrics; import android.util.Log; @@ -183,6 +185,14 @@ public abstract class XmppActivity extends Activity { mSecondaryTextColor = getResources().getColor(R.color.secondarytext); mWarningTextColor = getResources().getColor(R.color.warningtext); mPrimaryColor = getResources().getColor(R.color.primary); + if (getPreferences().getBoolean("use_larger_font", false)) { + setTheme(R.style.ConversationsTheme_LargerText); + } + } + + protected SharedPreferences getPreferences() { + return PreferenceManager + .getDefaultSharedPreferences(getApplicationContext()); } public void switchToConversation(Conversation conversation) { @@ -309,26 +319,28 @@ public abstract class XmppActivity extends Activity { @Override public void onClick(DialogInterface dialog, int which) { if (xmppConnectionServiceBound) { - xmppConnectionService.sendPresencePacket(contact.getAccount(), - xmppConnectionService.getPresenceGenerator() - .requestPresenceUpdatesFrom(contact)); + xmppConnectionService.sendPresencePacket(contact + .getAccount(), xmppConnectionService + .getPresenceGenerator() + .requestPresenceUpdatesFrom(contact)); } } }); builder.create().show(); } - - private void warnMutalPresenceSubscription(final Conversation conversation,final OnPresenceSelected listener) { + + private void warnMutalPresenceSubscription(final Conversation conversation, + final OnPresenceSelected listener) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(conversation.getContact().getJid()); builder.setMessage(R.string.without_mutual_presence_updates); builder.setNegativeButton(R.string.cancel, null); builder.setPositiveButton(R.string.ignore, new OnClickListener() { - + @Override public void onClick(DialogInterface dialog, int which) { conversation.setNextPresence(null); - if (listener!=null) { + if (listener != null) { listener.onPresenceSelected(); } } @@ -388,8 +400,9 @@ public abstract class XmppActivity extends Activity { && !contact.getOption(Contact.Options.ASKING) && contact.getAccount().getStatus() == Account.STATUS_ONLINE) { showAskForPresenceDialog(contact); - } else if (!contact.getOption(Contact.Options.TO) || !contact.getOption(Contact.Options.FROM)) { - warnMutalPresenceSubscription(conversation,listener); + } else if (!contact.getOption(Contact.Options.TO) + || !contact.getOption(Contact.Options.FROM)) { + warnMutalPresenceSubscription(conversation, listener); } else { conversation.setNextPresence(null); listener.onPresenceSelected(); diff --git a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java index 1abd208d7..967042d80 100644 --- a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -462,7 +462,8 @@ public class MessageAdapter extends ArrayAdapter<Message> { @Override public void onClick(View v) { - Downloadable downloadable = item.getDownloadable(); + Downloadable downloadable = item + .getDownloadable(); if (downloadable != null) { downloadable.start(); } |