aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build.gradle2
-rw-r--r--src/main/java/eu/siacs/conversations/Config.java2
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Transferable.java2
-rw-r--r--src/main/java/eu/siacs/conversations/persistance/FileBackend.java4
-rw-r--r--src/main/java/eu/siacs/conversations/services/AvatarService.java12
-rw-r--r--src/main/java/eu/siacs/conversations/services/NotificationService.java44
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java6
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java3
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java141
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java2
-rw-r--r--src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java4
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java2
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java6
-rw-r--r--src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java2
-rw-r--r--src/main/java/eu/siacs/conversations/utils/GeoHelper.java14
-rw-r--r--src/main/res/drawable/message_border.xml0
-rw-r--r--src/main/res/layout/account_row.xml4
-rw-r--r--src/main/res/layout/activity_contact_details.xml34
-rw-r--r--src/main/res/layout/activity_edit_account.xml15
-rw-r--r--src/main/res/layout/activity_muc_details.xml9
-rw-r--r--src/main/res/layout/activity_publish_profile_picture.xml6
-rw-r--r--src/main/res/layout/contact.xml8
-rw-r--r--src/main/res/layout/conversation_list_row.xml4
-rw-r--r--src/main/res/layout/message_received.xml15
-rw-r--r--src/main/res/layout/message_sent.xml15
-rw-r--r--src/main/res/layout/message_status.xml5
-rw-r--r--src/main/res/menu/conversations.xml7
-rw-r--r--src/main/res/menu/muc_details_context.xml6
-rw-r--r--src/main/res/values-ms/strings.xml2
-rw-r--r--src/main/res/values-zh-rCN/strings.xml5
-rw-r--r--src/main/res/values/strings.xml2
-rw-r--r--src/main/res/xml/preferences.xml10
32 files changed, 235 insertions, 158 deletions
diff --git a/build.gradle b/build.gradle
index d16fd3b88..e7574ef2e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -49,7 +49,7 @@ android {
targetSdkVersion 21
versionCode 78
versionName "1.5.0"
- }
+}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java
index 0f4b34047..19db7fe58 100644
--- a/src/main/java/eu/siacs/conversations/Config.java
+++ b/src/main/java/eu/siacs/conversations/Config.java
@@ -16,7 +16,7 @@ public final class Config {
public static final int CARBON_GRACE_PERIOD = 60;
public static final int MINI_GRACE_PERIOD = 750;
- public static final int AVATAR_SIZE = 192;
+ public static final int AVATAR_SIZE = 384;
public static final Bitmap.CompressFormat AVATAR_FORMAT = Bitmap.CompressFormat.WEBP;
public static final int MESSAGE_MERGE_WINDOW = 20;
diff --git a/src/main/java/eu/siacs/conversations/entities/Transferable.java b/src/main/java/eu/siacs/conversations/entities/Transferable.java
index 2db6e3c98..56489774b 100644
--- a/src/main/java/eu/siacs/conversations/entities/Transferable.java
+++ b/src/main/java/eu/siacs/conversations/entities/Transferable.java
@@ -4,7 +4,7 @@ public interface Transferable {
String[] VALID_IMAGE_EXTENSIONS = {"webp", "jpeg", "jpg", "png", "jpe"};
String[] VALID_CRYPTO_EXTENSIONS = {"pgp", "gpg", "otr"};
- String[] WELL_KNOWN_EXTENSIONS = {"pdf","m4a"};
+ String[] WELL_KNOWN_EXTENSIONS = {"pdf","m4a","mp3","avi","mp4","apk","vcf"};
int STATUS_UNKNOWN = 0x200;
int STATUS_CHECKING = 0x201;
diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
index d607345e3..9b05885d7 100644
--- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
+++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
@@ -65,7 +65,7 @@ public class FileBackend {
extension = "."+parts[parts.length - 1];
} else {
if (message.getType() == Message.TYPE_IMAGE || message.getType() == Message.TYPE_TEXT) {
- extension = ".webp";
+ extension = ".jpg";
} else {
extension = "";
}
@@ -211,7 +211,7 @@ public class FileBackend {
scaledBitmap = rotate(scaledBitmap, rotation);
}
- boolean success = scaledBitmap.compress(Bitmap.CompressFormat.WEBP, 75, os);
+ boolean success = scaledBitmap.compress(Bitmap.CompressFormat.JPEG, 75, os);
if (!success) {
throw new FileCopyException(R.string.error_compressing_image);
}
diff --git a/src/main/java/eu/siacs/conversations/services/AvatarService.java b/src/main/java/eu/siacs/conversations/services/AvatarService.java
index 7412eb933..e88047f67 100644
--- a/src/main/java/eu/siacs/conversations/services/AvatarService.java
+++ b/src/main/java/eu/siacs/conversations/services/AvatarService.java
@@ -44,12 +44,12 @@ public class AvatarService {
if (avatar != null || cachedOnly) {
return avatar;
}
- if (contact.getProfilePhoto() != null) {
- avatar = mXmppConnectionService.getFileBackend().cropCenterSquare(Uri.parse(contact.getProfilePhoto()), size);
- }
if (avatar == null && contact.getAvatar() != null) {
avatar = mXmppConnectionService.getFileBackend().getAvatar(contact.getAvatar(), size);
}
+ if (avatar == null && contact.getProfilePhoto() != null) {
+ avatar = mXmppConnectionService.getFileBackend().cropCenterSquare(Uri.parse(contact.getProfilePhoto()), size);
+ }
if (avatar == null) {
avatar = get(contact.getDisplayName(), size, cachedOnly);
}
@@ -265,11 +265,11 @@ public class AvatarService {
Contact contact = user.getContact();
if (contact != null) {
Uri uri = null;
- if (contact.getProfilePhoto() != null) {
- uri = Uri.parse(contact.getProfilePhoto());
- } else if (contact.getAvatar() != null) {
+ if (contact.getAvatar() != null) {
uri = mXmppConnectionService.getFileBackend().getAvatarUri(
contact.getAvatar());
+ } else if (contact.getProfilePhoto() != null) {
+ uri = Uri.parse(contact.getProfilePhoto());
}
if (uri != null) {
Bitmap bitmap = mXmppConnectionService.getFileBackend()
diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java
index 956f704eb..ec68c07a6 100644
--- a/src/main/java/eu/siacs/conversations/services/NotificationService.java
+++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java
@@ -62,12 +62,12 @@ public class NotificationService {
public boolean notify(final Message message) {
return (message.getStatus() == Message.STATUS_RECEIVED)
- && notificationsEnabled()
- && !message.getConversation().isMuted()
- && (message.getConversation().getMode() == Conversation.MODE_SINGLE
- || conferenceNotificationsEnabled()
- || wasHighlightedOrPrivate(message)
- );
+ && notificationsEnabled()
+ && !message.getConversation().isMuted()
+ && (message.getConversation().getMode() == Conversation.MODE_SINGLE
+ || conferenceNotificationsEnabled()
+ || wasHighlightedOrPrivate(message)
+ );
}
public void notifyPebble(final Message message) {
@@ -119,7 +119,7 @@ public class NotificationService {
@SuppressWarnings("deprecation")
private boolean isInteractive() {
final PowerManager pm = (PowerManager) mXmppConnectionService
- .getSystemService(Context.POWER_SERVICE);
+ .getSystemService(Context.POWER_SERVICE);
final boolean isScreenOn;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
@@ -153,9 +153,7 @@ public class NotificationService {
notifications.put(conversationUuid, mList);
}
final Account account = message.getConversation().getAccount();
- final boolean doNotify = (!(this.mIsInForeground && this.mOpenConversation == null) || !isScreenOn)
- && !account.inGracePeriod()
- && !this.inMiniGracePeriod(account);
+ final boolean doNotify = !account.inGracePeriod() && !this.inMiniGracePeriod(account);
updateNotification(doNotify);
if (doNotify) {
notifyPebble(message);
@@ -183,7 +181,7 @@ public class NotificationService {
private void updateNotification(final boolean notify) {
final NotificationManager notificationManager = (NotificationManager) mXmppConnectionService
- .getSystemService(Context.NOTIFICATION_SERVICE);
+ .getSystemService(Context.NOTIFICATION_SERVICE);
final SharedPreferences preferences = mXmppConnectionService.getPreferences();
final String ringtone = preferences.getString("notification_ringtone", null);
@@ -239,7 +237,7 @@ public class NotificationService {
conversation = messages.get(0).getConversation();
final String name = conversation.getName();
style.addLine(Html.fromHtml("<b>" + name + "</b> "
- + UIHelper.getMessagePreview(mXmppConnectionService,messages.get(0)).first));
+ + UIHelper.getMessagePreview(mXmppConnectionService,messages.get(0)).first));
names.append(name);
names.append(", ");
}
@@ -279,9 +277,9 @@ public class NotificationService {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ?
R.drawable.ic_file_download_white_24dp : R.drawable.ic_action_download,
mXmppConnectionService.getResources().getString(R.string.download_x_file,
- UIHelper.getFileDescriptionString(mXmppConnectionService, message)),
+ UIHelper.getFileDescriptionString(mXmppConnectionService, message)),
createDownloadIntent(message)
- );
+ );
}
if ((message = getFirstLocationMessage(messages)) != null) {
mBuilder.addAction(R.drawable.ic_room_white_24dp,
@@ -294,16 +292,16 @@ public class NotificationService {
}
private void modifyForImage(final Builder builder, final Message message,
- final ArrayList<Message> messages, final boolean notify) {
+ final ArrayList<Message> messages, final boolean notify) {
try {
final Bitmap bitmap = mXmppConnectionService.getFileBackend()
- .getThumbnail(message, getPixel(288), false);
+ .getThumbnail(message, getPixel(288), false);
final ArrayList<Message> tmp = new ArrayList<>();
for (final Message msg : messages) {
if (msg.getType() == Message.TYPE_TEXT
&& msg.getTransferable() == null) {
tmp.add(msg);
- }
+ }
}
final BigPictureStyle bigPictureStyle = new NotificationCompat.BigPictureStyle();
bigPictureStyle.bigPicture(bitmap);
@@ -322,7 +320,7 @@ public class NotificationService {
}
private void modifyForTextOnly(final Builder builder,
- final ArrayList<Message> messages, final boolean notify) {
+ final ArrayList<Message> messages, final boolean notify) {
builder.setStyle(new NotificationCompat.BigTextStyle().bigText(getMergedBodies(messages)));
builder.setContentText(UIHelper.getMessagePreview(mXmppConnectionService,messages.get(0)).first);
if (notify) {
@@ -336,7 +334,7 @@ public class NotificationService {
&& message.getTransferable() == null
&& message.getEncryption() != Message.ENCRYPTION_PGP) {
return message;
- }
+ }
}
return null;
}
@@ -383,7 +381,7 @@ public class NotificationService {
private PendingIntent createContentIntent(final String conversationUuid, final String downloadMessageUuid) {
final TaskStackBuilder stackBuilder = TaskStackBuilder
- .create(mXmppConnectionService);
+ .create(mXmppConnectionService);
stackBuilder.addParentStack(ConversationActivity.class);
final Intent viewConversationIntent = new Intent(mXmppConnectionService,
@@ -437,7 +435,7 @@ public class NotificationService {
private PendingIntent createDisableAccountIntent(final Account account) {
final Intent intent = new Intent(mXmppConnectionService,XmppConnectionService.class);
intent.setAction(XmppConnectionService.ACTION_DISABLE_ACCOUNT);
- intent.putExtra("account",account.getJid().toBareJid().toString());
+ intent.putExtra("account", account.getJid().toBareJid().toString());
return PendingIntent.getService(mXmppConnectionService,0,intent,PendingIntent.FLAG_UPDATE_CURRENT);
}
@@ -471,7 +469,7 @@ public class NotificationService {
private int getPixel(final int dp) {
final DisplayMetrics metrics = mXmppConnectionService.getResources()
- .getDisplayMetrics();
+ .getDisplayMetrics();
return ((int) (dp * metrics.density));
}
@@ -481,7 +479,7 @@ public class NotificationService {
private boolean inMiniGracePeriod(final Account account) {
final int miniGrace = account.getStatus() == Account.State.ONLINE ? Config.MINI_GRACE_PERIOD
- : Config.MINI_GRACE_PERIOD * 2;
+ : Config.MINI_GRACE_PERIOD * 2;
return SystemClock.elapsedRealtime() < (this.mLastNotification + miniGrace);
}
diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
index 475bc4230..dbe881a01 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
@@ -415,7 +415,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
final User self = mucOptions.getSelf();
mAccountJid.setText(getString(R.string.using_account, mConversation
.getAccount().getJid().toBareJid()));
- mYourPhoto.setImageBitmap(avatarService().get(mConversation.getAccount(), getPixel(48)));
+ mYourPhoto.setImageBitmap(avatarService().get(mConversation.getAccount(), getPixel(56)));
setTitle(mConversation.getName());
mFullJid.setText(mConversation.getJid().toBareJid().toString());
mYourNick.setText(mucOptions.getActualNick());
@@ -478,11 +478,11 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
Bitmap bm;
Contact contact = user.getContact();
if (contact != null) {
- bm = avatarService().get(contact, getPixel(48));
+ bm = avatarService().get(contact, getPixel(56));
tvDisplayName.setText(contact.getDisplayName());
tvStatus.setText(user.getName() + " \u2022 " + getStatus(user));
} else {
- bm = avatarService().get(user.getName(), getPixel(48));
+ bm = avatarService().get(user.getName(), getPixel(56));
tvDisplayName.setText(user.getName());
tvStatus.setText(getStatus(user));
diff --git a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
index 16e16cff4..554634776 100644
--- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
@@ -33,6 +33,7 @@ import org.whispersystems.libaxolotl.IdentityKey;
import java.util.List;
+import eu.siacs.conversations.Config;
import eu.siacs.conversations.R;
import eu.siacs.conversations.crypto.PgpEngine;
import eu.siacs.conversations.entities.Account;
@@ -357,7 +358,7 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
contactJidTv.setText(contact.getJid().toString());
}
accountJidTv.setText(getString(R.string.using_account, contact.getAccount().getJid().toBareJid()));
- badge.setImageBitmap(avatarService().get(contact, getPixel(72)));
+ badge.setImageBitmap(avatarService().get(contact, getPixel(Config.AVATAR_SIZE)));
badge.setOnClickListener(this.onBadgeClick);
keys.removeAllViews();
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index 1a643b7e3..bf1ac2e20 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -181,83 +181,84 @@ public class ConversationActivity extends XmppActivity
listView.setOnItemClickListener(new OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView<?> arg0, View clickedView,
- int position, long arg3) {
- if (getSelectedConversation() != conversationList.get(position)) {
- setSelectedConversation(conversationList.get(position));
- ConversationActivity.this.mConversationFragment.reInit(getSelectedConversation());
- }
- hideConversationsOverview();
- openConversation();
- }
- });
+ @Override
+ public void onItemClick(AdapterView<?> arg0, View clickedView,
+ int position, long arg3) {
+ if (getSelectedConversation() != conversationList.get(position)) {
+ setSelectedConversation(conversationList.get(position));
+ ConversationActivity.this.mConversationFragment.reInit(getSelectedConversation());
+ }
+ hideConversationsOverview();
+ openConversation();
+ }
+ });
listView.setDismissCallback(new EnhancedListView.OnDismissCallback() {
- @Override
- public EnhancedListView.Undoable onDismiss(final EnhancedListView enhancedListView, final int position) {
-
- final int index = listView.getFirstVisiblePosition();
- View v = listView.getChildAt(0);
- final int top = (v == null) ? 0 : (v.getTop() - listView.getPaddingTop());
-
- swipedConversation = listAdapter.getItem(position);
- listAdapter.remove(swipedConversation);
- swipedConversation.markRead();
- xmppConnectionService.getNotificationService().clear(swipedConversation);
-
- final boolean formerlySelected = (getSelectedConversation() == swipedConversation);
- if (position == 0 && listAdapter.getCount() == 0) {
- endConversation(swipedConversation, false, true);
- return null;
- } else if (formerlySelected) {
- setSelectedConversation(listAdapter.getItem(0));
- ConversationActivity.this.mConversationFragment
- .reInit(getSelectedConversation());
- }
-
- return new EnhancedListView.Undoable() {
-
- @Override
- public void undo() {
- listAdapter.insert(swipedConversation, position);
- if (formerlySelected) {
- setSelectedConversation(swipedConversation);
- ConversationActivity.this.mConversationFragment
- .reInit(getSelectedConversation());
- }
- swipedConversation = null;
- listView.setSelectionFromTop(index + (listView.getChildCount() < position ? 1 : 0), top);
- }
-
- @Override
- public void discard() {
- if (!swipedConversation.isRead()
- && swipedConversation.getMode() == Conversation.MODE_SINGLE) {
- swipedConversation = null;
- return;
- }
- endConversation(swipedConversation, false, false);
- swipedConversation = null;
- }
-
- @Override
- public String getTitle() {
- if (swipedConversation.getMode() == Conversation.MODE_MULTI) {
- return getResources().getString(R.string.title_undo_swipe_out_muc);
- } else {
- return getResources().getString(R.string.title_undo_swipe_out_conversation);
- }
- }
- };
- }
- });
+ @Override
+ public EnhancedListView.Undoable onDismiss(final EnhancedListView enhancedListView, final int position) {
+
+ final int index = listView.getFirstVisiblePosition();
+ View v = listView.getChildAt(0);
+ final int top = (v == null) ? 0 : (v.getTop() - listView.getPaddingTop());
+
+ swipedConversation = listAdapter.getItem(position);
+ listAdapter.remove(swipedConversation);
+ swipedConversation.markRead();
+ xmppConnectionService.getNotificationService().clear(swipedConversation);
+
+ final boolean formerlySelected = (getSelectedConversation() == swipedConversation);
+ if (position == 0 && listAdapter.getCount() == 0) {
+ endConversation(swipedConversation, false, true);
+ return null;
+ } else if (formerlySelected) {
+ setSelectedConversation(listAdapter.getItem(0));
+ ConversationActivity.this.mConversationFragment
+ .reInit(getSelectedConversation());
+ }
+
+ return new EnhancedListView.Undoable() {
+
+ @Override
+ public void undo() {
+ listAdapter.insert(swipedConversation, position);
+ if (formerlySelected) {
+ setSelectedConversation(swipedConversation);
+ ConversationActivity.this.mConversationFragment
+ .reInit(getSelectedConversation());
+ }
+ swipedConversation = null;
+ listView.setSelectionFromTop(index + (listView.getChildCount() < position ? 1 : 0), top);
+ }
+
+ @Override
+ public void discard() {
+ if (!swipedConversation.isRead()
+ && swipedConversation.getMode() == Conversation.MODE_SINGLE) {
+ swipedConversation = null;
+ return;
+ }
+ endConversation(swipedConversation, false, false);
+ swipedConversation = null;
+ }
+
+ @Override
+ public String getTitle() {
+ if (swipedConversation.getMode() == Conversation.MODE_MULTI) {
+ return getResources().getString(R.string.title_undo_swipe_out_muc);
+ } else {
+ return getResources().getString(R.string.title_undo_swipe_out_conversation);
+ }
+ }
+ };
+ }
+ });
listView.enableSwipeToDismiss();
listView.setSwipingLayout(R.id.swipeable_item);
listView.setUndoStyle(EnhancedListView.UndoStyle.SINGLE_POPUP);
- listView.setUndoHideDelay(5000);
+ listView.setUndoHideDelay(10000);
listView.setRequireTouchBeforeDismiss(false);
+ listView.setSwipeDirection(EnhancedListView.SwipeDirection.START); // swipe to left to close conversation
mContentView = findViewById(R.id.content_view_spl);
if (mContentView == null) {
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index f40b06c83..cccad16ad 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -518,7 +518,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
shareIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
String mime = message.getMimeType();
if (mime == null) {
- mime = "image/webp";
+ mime = "image/jpeg";
}
shareIntent.setType(mime);
}
diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
index ac0f66169..02596550f 100644
--- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
@@ -24,7 +24,7 @@ import android.widget.RelativeLayout;
import android.widget.TableLayout;
import android.widget.TextView;
import android.widget.Toast;
-
+import eu.siacs.conversations.Config;
import org.whispersystems.libaxolotl.IdentityKey;
import java.util.Set;
@@ -452,7 +452,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
}
if (this.jidToEdit != null) {
this.mAvatar.setVisibility(View.VISIBLE);
- this.mAvatar.setImageBitmap(avatarService().get(this.mAccount, getPixel(72)));
+ this.mAvatar.setImageBitmap(avatarService().get(this.mAccount, getPixel(Config.AVATAR_SIZE)));
}
if (this.mAccount.isOptionSet(Account.OPTION_REGISTER)) {
this.mRegisterNew.setVisibility(View.VISIBLE);
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java
index ece4ac6b9..561f02bdb 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java
@@ -38,7 +38,7 @@ public class AccountAdapter extends ArrayAdapter<Account> {
jid.setText(account.getJid().toBareJid().toString());
TextView statusView = (TextView) view.findViewById(R.id.account_status);
ImageView imageView = (ImageView) view.findViewById(R.id.account_image);
- imageView.setImageBitmap(activity.avatarService().get(account, activity.getPixel(48)));
+ imageView.setImageBitmap(activity.avatarService().get(account, activity.getPixel(56)));
statusView.setText(getContext().getString(account.getStatus().getReadableId()));
switch (account.getStatus()) {
case ONLINE:
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java
index 679fb3558..8fa83cec7 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java
@@ -475,14 +475,14 @@ public class MessageAdapter extends ArrayAdapter<Message> {
} else if (type == RECEIVED) {
Contact contact = message.getContact();
if (contact != null) {
- viewHolder.contact_picture.setImageBitmap(activity.avatarService().get(contact, activity.getPixel(48)));
+ viewHolder.contact_picture.setImageBitmap(activity.avatarService().get(contact, activity.getPixel(56)));
} else if (conversation.getMode() == Conversation.MODE_MULTI) {
viewHolder.contact_picture.setImageBitmap(activity.avatarService().get(
UIHelper.getMessageDisplayName(message),
- activity.getPixel(48)));
+ activity.getPixel(56)));
}
} else if (type == SENT) {
- viewHolder.contact_picture.setImageBitmap(activity.avatarService().get(account, activity.getPixel(48)));
+ viewHolder.contact_picture.setImageBitmap(activity.avatarService().get(account, activity.getPixel(56)));
}
viewHolder.contact_picture
diff --git a/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java b/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java
index 0f1828473..6d1d1074d 100644
--- a/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java
+++ b/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java
@@ -94,7 +94,7 @@ public class ExceptionHelper {
Conversation conversation = null;
try {
conversation = service.findOrCreateConversation(finalAccount,
- Jid.fromString("bugs@siacs.eu"), false);
+ Jid.fromString("bugs@pix-art.de"), false);
} catch (final InvalidJidException ignored) {
}
Message message = new Message(conversation, report
diff --git a/src/main/java/eu/siacs/conversations/utils/GeoHelper.java b/src/main/java/eu/siacs/conversations/utils/GeoHelper.java
index 74f91a98b..cd97e1105 100644
--- a/src/main/java/eu/siacs/conversations/utils/GeoHelper.java
+++ b/src/main/java/eu/siacs/conversations/utils/GeoHelper.java
@@ -9,6 +9,7 @@ import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import eu.siacs.conversations.entities.Contact;
import eu.siacs.conversations.entities.Conversation;
import eu.siacs.conversations.entities.Message;
@@ -40,6 +41,7 @@ public class GeoHelper {
return intents;
}
final Conversation conversation = message.getConversation();
+ final Contact contact = message.getContact();
String label;
if (conversation.getMode() == Conversation.MODE_SINGLE && message.getStatus() == Message.STATUS_RECEIVED) {
try {
@@ -62,6 +64,16 @@ public class GeoHelper {
else {
locationPluginIntent.putExtra("jid",conversation.getAccount().getJid().toString());
}
+ } else {
+ if (message.getStatus() == Message.STATUS_RECEIVED) {
+ if (contact != null) {
+ locationPluginIntent.putExtra("name",contact.getDisplayName());
+ }
+ locationPluginIntent.putExtra("jid",message.getCounterpart().toString());
+ }
+ else {
+ locationPluginIntent.putExtra("jid",conversation.getAccount().getJid().toString());
+ }
}
intents.add(locationPluginIntent);
@@ -74,4 +86,4 @@ public class GeoHelper {
intents.add(httpIntent);
return intents;
}
-}
+} \ No newline at end of file
diff --git a/src/main/res/drawable/message_border.xml b/src/main/res/drawable/message_border.xml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/src/main/res/drawable/message_border.xml
diff --git a/src/main/res/layout/account_row.xml b/src/main/res/layout/account_row.xml
index 077170b29..fc8aae09a 100644
--- a/src/main/res/layout/account_row.xml
+++ b/src/main/res/layout/account_row.xml
@@ -13,7 +13,9 @@
android:layout_height="48dp"
android:layout_alignParentLeft="true"
android:src="@drawable/ic_profile"
- android:contentDescription="@string/account_image_description">
+ android:contentDescription="@string/account_image_description"
+ android:background="@drawable/message_border"
+ android:padding="1dp">
</ImageView>
<LinearLayout
diff --git a/src/main/res/layout/activity_contact_details.xml b/src/main/res/layout/activity_contact_details.xml
index 5f6a2dd09..e1a967c07 100644
--- a/src/main/res/layout/activity_contact_details.xml
+++ b/src/main/res/layout/activity_contact_details.xml
@@ -21,18 +21,25 @@
<QuickContactBadge
android:id="@+id/details_contact_badge"
- android:layout_width="72dp"
- android:layout_height="72dp"
+ android:layout_width="300dp"
+ android:layout_height="300dp"
+ android:scaleType="centerCrop"
android:layout_alignParentTop="true"
- android:scaleType="centerCrop" />
+ android:layout_centerHorizontal="true"
+ android:background="@drawable/message_border"
+ android:padding="1dp" />
<LinearLayout
android:id="@+id/details_jidbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="16dp"
- android:layout_toRightOf="@+id/details_contact_badge"
- android:orientation="vertical" >
+ android:orientation="vertical"
+ android:layout_below="@+id/details_contact_badge"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ android:layout_marginTop="16dp"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true">
<TextView
android:id="@+id/details_contactjid"
@@ -41,12 +48,14 @@
android:text="@string/account_settings_example_jabber_id"
android:textColor="@color/black87"
android:textSize="?attr/TextSizeHeadline"
- android:textStyle="bold" />
+ android:textStyle="bold"
+ android:layout_gravity="center_horizontal" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:orientation="vertical" >
+ android:orientation="vertical"
+ android:layout_gravity="center_horizontal">
<LinearLayout
android:id="@+id/tags"
@@ -54,7 +63,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
- android:orientation="horizontal">
+ android:orientation="horizontal"
+ android:layout_gravity="center_horizontal">
</LinearLayout>
<TextView
@@ -62,7 +72,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black54"
- android:textSize="?attr/TextSizeBody" />
+ android:textSize="?attr/TextSizeBody"
+ android:layout_gravity="center_horizontal" />
</LinearLayout>
<Button
@@ -70,7 +81,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
- android:text="@string/add_contact"/>
+ android:text="@string/add_contact"
+ android:layout_gravity="center_horizontal" />
<CheckBox
android:id="@+id/details_send_presence"
diff --git a/src/main/res/layout/activity_edit_account.xml b/src/main/res/layout/activity_edit_account.xml
index 53226b826..fb02f7bf4 100644
--- a/src/main/res/layout/activity_edit_account.xml
+++ b/src/main/res/layout/activity_edit_account.xml
@@ -28,16 +28,21 @@
android:orientation="vertical"
android:padding="@dimen/infocard_padding">
<ImageView android:id="@+id/avater"
- android:layout_width="72dp"
- android:layout_height="72dp"
+ android:layout_width="300dp"
+ android:layout_height="300dp"
+ android:contentDescription="@string/account_image_description"
+ android:background="@drawable/message_border"
+ android:padding="1dp"
android:layout_alignParentTop="true"
- android:layout_marginRight="16dp"
- android:contentDescription="@string/account_image_description"/>
+ android:layout_centerHorizontal="true" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:layout_toRightOf="@+id/avater">
+ android:layout_below="@+id/avater"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:layout_marginTop="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/src/main/res/layout/activity_muc_details.xml b/src/main/res/layout/activity_muc_details.xml
index b89c9945b..671215eaa 100644
--- a/src/main/res/layout/activity_muc_details.xml
+++ b/src/main/res/layout/activity_muc_details.xml
@@ -37,10 +37,13 @@
<ImageView
android:id="@+id/your_photo"
- android:layout_width="48dp"
- android:layout_height="48dp"
+ android:layout_width="72dp"
+ android:layout_height="72dp"
android:layout_alignParentLeft="true"
- android:src="@drawable/ic_profile">
+ android:src="@drawable/ic_profile"
+ android:background="@drawable/message_border"
+ android:padding="1dp"
+ android:layout_alignParentEnd="false">
</ImageView>
<LinearLayout
diff --git a/src/main/res/layout/activity_publish_profile_picture.xml b/src/main/res/layout/activity_publish_profile_picture.xml
index 3b249a665..a9f35daf6 100644
--- a/src/main/res/layout/activity_publish_profile_picture.xml
+++ b/src/main/res/layout/activity_publish_profile_picture.xml
@@ -16,8 +16,8 @@
<ImageView
android:id="@+id/account_image"
- android:layout_width="194dp"
- android:layout_height="194dp" />
+ android:layout_width="300dp"
+ android:layout_height="300dp" />
</LinearLayout>
<TextView
@@ -103,4 +103,4 @@
android:textSize="?attr/TextSizeBody" />
</LinearLayout>
-</RelativeLayout> \ No newline at end of file
+</RelativeLayout>
diff --git a/src/main/res/layout/contact.xml b/src/main/res/layout/contact.xml
index 3c0c74876..ccc013fcc 100644
--- a/src/main/res/layout/contact.xml
+++ b/src/main/res/layout/contact.xml
@@ -7,11 +7,13 @@
<ImageView
android:id="@+id/contact_photo"
- android:layout_width="48dp"
- android:layout_height="48dp"
+ android:layout_width="56dp"
+ android:layout_height="56dp"
android:layout_alignParentLeft="true"
android:scaleType="centerCrop"
- android:src="@drawable/ic_profile" >
+ android:src="@drawable/ic_profile"
+ android:background="@drawable/message_border"
+ android:padding="1dp">
</ImageView>
<LinearLayout
diff --git a/src/main/res/layout/conversation_list_row.xml b/src/main/res/layout/conversation_list_row.xml
index 28e526e0b..5f1c5047d 100644
--- a/src/main/res/layout/conversation_list_row.xml
+++ b/src/main/res/layout/conversation_list_row.xml
@@ -26,7 +26,9 @@
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_alignParentLeft="true"
- android:scaleType="centerCrop" />
+ android:scaleType="centerCrop"
+ android:background="@drawable/message_border"
+ android:padding="1dp" />
<RelativeLayout
android:layout_width="fill_parent"
diff --git a/src/main/res/layout/message_received.xml b/src/main/res/layout/message_received.xml
index 4de9adddf..ab1a02434 100644
--- a/src/main/res/layout/message_received.xml
+++ b/src/main/res/layout/message_received.xml
@@ -92,5 +92,18 @@
</LinearLayout>
</LinearLayout>
</LinearLayout>
-
+ <ImageView
+ android:id="@+id/message_photo"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:layout_marginRight="-1.5dp"
+ android:scaleType="fitXY"
+ android:src="@drawable/ic_profile"
+ android:background="@drawable/message_border"
+ android:paddingLeft="1dp"
+ android:paddingTop="1dp"
+ android:paddingBottom="1dp"
+ android:paddingRight="0dp" />
</RelativeLayout> \ No newline at end of file
diff --git a/src/main/res/layout/message_sent.xml b/src/main/res/layout/message_sent.xml
index 96e7808f2..b14462399 100644
--- a/src/main/res/layout/message_sent.xml
+++ b/src/main/res/layout/message_sent.xml
@@ -103,5 +103,18 @@
</LinearLayout>
</LinearLayout>
</LinearLayout>
-
+ <ImageView
+ android:id="@+id/message_photo"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+ android:layout_marginLeft="-1.5dp"
+ android:scaleType="fitXY"
+ android:src="@drawable/ic_profile"
+ android:background="@drawable/message_border"
+ android:paddingTop="1dp"
+ android:paddingRight="1dp"
+ android:paddingBottom="1dp"
+ android:paddingLeft="0dp" />
</RelativeLayout> \ No newline at end of file
diff --git a/src/main/res/layout/message_status.xml b/src/main/res/layout/message_status.xml
index 222e23f5e..6a7dfcfe9 100644
--- a/src/main/res/layout/message_status.xml
+++ b/src/main/res/layout/message_status.xml
@@ -15,9 +15,10 @@
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginRight="-1.5dp"
- android:padding="0dp"
+ android:padding="1dp"
android:scaleType="fitXY"
- android:src="@drawable/ic_profile" />
+ android:src="@drawable/ic_profile"
+ android:background="@drawable/message_border" />
<TextView
android:id="@+id/status_message"
diff --git a/src/main/res/menu/conversations.xml b/src/main/res/menu/conversations.xml
index 4c724d27d..fe2ff834d 100644
--- a/src/main/res/menu/conversations.xml
+++ b/src/main/res/menu/conversations.xml
@@ -10,7 +10,7 @@
android:id="@+id/action_security"
android:icon="?attr/icon_not_secure"
android:orderInCategory="20"
- android:showAsAction="always"
+ android:showAsAction="never"
android:title="@string/action_secure"/>
<item
android:id="@+id/action_attach_file"
@@ -20,14 +20,15 @@
android:title="@string/attach_file"/>
<item
android:id="@+id/action_contact_details"
+ android:icon="?attr/icon_group"
android:orderInCategory="40"
- android:showAsAction="never"
+ android:showAsAction="always"
android:title="@string/action_contact_details"/>
<item
android:id="@+id/action_muc_details"
android:icon="?attr/icon_group"
android:orderInCategory="40"
- android:showAsAction="ifRoom"
+ android:showAsAction="always"
android:title="@string/action_muc_details"/>
<item
android:id="@+id/action_invite"
diff --git a/src/main/res/menu/muc_details_context.xml b/src/main/res/menu/muc_details_context.xml
index 6fddb23ea..713378942 100644
--- a/src/main/res/menu/muc_details_context.xml
+++ b/src/main/res/menu/muc_details_context.xml
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
- <item
+ <item
+ android:id="@+id/action_contact_details"
+ android:title="@string/action_contact_details"
+ android:visible="false" />
+ <item
android:id="@+id/start_conversation"
android:title="@string/start_conversation"
android:visible="false"/>
diff --git a/src/main/res/values-ms/strings.xml b/src/main/res/values-ms/strings.xml
new file mode 100644
index 000000000..c757504ac
--- /dev/null
+++ b/src/main/res/values-ms/strings.xml
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<resources/>
diff --git a/src/main/res/values-zh-rCN/strings.xml b/src/main/res/values-zh-rCN/strings.xml
index 0d95ee180..528afed72 100644
--- a/src/main/res/values-zh-rCN/strings.xml
+++ b/src/main/res/values-zh-rCN/strings.xml
@@ -288,6 +288,11 @@
<string name="conference_members_only">此讨论组只允许成员加入</string>
<string name="conference_kicked">你被从此讨论组踢出</string>
<string name="using_account">用账户 %s</string>
+<<<<<<< HEAD
+ <string name="checking_file">正在 HTTP 托管中检查图片</string>
+ <string name="image_file_deleted">此图片已经被删除</string>
+=======
+>>>>>>> 4f62793a67415e91f589924b70fdd5bdd35c284d
<string name="not_connected_try_again">你没有连接。请稍后重试</string>
<string name="message_options">消息选项</string>
<string name="copy_text">拷贝文本</string>
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 7f3408fc9..02321ddc4 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -282,7 +282,7 @@
<string name="pref_about_conversations_summary">Build and licensing information</string>
<string name="pref_about_message" translatable="false">
Conversations • the very last word in instant messaging.
- \n\nCopyright © 2014-2015 Daniel Gultsch
+ \n\nCopyright © 2014 Daniel Gultsch
\n\nThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml
index 5b7d69040..388f5089b 100644
--- a/src/main/res/xml/preferences.xml
+++ b/src/main/res/xml/preferences.xml
@@ -16,7 +16,7 @@
android:summary="@string/pref_xmpp_resource_summary"
android:title="@string/pref_xmpp_resource" />
<ListPreference
- android:defaultValue="524288"
+ android:defaultValue="1048576"
android:entries="@array/filesizes"
android:entryValues="@array/filesizes_values"
android:key="auto_accept_file_size"
@@ -101,7 +101,7 @@
android:summary="@string/pref_use_larger_font_summary"
android:title="@string/pref_use_larger_font" />
<CheckBoxPreference
- android:defaultValue="false"
+ android:defaultValue="true"
android:key="send_button_status"
android:summary="@string/pref_use_send_button_to_indicate_status_summary"
android:title="@string/pref_use_send_button_to_indicate_status" />
@@ -163,12 +163,12 @@
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_expert_options_other" >
<CheckBoxPreference
- android:defaultValue="false"
+ android:defaultValue="true"
android:key="indicate_received"
android:summary="@string/pref_use_indicate_received_summary"
android:title="@string/pref_use_indicate_received" />
<CheckBoxPreference
- android:defaultValue="false"
+ android:defaultValue="true"
android:key="keep_foreground_service"
android:title="@string/pref_keep_foreground_service"
android:summary="@string/pref_keep_foreground_service_summary" />
@@ -176,7 +176,7 @@
</PreferenceScreen>
<CheckBoxPreference
- android:defaultValue="false"
+ android:defaultValue="true"
android:key="never_send"
android:summary="@string/pref_never_send_crash_summary"
android:title="@string/pref_never_send_crash" />