aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs/conversations/ui')
-rw-r--r--src/eu/siacs/conversations/ui/ChooseContactActivity.java30
-rw-r--r--src/eu/siacs/conversations/ui/ConferenceDetailsActivity.java3
-rw-r--r--src/eu/siacs/conversations/ui/ContactDetailsActivity.java10
-rw-r--r--src/eu/siacs/conversations/ui/ConversationActivity.java66
-rw-r--r--src/eu/siacs/conversations/ui/EditAccountActivity.java3
-rw-r--r--src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java4
-rw-r--r--src/eu/siacs/conversations/ui/SettingsActivity.java2
-rw-r--r--src/eu/siacs/conversations/ui/StartConversationActivity.java2
-rw-r--r--src/eu/siacs/conversations/ui/UiCallback.java2
-rw-r--r--src/eu/siacs/conversations/ui/XmppActivity.java5
-rw-r--r--src/eu/siacs/conversations/ui/adapter/AccountAdapter.java6
-rw-r--r--src/eu/siacs/conversations/ui/adapter/KnownHostsAdapter.java6
-rw-r--r--src/eu/siacs/conversations/ui/adapter/MessageAdapter.java57
13 files changed, 111 insertions, 85 deletions
diff --git a/src/eu/siacs/conversations/ui/ChooseContactActivity.java b/src/eu/siacs/conversations/ui/ChooseContactActivity.java
index 4236ea703..83b20cb9b 100644
--- a/src/eu/siacs/conversations/ui/ChooseContactActivity.java
+++ b/src/eu/siacs/conversations/ui/ChooseContactActivity.java
@@ -23,13 +23,13 @@ import eu.siacs.conversations.entities.ListItem;
import eu.siacs.conversations.ui.adapter.ListItemAdapter;
public class ChooseContactActivity extends XmppActivity {
-
+
private ListView mListView;
private ArrayList<ListItem> contacts = new ArrayList<ListItem>();
private ArrayAdapter<ListItem> mContactsAdapter;
-
+
private EditText mSearchEditText;
-
+
private TextWatcher mSearchTextWatcher = new TextWatcher() {
@Override
@@ -47,7 +47,7 @@ public class ChooseContactActivity extends XmppActivity {
int count) {
}
};
-
+
private MenuItem.OnActionExpandListener mOnActionExpandListener = new MenuItem.OnActionExpandListener() {
@Override
@@ -76,35 +76,35 @@ public class ChooseContactActivity extends XmppActivity {
return true;
}
};
-
-
-
+
@Override
public void onCreate(Bundle savedInstanceState) {
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(getApplicationContext(),
+ contacts);
mListView.setAdapter(mContactsAdapter);
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
- public void onItemClick(AdapterView<?> arg0, View arg1, int position,
- long arg3) {
+ public void onItemClick(AdapterView<?> arg0, View arg1,
+ int position, long arg3) {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(mSearchEditText.getWindowToken(),
InputMethodManager.HIDE_IMPLICIT_ONLY);
Intent request = getIntent();
Intent data = new Intent();
- data.putExtra("contact",contacts.get(position).getJid());
- data.putExtra("account",request.getStringExtra("account"));
- data.putExtra("conversation",request.getStringExtra("conversation"));
+ data.putExtra("contact", contacts.get(position).getJid());
+ data.putExtra("account", request.getStringExtra("account"));
+ data.putExtra("conversation",
+ request.getStringExtra("conversation"));
setResult(RESULT_OK, data);
finish();
}
});
}
-
+
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.choose_contact, menu);
@@ -121,7 +121,7 @@ public class ChooseContactActivity extends XmppActivity {
void onBackendConnected() {
filterContacts(null);
}
-
+
protected void filterContacts(String needle) {
this.contacts.clear();
for (Account account : xmppConnectionService.getAccounts()) {
diff --git a/src/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
index c33277f94..40c7eca87 100644
--- a/src/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
+++ b/src/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
@@ -250,7 +250,8 @@ public class ConferenceDetailsActivity extends XmppActivity {
if (contact.showInRoster()) {
bm = contact.getImage(48, this);
name.setText(contact.getDisplayName());
- role.setText(user.getName() + " \u2022 " + getReadableRole(user.getRole()));
+ role.setText(user.getName() + " \u2022 "
+ + getReadableRole(user.getRole()));
} else {
bm = UIHelper.getContactPicture(user.getName(), 48, this,
false);
diff --git a/src/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/eu/siacs/conversations/ui/ContactDetailsActivity.java
index 7c13c5185..a9153db1b 100644
--- a/src/eu/siacs/conversations/ui/ContactDetailsActivity.java
+++ b/src/eu/siacs/conversations/ui/ContactDetailsActivity.java
@@ -111,7 +111,8 @@ public class ContactDetailsActivity extends XmppActivity {
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
if (isChecked) {
- if (contact.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) {
+ if (contact
+ .getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) {
xmppConnectionService.sendPresencePacket(contact
.getAccount(),
xmppConnectionService.getPresenceGenerator()
@@ -146,7 +147,7 @@ public class ContactDetailsActivity extends XmppActivity {
};
private OnAccountUpdate accountUpdate = new OnAccountUpdate() {
-
+
@Override
public void onAccountUpdate() {
runOnUiThread(new Runnable() {
@@ -269,7 +270,7 @@ public class ContactDetailsActivity extends XmppActivity {
send.setOnCheckedChangeListener(this.mOnSendCheckedChange);
receive.setOnCheckedChangeListener(this.mOnReceiveCheckedChange);
-
+
lastseen.setText(UIHelper.lastseen(getApplicationContext(),
contact.lastseen.time));
@@ -363,7 +364,8 @@ public class ContactDetailsActivity extends XmppActivity {
@Override
public void onBackendConnected() {
xmppConnectionService.setOnRosterUpdateListener(this.rosterUpdate);
- xmppConnectionService.setOnAccountListChangedListener(this.accountUpdate );
+ xmppConnectionService
+ .setOnAccountListChangedListener(this.accountUpdate);
if ((accountJid != null) && (contactJid != null)) {
Account account = xmppConnectionService
.findAccountByJid(accountJid);
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java
index c68063d23..6504f0569 100644
--- a/src/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/eu/siacs/conversations/ui/ConversationActivity.java
@@ -35,7 +35,6 @@ import android.graphics.drawable.Drawable;
import android.support.v4.widget.SlidingPaneLayout;
import android.support.v4.widget.SlidingPaneLayout.PanelSlideListener;
import android.util.DisplayMetrics;
-import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
@@ -81,7 +80,7 @@ public class ConversationActivity extends XmppActivity {
private ArrayAdapter<Conversation> listAdapter;
private OnConversationUpdate onConvChanged = new OnConversationUpdate() {
-
+
@Override
public void onConversationUpdate() {
runOnUiThread(new Runnable() {
@@ -111,7 +110,7 @@ public class ConversationActivity extends XmppActivity {
protected ConversationActivity activity = this;
private DisplayMetrics metrics;
private Toast prepareImageToast;
-
+
private Uri pendingImageUri = null;
public List<Conversation> getConversationList() {
@@ -148,7 +147,7 @@ public class ConversationActivity extends XmppActivity {
setContentView(R.layout.fragment_conversations_overview);
listView = (ListView) findViewById(R.id.list);
-
+
getActionBar().setDisplayHomeAsUpEnabled(false);
getActionBar().setHomeButtonEnabled(false);
@@ -179,7 +178,7 @@ public class ConversationActivity extends XmppActivity {
public void onPanelOpened(View arg0) {
paneShouldBeOpen = true;
ActionBar ab = getActionBar();
- if (ab!=null) {
+ if (ab != null) {
ab.setDisplayHomeAsUpEnabled(false);
ab.setHomeButtonEnabled(false);
ab.setTitle(R.string.app_name);
@@ -194,11 +193,11 @@ public class ConversationActivity extends XmppActivity {
if ((conversationList.size() > 0)
&& (getSelectedConversation() != null)) {
ActionBar ab = getActionBar();
- if (ab!=null) {
+ if (ab != null) {
ab.setDisplayHomeAsUpEnabled(true);
ab.setHomeButtonEnabled(true);
- ab.setTitle(
- getSelectedConversation().getName(useSubject));
+ ab.setTitle(getSelectedConversation().getName(
+ useSubject));
}
invalidateOptionsMenu();
if (!getSelectedConversation().isRead()) {
@@ -232,7 +231,8 @@ public class ConversationActivity extends XmppActivity {
MenuItem menuClearHistory = (MenuItem) menu
.findItem(R.id.action_clear_history);
MenuItem menuAdd = (MenuItem) menu.findItem(R.id.action_add);
- MenuItem menuInviteContact = (MenuItem) menu.findItem(R.id.action_invite);
+ MenuItem menuInviteContact = (MenuItem) menu
+ .findItem(R.id.action_invite);
if ((spl.isOpen() && (spl.isSlideable()))) {
menuArchive.setVisible(false);
@@ -267,11 +267,12 @@ public class ConversationActivity extends XmppActivity {
@Override
public void onPresenceSelected() {
if (attachmentChoice == ATTACHMENT_CHOICE_TAKE_PHOTO) {
- pendingImageUri = xmppConnectionService.getFileBackend().getTakePhotoUri();
- Log.d("xmppService",pendingImageUri.toString());
+ pendingImageUri = xmppConnectionService.getFileBackend()
+ .getTakePhotoUri();
Intent takePictureIntent = new Intent(
MediaStore.ACTION_IMAGE_CAPTURE);
- takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT,pendingImageUri);
+ takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT,
+ pendingImageUri);
if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(takePictureIntent,
REQUEST_IMAGE_CAPTURE);
@@ -353,7 +354,7 @@ public class ConversationActivity extends XmppActivity {
return true;
case R.id.action_attach_file:
View menuAttachFile = findViewById(R.id.action_attach_file);
- if (menuAttachFile==null) {
+ if (menuAttachFile == null) {
break;
}
PopupMenu attachFilePopup = new PopupMenu(this, menuAttachFile);
@@ -405,7 +406,7 @@ public class ConversationActivity extends XmppActivity {
case R.id.action_security:
final Conversation conversation = getSelectedConversation();
View menuItemView = findViewById(R.id.action_security);
- if (menuItemView==null) {
+ if (menuItemView == null) {
break;
}
PopupMenu popup = new PopupMenu(this, menuItemView);
@@ -527,11 +528,11 @@ public class ConversationActivity extends XmppActivity {
ConversationFragment selectedFragment = new ConversationFragment();
if (!isFinishing()) {
- FragmentTransaction transaction = getFragmentManager()
- .beginTransaction();
- transaction.replace(R.id.selected_conversation, selectedFragment,
- "conversation");
-
+ FragmentTransaction transaction = getFragmentManager()
+ .beginTransaction();
+ transaction.replace(R.id.selected_conversation, selectedFragment,
+ "conversation");
+
transaction.commitAllowingStateLoss();
}
return selectedFragment;
@@ -553,7 +554,8 @@ public class ConversationActivity extends XmppActivity {
if (xmppConnectionServiceBound) {
if ((Intent.ACTION_VIEW.equals(intent.getAction()) && (VIEW_CONVERSATION
.equals(intent.getType())))) {
- String convToView = (String) intent.getExtras().get(CONVERSATION);
+ String convToView = (String) intent.getExtras().get(
+ CONVERSATION);
updateConversationList();
for (int i = 0; i < conversationList.size(); ++i) {
if (conversationList.get(i).getUuid().equals(convToView)) {
@@ -600,9 +602,10 @@ public class ConversationActivity extends XmppActivity {
if (conversationList.size() == 0) {
updateConversationList();
}
-
- if (getSelectedConversation()!=null && pendingImageUri !=null) {
- attachImageToConversation(getSelectedConversation(), pendingImageUri);
+
+ if (getSelectedConversation() != null && pendingImageUri != null) {
+ attachImageToConversation(getSelectedConversation(),
+ pendingImageUri);
pendingImageUri = null;
} else {
pendingImageUri = null;
@@ -670,7 +673,8 @@ public class ConversationActivity extends XmppActivity {
} else if (requestCode == REQUEST_ATTACH_FILE_DIALOG) {
pendingImageUri = data.getData();
if (xmppConnectionServiceBound) {
- attachImageToConversation(getSelectedConversation(),pendingImageUri);
+ attachImageToConversation(getSelectedConversation(),
+ pendingImageUri);
pendingImageUri = null;
}
} else if (requestCode == REQUEST_SEND_PGP_IMAGE) {
@@ -686,10 +690,12 @@ public class ConversationActivity extends XmppActivity {
// encryptTextMessage();
} else if (requestCode == REQUEST_IMAGE_CAPTURE) {
if (xmppConnectionServiceBound) {
- attachImageToConversation(getSelectedConversation(), pendingImageUri);
+ attachImageToConversation(getSelectedConversation(),
+ pendingImageUri);
pendingImageUri = null;
}
- Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
+ Intent intent = new Intent(
+ Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
intent.setData(pendingImageUri);
sendBroadcast(intent);
} else if (requestCode == REQUEST_RECORD_AUDIO) {
@@ -700,7 +706,7 @@ public class ConversationActivity extends XmppActivity {
}
private void attachAudioToConversation(Conversation conversation, Uri uri) {
-
+
}
private void attachImageToConversation(Conversation conversation, Uri uri) {
@@ -744,7 +750,8 @@ public class ConversationActivity extends XmppActivity {
}
public void updateConversationList() {
- xmppConnectionService.populateWithOrderedConversations(conversationList);
+ xmppConnectionService
+ .populateWithOrderedConversations(conversationList);
listView.invalidateViews();
}
@@ -761,7 +768,8 @@ public class ConversationActivity extends XmppActivity {
try {
this.startIntentSenderForResult(pi.getIntentSender(), requestCode,
null, 0, 0, 0);
- } catch (SendIntentException e1) {}
+ } catch (SendIntentException e1) {
+ }
}
class BitmapWorkerTask extends AsyncTask<Message, Void, Bitmap> {
diff --git a/src/eu/siacs/conversations/ui/EditAccountActivity.java b/src/eu/siacs/conversations/ui/EditAccountActivity.java
index d98a0ca71..6cee8386c 100644
--- a/src/eu/siacs/conversations/ui/EditAccountActivity.java
+++ b/src/eu/siacs/conversations/ui/EditAccountActivity.java
@@ -201,7 +201,8 @@ public class EditAccountActivity extends XmppActivity {
this.mSaveButton.setEnabled(true);
this.mSaveButton.setTextColor(getPrimaryTextColor());
if (jidToEdit != null) {
- if (mAccount!= null && mAccount.getStatus() == Account.STATUS_ONLINE) {
+ if (mAccount != null
+ && mAccount.getStatus() == Account.STATUS_ONLINE) {
this.mSaveButton.setText(R.string.save);
} else {
this.mSaveButton.setText(R.string.connect);
diff --git a/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java b/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
index c979d1379..f46d92f9a 100644
--- a/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
+++ b/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
@@ -46,7 +46,7 @@ public class PublishProfilePictureActivity extends XmppActivity {
public void run() {
if (mInitialAccountSetup) {
startActivity(new Intent(getApplicationContext(),
- StartConversationActivity.class));
+ StartConversationActivity.class));
}
finish();
}
@@ -111,7 +111,7 @@ public class PublishProfilePictureActivity extends XmppActivity {
public void onClick(View v) {
if (mInitialAccountSetup) {
startActivity(new Intent(getApplicationContext(),
- StartConversationActivity.class));
+ StartConversationActivity.class));
}
finish();
}
diff --git a/src/eu/siacs/conversations/ui/SettingsActivity.java b/src/eu/siacs/conversations/ui/SettingsActivity.java
index f8fd94695..64fbde08d 100644
--- a/src/eu/siacs/conversations/ui/SettingsActivity.java
+++ b/src/eu/siacs/conversations/ui/SettingsActivity.java
@@ -14,7 +14,7 @@ public class SettingsActivity extends XmppActivity {
@Override
void onBackendConnected() {
-
+
}
}
diff --git a/src/eu/siacs/conversations/ui/StartConversationActivity.java b/src/eu/siacs/conversations/ui/StartConversationActivity.java
index bd66bd94f..6adada761 100644
--- a/src/eu/siacs/conversations/ui/StartConversationActivity.java
+++ b/src/eu/siacs/conversations/ui/StartConversationActivity.java
@@ -340,7 +340,7 @@ public class StartConversationActivity extends XmppActivity {
String contactJid = jid.getText().toString();
Account account = xmppConnectionService
.findAccountByJid(accountJid);
- if (account==null) {
+ if (account == null) {
dialog.dismiss();
return;
}
diff --git a/src/eu/siacs/conversations/ui/UiCallback.java b/src/eu/siacs/conversations/ui/UiCallback.java
index 05a869f7d..c80199e17 100644
--- a/src/eu/siacs/conversations/ui/UiCallback.java
+++ b/src/eu/siacs/conversations/ui/UiCallback.java
@@ -4,6 +4,8 @@ import android.app.PendingIntent;
public interface UiCallback<T> {
public void success(T object);
+
public void error(int errorCode, T object);
+
public void userInputRequried(PendingIntent pi, T object);
}
diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java
index 44043a794..11376eb74 100644
--- a/src/eu/siacs/conversations/ui/XmppActivity.java
+++ b/src/eu/siacs/conversations/ui/XmppActivity.java
@@ -1,5 +1,6 @@
package eu.siacs.conversations.ui;
+import eu.siacs.conversations.Config;
import eu.siacs.conversations.R;
import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.entities.Contact;
@@ -34,8 +35,6 @@ public abstract class XmppActivity extends Activity {
protected static final int REQUEST_ANNOUNCE_PGP = 0x0101;
protected static final int REQUEST_INVITE_TO_CONVERSATION = 0x0102;
- protected final static String LOGTAG = "xmppService";
-
public XmppConnectionService xmppConnectionService;
public boolean xmppConnectionServiceBound = false;
protected boolean handledViewIntent = false;
@@ -370,7 +369,7 @@ public abstract class XmppActivity extends Activity {
if (conversation.getMode() == Conversation.MODE_MULTI) {
xmppConnectionService.invite(conversation, contactJid);
}
- Log.d("xmppService", "inviting " + contactJid + " to "
+ Log.d(Config.LOGTAG, "inviting " + contactJid + " to "
+ conversation.getName(true));
}
}
diff --git a/src/eu/siacs/conversations/ui/adapter/AccountAdapter.java b/src/eu/siacs/conversations/ui/adapter/AccountAdapter.java
index cd8b376fc..5c25bf346 100644
--- a/src/eu/siacs/conversations/ui/adapter/AccountAdapter.java
+++ b/src/eu/siacs/conversations/ui/adapter/AccountAdapter.java
@@ -14,9 +14,9 @@ import android.widget.ImageView;
import android.widget.TextView;
public class AccountAdapter extends ArrayAdapter<Account> {
-
+
private XmppActivity activity;
-
+
public AccountAdapter(XmppActivity activity, List<Account> objects) {
super(activity, 0, objects);
this.activity = activity;
@@ -34,7 +34,7 @@ public class AccountAdapter extends ArrayAdapter<Account> {
jid.setText(account.getJid());
TextView statusView = (TextView) view.findViewById(R.id.account_status);
ImageView imageView = (ImageView) view.findViewById(R.id.account_image);
- imageView.setImageBitmap(account.getImage(activity,48));
+ imageView.setImageBitmap(account.getImage(activity, 48));
switch (account.getStatus()) {
case Account.STATUS_DISABLED:
statusView.setText(getContext().getString(
diff --git a/src/eu/siacs/conversations/ui/adapter/KnownHostsAdapter.java b/src/eu/siacs/conversations/ui/adapter/KnownHostsAdapter.java
index d286052cb..0534bc25c 100644
--- a/src/eu/siacs/conversations/ui/adapter/KnownHostsAdapter.java
+++ b/src/eu/siacs/conversations/ui/adapter/KnownHostsAdapter.java
@@ -19,7 +19,8 @@ public class KnownHostsAdapter extends ArrayAdapter<String> {
final String[] split = constraint.toString().split("@");
if (split.length == 1) {
for (String domain : domains) {
- suggestions.add(split[0].toLowerCase(Locale.getDefault()) + "@" + domain);
+ suggestions.add(split[0].toLowerCase(Locale
+ .getDefault()) + "@" + domain);
}
} else if (split.length == 2) {
for (String domain : domains) {
@@ -27,7 +28,8 @@ public class KnownHostsAdapter extends ArrayAdapter<String> {
suggestions.clear();
break;
} else if (domain.contains(split[1])) {
- suggestions.add(split[0].toLowerCase(Locale.getDefault()) + "@" + domain);
+ suggestions.add(split[0].toLowerCase(Locale
+ .getDefault()) + "@" + domain);
}
}
} else {
diff --git a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java
index 48e1414b5..fcb574904 100644
--- a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java
+++ b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java
@@ -14,7 +14,6 @@ import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Typeface;
-import android.text.Html;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
@@ -68,8 +67,9 @@ public class MessageAdapter extends ArrayAdapter<Message> {
public void setOnContactPictureClicked(OnContactPictureClicked listener) {
this.mOnContactPictureClickedListener = listener;
}
-
- public void setOnContactPictureLongClicked(OnContactPictureLongClicked listener) {
+
+ public void setOnContactPictureLongClicked(
+ OnContactPictureLongClicked listener) {
this.mOnContactPictureLongClickedListener = listener;
}
@@ -219,7 +219,8 @@ public class MessageAdapter extends ArrayAdapter<Message> {
} else {
String privateMarker;
if (message.getStatus() <= Message.STATUS_RECEIVED) {
- privateMarker = activity.getString(R.string.private_message);
+ privateMarker = activity
+ .getString(R.string.private_message);
} else {
String to;
if (message.getPresence() != null) {
@@ -227,11 +228,18 @@ public class MessageAdapter extends ArrayAdapter<Message> {
} else {
to = message.getCounterpart();
}
- privateMarker = activity.getString(R.string.private_message_to, to);
+ privateMarker = activity.getString(
+ R.string.private_message_to, to);
}
- SpannableString span = new SpannableString(privateMarker+" "+message.getBody());
- span.setSpan(new ForegroundColorSpan(activity.getSecondaryTextColor()), 0, privateMarker.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
- span.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 0, privateMarker.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ SpannableString span = new SpannableString(privateMarker + " "
+ + message.getBody());
+ span.setSpan(
+ new ForegroundColorSpan(activity
+ .getSecondaryTextColor()), 0, privateMarker
+ .length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ span.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 0,
+ privateMarker.length(),
+ Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
viewHolder.messageBody.setText(span);
}
} else {
@@ -401,10 +409,11 @@ public class MessageAdapter extends ArrayAdapter<Message> {
contact, getContext()));
} else {
String name = item.getPresence();
- if (name==null) {
+ if (name == null) {
name = item.getCounterpart();
}
- viewHolder.contact_picture.setImageBitmap(mBitmapCache.get(name, getContext()));
+ viewHolder.contact_picture.setImageBitmap(mBitmapCache.get(
+ name, getContext()));
}
viewHolder.contact_picture
.setOnClickListener(new OnClickListener() {
@@ -419,18 +428,20 @@ public class MessageAdapter extends ArrayAdapter<Message> {
}
});
- viewHolder.contact_picture.setOnLongClickListener(new OnLongClickListener() {
-
- @Override
- public boolean onLongClick(View v) {
- if (MessageAdapter.this.mOnContactPictureLongClickedListener != null) {
- MessageAdapter.this.mOnContactPictureLongClickedListener.onContactPictureLongClicked(item);
- return true;
- } else {
- return false;
- }
- }
- });
+ viewHolder.contact_picture
+ .setOnLongClickListener(new OnLongClickListener() {
+
+ @Override
+ public boolean onLongClick(View v) {
+ if (MessageAdapter.this.mOnContactPictureLongClickedListener != null) {
+ MessageAdapter.this.mOnContactPictureLongClickedListener
+ .onContactPictureLongClicked(item);
+ return true;
+ } else {
+ return false;
+ }
+ }
+ });
}
}
@@ -529,7 +540,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
public interface OnContactPictureClicked {
public void onContactPictureClicked(Message message);
}
-
+
public interface OnContactPictureLongClicked {
public void onContactPictureLongClicked(Message message);
}