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
93218ce4
Commit
93218ce4
authored
Apr 01, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Contact List: account status displayed in account group header.
parent
28c64525
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
9 deletions
+39
-9
GroupedContactAdapter.java
.../com/xabber/android/ui/adapter/GroupedContactAdapter.java
+28
-9
base_group_item.xml
app/src/main/res/layout/base_group_item.xml
+11
-0
No files found.
app/src/main/java/com/xabber/android/ui/adapter/GroupedContactAdapter.java
View file @
93218ce4
...
@@ -151,18 +151,38 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater
...
@@ -151,18 +151,38 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater
final
String
name
=
GroupManager
.
getInstance
()
final
String
name
=
GroupManager
.
getInstance
()
.
getGroupName
(
configuration
.
getAccount
(),
configuration
.
getUser
());
.
getGroupName
(
configuration
.
getAccount
(),
configuration
.
getUser
());
viewHolder
.
indicator
.
setImageLevel
(
configuration
.
isExpanded
()
?
1
:
0
);
viewHolder
.
groupOfflineIndicator
.
setImageLevel
(
configuration
.
getShowOfflineMode
().
ordinal
());
int
elevation
;
int
elevation
;
int
color
;
int
color
;
viewHolder
.
accountStatus
.
setVisibility
(
View
.
GONE
);
viewHolder
.
groupOfflineIndicator
.
setVisibility
(
View
.
GONE
);
if
(
configuration
.
getUser
().
equals
(
GroupManager
.
ACTIVE_CHATS
))
{
if
(
configuration
.
getUser
().
equals
(
GroupManager
.
ACTIVE_CHATS
))
{
color
=
activeChatsColor
;
color
=
activeChatsColor
;
elevation
=
accountGroupElevation
;
elevation
=
accountGroupElevation
;
}
else
if
(
configuration
instanceof
AccountConfiguration
)
{
viewHolder
.
name
.
setText
(
name
);
}
else
{
viewHolder
.
name
.
setText
(
name
+
" ("
+
configuration
.
getOnline
()
+
"/"
+
configuration
.
getTotal
()
+
")"
);
if
(
configuration
instanceof
AccountConfiguration
)
{
color
=
accountColors
[
level
];
color
=
accountColors
[
level
];
elevation
=
accountGroupElevation
;
elevation
=
accountGroupElevation
;
viewHolder
.
groupOfflineIndicator
.
setVisibility
(
View
.
INVISIBLE
);
viewHolder
.
accountStatus
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
accountStatus
.
setImageLevel
(
AccountManager
.
getInstance
()
.
getAccount
(
configuration
.
getAccount
()).
getDisplayStatusMode
().
getStatusLevel
());
}
else
{
}
else
{
color
=
accountSubgroupColors
[
level
];
color
=
accountSubgroupColors
[
level
];
elevation
=
accountSubgroupElevation
;
elevation
=
accountSubgroupElevation
;
viewHolder
.
groupOfflineIndicator
.
setVisibility
(
View
.
VISIBLE
);
}
}
}
view
.
setBackgroundDrawable
(
new
ColorDrawable
(
color
));
view
.
setBackgroundDrawable
(
new
ColorDrawable
(
color
));
...
@@ -171,10 +191,7 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater
...
@@ -171,10 +191,7 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater
view
.
setElevation
(
elevation
);
view
.
setElevation
(
elevation
);
}
}
viewHolder
.
name
.
setText
(
name
+
" ("
+
configuration
.
getOnline
()
+
"/"
+
configuration
.
getTotal
()
+
")"
);
viewHolder
.
indicator
.
setImageLevel
(
configuration
.
isExpanded
()
?
1
:
0
);
viewHolder
.
groupOfflineIndicator
.
setImageLevel
(
configuration
.
getShowOfflineMode
().
ordinal
());
return
view
;
return
view
;
}
else
{
}
else
{
throw
new
IllegalStateException
();
throw
new
IllegalStateException
();
...
@@ -382,11 +399,13 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater
...
@@ -382,11 +399,13 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater
final
ImageView
indicator
;
final
ImageView
indicator
;
final
TextView
name
;
final
TextView
name
;
final
ImageView
groupOfflineIndicator
;
final
ImageView
groupOfflineIndicator
;
final
ImageView
accountStatus
;
public
GroupViewHolder
(
View
view
)
{
public
GroupViewHolder
(
View
view
)
{
indicator
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
indicator
);
indicator
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
indicator
);
name
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
name
);
name
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
name
);
groupOfflineIndicator
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
group_offline_indicator
);
groupOfflineIndicator
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
group_offline_indicator
);
accountStatus
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
account_status
);
}
}
}
}
...
...
app/src/main/res/layout/base_group_item.xml
View file @
93218ce4
...
@@ -53,4 +53,15 @@
...
@@ -53,4 +53,15 @@
android:layout_toLeftOf=
"@id/group_offline_indicator"
android:layout_toLeftOf=
"@id/group_offline_indicator"
android:layout_toStartOf=
"@id/group_offline_indicator"
android:layout_toStartOf=
"@id/group_offline_indicator"
/>
/>
<ImageView
android:id=
"@+id/account_status"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/ic_status"
android:layout_alignParentEnd=
"true"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
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