Commit df2dd03e authored by Grigory Fedorov's avatar Grigory Fedorov

ChatViewer: chat selection improved.

parent 5d1b1009
...@@ -453,8 +453,8 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -453,8 +453,8 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
} }
private void selectPage(int position, boolean smoothScroll) { private void selectPage(int position, boolean smoothScroll) {
viewPager.setCurrentItem(position, smoothScroll);
onPageSelected(position); onPageSelected(position);
viewPager.setCurrentItem(position, smoothScroll);
} }
private static String getAccount(Intent intent) { private static String getAccount(Intent intent) {
...@@ -730,7 +730,7 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -730,7 +730,7 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
} }
public void selectRecentChatsPage() { public void selectRecentChatsPage() {
viewPager.setCurrentItem(chatViewerAdapter.getRecentChatsPosition(), true); selectPage(null, null, false);
} }
public ChatViewerAdapter getChatViewerAdapter() { public ChatViewerAdapter getChatViewerAdapter() {
......
...@@ -134,10 +134,6 @@ public class ChatViewerAdapter extends FragmentStatePagerAdapter { ...@@ -134,10 +134,6 @@ public class ChatViewerAdapter extends FragmentStatePagerAdapter {
return realPosition + OFFSET; return realPosition + OFFSET;
} }
public int getRecentChatsPosition() {
return OFFSET;
}
public AbstractChat getChatByPageNumber(int virtualPosition) { public AbstractChat getChatByPageNumber(int virtualPosition) {
int realPosition = getRealPagePosition(virtualPosition); int realPosition = getRealPagePosition(virtualPosition);
......
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