Commit 50696697 authored by Grigory Fedorov's avatar Grigory Fedorov

Merge branch 'release/1.0.19'

parents a78c21b6 33030fb9
...@@ -7,8 +7,8 @@ android { ...@@ -7,8 +7,8 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 14 minSdkVersion 14
targetSdkVersion 22 targetSdkVersion 22
versionCode 184 versionCode 191
versionName '1.0.12' versionName '1.0.19'
} }
compileOptions { compileOptions {
...@@ -41,8 +41,8 @@ repositories { ...@@ -41,8 +41,8 @@ repositories {
} }
dependencies { dependencies {
compile 'com.android.support:appcompat-v7:22.1.1' compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:support-v13:22.0.0' compile 'com.android.support:support-v13:22.2.0'
compile 'com.github.ksoichiro:android-observablescrollview:1.5.0' compile 'com.github.ksoichiro:android-observablescrollview:1.5.0'
compile 'de.hdodenhof:circleimageview:1.2.2' compile 'de.hdodenhof:circleimageview:1.2.2'
compile 'com.melnykov:floatingactionbutton:1.2.0' compile 'com.melnykov:floatingactionbutton:1.2.0'
......
...@@ -31,8 +31,7 @@ public class SMProgress extends BaseEntity implements EntityNotificationItem { ...@@ -31,8 +31,7 @@ public class SMProgress extends BaseEntity implements EntityNotificationItem {
@Override @Override
public Intent getIntent() { public Intent getIntent() {
return QuestionViewer.createCancelIntent( return QuestionViewer.createCancelIntent(Application.getInstance(), account, user);
Application.getInstance(), account, user);
} }
@Override @Override
...@@ -43,8 +42,7 @@ public class SMProgress extends BaseEntity implements EntityNotificationItem { ...@@ -43,8 +42,7 @@ public class SMProgress extends BaseEntity implements EntityNotificationItem {
@Override @Override
public String getText() { public String getText() {
return Application.getInstance().getString( return Application.getInstance().getString(R.string.otr_verification_in_progress);
R.string.otr_verification_in_progress);
} }
} }
...@@ -35,8 +35,7 @@ public class SMRequest extends BaseEntity implements EntityNotificationItem { ...@@ -35,8 +35,7 @@ public class SMRequest extends BaseEntity implements EntityNotificationItem {
@Override @Override
public Intent getIntent() { public Intent getIntent() {
return QuestionViewer.createIntent( return QuestionViewer.createIntent(
Application.getInstance(), account, user, question != null, Application.getInstance(), account, user, question != null, true, question);
true, question);
} }
@Override @Override
......
...@@ -14,14 +14,6 @@ ...@@ -14,14 +14,6 @@
*/ */
package com.xabber.android.data.message; package com.xabber.android.data.message;
import net.java.otr4j.OtrException;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Message.Type;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smackx.packet.MUCUser;
import com.xabber.android.data.LogManager; import com.xabber.android.data.LogManager;
import com.xabber.android.data.NetworkException; import com.xabber.android.data.NetworkException;
import com.xabber.android.data.SettingsManager; import com.xabber.android.data.SettingsManager;
...@@ -35,6 +27,14 @@ import com.xabber.xmpp.archive.SaveMode; ...@@ -35,6 +27,14 @@ import com.xabber.xmpp.archive.SaveMode;
import com.xabber.xmpp.delay.Delay; import com.xabber.xmpp.delay.Delay;
import com.xabber.xmpp.muc.MUC; import com.xabber.xmpp.muc.MUC;
import net.java.otr4j.OtrException;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Message.Type;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smackx.packet.MUCUser;
/** /**
* Represents normal chat. * Represents normal chat.
* *
...@@ -141,8 +141,7 @@ public class RegularChat extends AbstractChat { ...@@ -141,8 +141,7 @@ public class RegularChat extends AbstractChat {
updateThreadId(thread); updateThreadId(thread);
boolean unencrypted = false; boolean unencrypted = false;
try { try {
text = OTRManager.getInstance().transformReceiving(account, text = OTRManager.getInstance().transformReceiving(account, user, text);
user, text);
} catch (OtrException e) { } catch (OtrException e) {
if (e.getCause() instanceof OTRUnencryptedException) { if (e.getCause() instanceof OTRUnencryptedException) {
text = ((OTRUnencryptedException) e.getCause()).getText(); text = ((OTRUnencryptedException) e.getCause()).getText();
...@@ -154,7 +153,7 @@ public class RegularChat extends AbstractChat { ...@@ -154,7 +153,7 @@ public class RegularChat extends AbstractChat {
} }
} }
// System message received. // System message received.
if (text == null) if (text == null || text.trim().equals(""))
return true; return true;
if (!"".equals(resource)) if (!"".equals(resource))
this.resource = resource; this.resource = resource;
......
...@@ -356,21 +356,29 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -356,21 +356,29 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
chatScrollIndicatorAdapter.update(chatViewerAdapter.getActiveChats()); chatScrollIndicatorAdapter.update(chatViewerAdapter.getActiveChats());
selectPage(); selectPage();
} else { } else {
updateRegisteredChats();
updateRegisteredRecentChatsFragments();
updateStatusBar();
for (ChatViewerFragment chat : registeredChats) { for (ChatViewerFragment chat : registeredChats) {
if (chat.isEqual(selectedChat) && incoming) { if (chat.isEqual(selectedChat)) {
chat.playIncomingAnimation(); chat.updateChat();
if (incoming) {
chat.playIncomingAnimation();
}
} }
} }
updateRegisteredRecentChatsFragments();
updateStatusBar();
} }
} }
@Override @Override
public void onContactsChanged(Collection<BaseEntity> entities) { public void onContactsChanged(Collection<BaseEntity> entities) {
updateRegisteredChats(); for (BaseEntity contact : entities) {
for (ChatViewerFragment chat : registeredChats) {
if (chat.isEqual(contact)) {
chat.updateChat();
}
}
}
updateRegisteredRecentChatsFragments(); updateRegisteredRecentChatsFragments();
updateStatusBar(); updateStatusBar();
} }
......
...@@ -5,12 +5,10 @@ import android.content.Context; ...@@ -5,12 +5,10 @@ import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.text.InputType; import android.text.InputType;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import com.xabber.android.R; import com.xabber.android.R;
...@@ -39,15 +37,6 @@ public class ContactEditor extends ContactViewer implements Toolbar.OnMenuItemCl ...@@ -39,15 +37,6 @@ public class ContactEditor extends ContactViewer implements Toolbar.OnMenuItemCl
toolbar.inflateMenu(R.menu.contact_viewer); toolbar.inflateMenu(R.menu.contact_viewer);
toolbar.setOnMenuItemClickListener(this); toolbar.setOnMenuItemClickListener(this);
} }
toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NavUtils.navigateUpFromSameTask(ContactEditor.this);
}
});
} }
@Override @Override
......
...@@ -66,6 +66,7 @@ import com.xabber.android.ui.helper.BarPainter; ...@@ -66,6 +66,7 @@ import com.xabber.android.ui.helper.BarPainter;
import com.xabber.android.ui.helper.ManagedActivity; import com.xabber.android.ui.helper.ManagedActivity;
import com.xabber.android.ui.preferences.AboutViewer; import com.xabber.android.ui.preferences.AboutViewer;
import com.xabber.android.ui.preferences.AccountEditor; import com.xabber.android.ui.preferences.AccountEditor;
import com.xabber.android.ui.preferences.AccountList;
import com.xabber.android.ui.preferences.PreferenceEditor; import com.xabber.android.ui.preferences.PreferenceEditor;
import com.xabber.xmpp.address.Jid; import com.xabber.xmpp.address.Jid;
import com.xabber.xmpp.uri.XMPPUri; import com.xabber.xmpp.uri.XMPPUri;
...@@ -593,7 +594,9 @@ public class ContactList extends ManagedActivity implements OnAccountChangedList ...@@ -593,7 +594,9 @@ public class ContactList extends ManagedActivity implements OnAccountChangedList
case R.id.drawer_action_exit: case R.id.drawer_action_exit:
exit(); exit();
break; break;
case R.id.drawer_header_action_xmpp_accounts:
startActivity(AccountList.createIntent(this));
break;
} }
} }
......
...@@ -52,8 +52,8 @@ public class ContactListDrawerFragment extends Fragment implements View.OnClickL ...@@ -52,8 +52,8 @@ public class ContactListDrawerFragment extends Fragment implements View.OnClickL
View headerView = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE)) View headerView = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE))
.inflate(R.layout.contact_list_drawer_header, listView, false); .inflate(R.layout.contact_list_drawer_header, listView, false);
headerTitle = headerView.findViewById(R.id.drawer_header_title); headerTitle = headerView.findViewById(R.id.drawer_header_action_xmpp_accounts);
headerTitle.setOnClickListener(this);
listView.addHeaderView(headerView); listView.addHeaderView(headerView);
......
...@@ -18,6 +18,8 @@ import android.content.Context; ...@@ -18,6 +18,8 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.support.v7.widget.Toolbar;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
...@@ -117,6 +119,15 @@ public class ContactViewer extends ManagedActivity implements ...@@ -117,6 +119,15 @@ public class ContactViewer extends ManagedActivity implements
contactTitleView.findViewById(R.id.status_icon).setVisibility(View.GONE); contactTitleView.findViewById(R.id.status_icon).setVisibility(View.GONE);
contactTitleView.findViewById(R.id.status_text).setVisibility(View.GONE); contactTitleView.findViewById(R.id.status_text).setVisibility(View.GONE);
contactNameView = (TextView) contactTitleView.findViewById(R.id.name); contactNameView = (TextView) contactTitleView.findViewById(R.id.name);
Toolbar toolbar = contactTitleExpandableToolbarInflater.getToolbar();
toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NavUtils.navigateUpFromSameTask(ContactViewer.this);
}
});
} }
@Override @Override
......
...@@ -23,6 +23,7 @@ import android.widget.ImageView; ...@@ -23,6 +23,7 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.xabber.android.R; import com.xabber.android.R;
import com.xabber.android.data.LogManager;
import com.xabber.android.data.SettingsManager; import com.xabber.android.data.SettingsManager;
import com.xabber.android.data.account.AccountItem; import com.xabber.android.data.account.AccountItem;
import com.xabber.android.data.account.AccountManager; import com.xabber.android.data.account.AccountManager;
...@@ -139,6 +140,7 @@ public class ChatMessageAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo ...@@ -139,6 +140,7 @@ public class ChatMessageAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
incomingMessage.messageBalloon.setVisibility(View.GONE); incomingMessage.messageBalloon.setVisibility(View.GONE);
incomingMessage.messageTime.setVisibility(View.GONE); incomingMessage.messageTime.setVisibility(View.GONE);
incomingMessage.avatar.setVisibility(View.GONE); incomingMessage.avatar.setVisibility(View.GONE);
LogManager.w(this, "Empty message! Hidden, but need to correct");
} else { } else {
incomingMessage.messageBalloon.setVisibility(View.VISIBLE); incomingMessage.messageBalloon.setVisibility(View.VISIBLE);
incomingMessage.messageTime.setVisibility(View.VISIBLE); incomingMessage.messageTime.setVisibility(View.VISIBLE);
...@@ -285,7 +287,7 @@ public class ChatMessageAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo ...@@ -285,7 +287,7 @@ public class ChatMessageAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
return null; return null;
} }
public static class BasicMessage extends RecyclerView.ViewHolder { public static class BasicMessage extends RecyclerView.ViewHolder {
public TextView messageText; public TextView messageText;
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView xmlns:android="http://schemas.android.com/apk/res/android" <TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_header_title" android:id="@+id/drawer_header_action_xmpp_accounts"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="16dp" android:paddingLeft="16dp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment