Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
xabber-android
Commits
d9a6560a
Commit
d9a6560a
authored
Feb 11, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Orientation change recent chats fragment fix.
parent
3ba35b20
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
13 deletions
+8
-13
ChatViewer.java
app/src/main/java/com/xabber/android/ui/ChatViewer.java
+4
-0
RecentChatFragment.java
...c/main/java/com/xabber/android/ui/RecentChatFragment.java
+3
-10
ChatViewerAdapter.java
...java/com/xabber/android/ui/adapter/ChatViewerAdapter.java
+1
-3
No files found.
app/src/main/java/com/xabber/android/ui/ChatViewer.java
View file @
d9a6560a
...
@@ -408,4 +408,8 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
...
@@ -408,4 +408,8 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
public
void
onRecentChatsCalled
()
{
public
void
onRecentChatsCalled
()
{
viewPager
.
setCurrentItem
(
chatViewerAdapter
.
getRecentChatsPosition
(),
true
);
viewPager
.
setCurrentItem
(
chatViewerAdapter
.
getRecentChatsPosition
(),
true
);
}
}
public
ChatViewerAdapter
getChatViewerAdapter
()
{
return
chatViewerAdapter
;
}
}
}
app/src/main/java/com/xabber/android/ui/RecentChatFragment.java
View file @
d9a6560a
...
@@ -13,13 +13,12 @@ import com.xabber.android.data.message.AbstractChat;
...
@@ -13,13 +13,12 @@ import com.xabber.android.data.message.AbstractChat;
import
com.xabber.android.ui.adapter.ChatListAdapter
;
import
com.xabber.android.ui.adapter.ChatListAdapter
;
import
com.xabber.androiddev.R
;
import
com.xabber.androiddev.R
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
public
class
RecentChatFragment
extends
ListFragment
{
public
class
RecentChatFragment
extends
ListFragment
{
private
RecentChatFragmentInteractionListener
listener
;
private
RecentChatFragmentInteractionListener
listener
;
private
List
<
AbstractChat
>
initialChats
=
null
;
public
static
RecentChatFragment
newInstance
()
{
public
static
RecentChatFragment
newInstance
()
{
return
new
RecentChatFragment
();
return
new
RecentChatFragment
();
}
}
...
@@ -31,10 +30,6 @@ public class RecentChatFragment extends ListFragment {
...
@@ -31,10 +30,6 @@ public class RecentChatFragment extends ListFragment {
public
RecentChatFragment
()
{
public
RecentChatFragment
()
{
}
}
public
void
setInitialChats
(
List
<
AbstractChat
>
initialChats
)
{
this
.
initialChats
=
initialChats
;
}
@Override
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
@@ -59,10 +54,8 @@ public class RecentChatFragment extends ListFragment {
...
@@ -59,10 +54,8 @@ public class RecentChatFragment extends ListFragment {
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
);
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
);
if
(
initialChats
!=
null
)
{
ArrayList
<
AbstractChat
>
activeChats
=
((
ChatViewer
)
getActivity
()).
getChatViewerAdapter
().
getActiveChats
();
((
ChatListAdapter
)
getListAdapter
()).
updateChats
(
initialChats
);
((
ChatListAdapter
)
getListAdapter
()).
updateChats
(
activeChats
);
initialChats
=
null
;
}
if
(
getListAdapter
().
isEmpty
())
{
if
(
getListAdapter
().
isEmpty
())
{
Activity
activity
=
getActivity
();
Activity
activity
=
getActivity
();
...
...
app/src/main/java/com/xabber/android/ui/adapter/ChatViewerAdapter.java
View file @
d9a6560a
...
@@ -73,9 +73,7 @@ public class ChatViewerAdapter extends FragmentStatePagerAdapter {
...
@@ -73,9 +73,7 @@ public class ChatViewerAdapter extends FragmentStatePagerAdapter {
int
realPosition
=
getRealPagePosition
(
virtualPagePosition
);
int
realPosition
=
getRealPagePosition
(
virtualPagePosition
);
if
(
realPosition
==
0
)
{
if
(
realPosition
==
0
)
{
RecentChatFragment
activeChatFragment
=
RecentChatFragment
.
newInstance
();
return
RecentChatFragment
.
newInstance
();
activeChatFragment
.
setInitialChats
(
activeChats
);
return
activeChatFragment
;
}
}
AbstractChat
chat
=
activeChats
.
get
(
getChatIndexFromRealPosition
(
realPosition
));
AbstractChat
chat
=
activeChats
.
get
(
getChatIndexFromRealPosition
(
realPosition
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment