Commit cbfed8d2 authored by Grigory Fedorov's avatar Grigory Fedorov

ChatViewer: options menu moved from ChatViewerFragment.

Light refactoring.
parent 78d01152
...@@ -646,9 +646,8 @@ public abstract class AbstractChat extends BaseEntity { ...@@ -646,9 +646,8 @@ public abstract class AbstractChat extends BaseEntity {
int count = PRELOADED_MESSAGES int count = PRELOADED_MESSAGES
+ NotificationManager.getInstance() + NotificationManager.getInstance()
.getNotificationMessageCount(account, user); .getNotificationMessageCount(account, user);
Iterator<MessageItem> iterator = messages.iterator(); for (MessageItem message : messages)
while (iterator.hasNext()) if (message.isIncoming()) {
if (iterator.next().isIncoming()) {
count -= 1; count -= 1;
if (count <= 0) if (count <= 0)
return 0; return 0;
......
...@@ -29,8 +29,6 @@ public class ChatViewerAdapter extends FragmentStatePagerAdapter { ...@@ -29,8 +29,6 @@ public class ChatViewerAdapter extends FragmentStatePagerAdapter {
private FinishUpdateListener finishUpdateListener; private FinishUpdateListener finishUpdateListener;
private Fragment currentFragment;
private static final int TOTAL_COUNT = 200; private static final int TOTAL_COUNT = 200;
private static final int OFFSET = TOTAL_COUNT / 2; private static final int OFFSET = TOTAL_COUNT / 2;
...@@ -165,15 +163,6 @@ public class ChatViewerAdapter extends FragmentStatePagerAdapter { ...@@ -165,15 +163,6 @@ public class ChatViewerAdapter extends FragmentStatePagerAdapter {
return realPosition - 1; return realPosition - 1;
} }
@Override
public void startUpdate(ViewGroup container) {
if (currentFragment instanceof ChatViewerFragment) {
((ChatViewerFragment)currentFragment).saveInputState();
}
super.startUpdate(container);
}
@Override @Override
public void finishUpdate(ViewGroup container) { public void finishUpdate(ViewGroup container) {
super.finishUpdate(container); super.finishUpdate(container);
......
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