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
f66a8419
Commit
f66a8419
authored
Apr 09, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Contact list scroll up button now shown only if there are active chats.
parent
44b8c707
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
ContactListFragment.java
.../main/java/com/xabber/android/ui/ContactListFragment.java
+14
-1
ContactListAdapter.java
...ava/com/xabber/android/ui/adapter/ContactListAdapter.java
+8
-2
No files found.
app/src/main/java/com/xabber/android/ui/ContactListFragment.java
View file @
f66a8419
...
...
@@ -84,6 +84,7 @@ public class ContactListFragment extends Fragment implements OnAccountChangedLis
*/
private
Animation
animation
;
private
AccountActionButtonsAdapter
accountActionButtonsAdapter
;
private
View
scrollToChatsActionButtonContainer
;
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
...
...
@@ -105,7 +106,9 @@ public class ContactListFragment extends Fragment implements OnAccountChangedLis
this
,
(
LinearLayout
)
view
.
findViewById
(
R
.
id
.
account_action_buttons
));
accountActionButtonsAdapter
.
onChange
();
view
.
findViewById
(
R
.
id
.
fab_up_container
).
setOnClickListener
(
this
);
scrollToChatsActionButtonContainer
=
view
.
findViewById
(
R
.
id
.
fab_up_container
);
scrollToChatsActionButtonContainer
.
setOnClickListener
(
this
);
scrollToChatsActionButtonContainer
.
setVisibility
(
View
.
GONE
);
return
view
;
}
...
...
@@ -177,6 +180,13 @@ public class ContactListFragment extends Fragment implements OnAccountChangedLis
@Override
public
void
onContactListChanged
(
CommonState
commonState
,
boolean
hasContacts
,
boolean
hasVisibleContacts
,
boolean
isFilterEnabled
)
{
if
(
adapter
.
isHasActiveChats
())
{
scrollToChatsActionButtonContainer
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
scrollToChatsActionButtonContainer
.
setVisibility
(
View
.
GONE
);
}
if
(
hasVisibleContacts
)
{
infoView
.
setVisibility
(
View
.
GONE
);
disconnectedView
.
clearAnimation
();
...
...
@@ -296,6 +306,9 @@ public class ContactListFragment extends Fragment implements OnAccountChangedLis
buttonView
.
setText
(
button
);
}
buttonView
.
setOnClickListener
(
listener
);
}
/**
...
...
app/src/main/java/com/xabber/android/ui/adapter/ContactListAdapter.java
View file @
f66a8419
...
...
@@ -91,6 +91,7 @@ public class ContactListAdapter extends GroupedContactAdapter implements Runnabl
String
filterString
;
private
final
OnContactListChangedListener
listener
;
private
boolean
hasActiveChats
=
false
;
public
ContactListAdapter
(
Activity
activity
,
OnContactListChangedListener
listener
,
OnClickListener
onClickListener
)
{
...
...
@@ -296,6 +297,8 @@ public class ContactListAdapter extends GroupedContactAdapter implements Runnabl
}
}
hasActiveChats
=
activeChats
.
getTotal
()
>
0
;
// Remove empty groups, sort and apply structure.
baseEntities
.
clear
();
if
(
hasVisibleContacts
)
{
...
...
@@ -362,8 +365,7 @@ public class ContactListAdapter extends GroupedContactAdapter implements Runnabl
}
super
.
onChange
();
listener
.
onContactListChanged
(
commonState
,
hasContacts
,
hasVisibleContacts
,
filterString
!=
null
);
listener
.
onContactListChanged
(
commonState
,
hasContacts
,
hasVisibleContacts
,
filterString
!=
null
);
synchronized
(
refreshLock
)
{
nextRefresh
=
new
Date
(
new
Date
().
getTime
()
+
REFRESH_INTERVAL
);
...
...
@@ -467,4 +469,8 @@ public class ContactListAdapter extends GroupedContactAdapter implements Runnabl
}
}
public
boolean
isHasActiveChats
()
{
return
hasActiveChats
;
}
}
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