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
d1090259
Commit
d1090259
authored
Mar 10, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ContactTitleInflater: offline status icon is not show in action bar, "Offline" text status written.
parent
447bca2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
7 deletions
+26
-7
ContactTitleInflater.java
...va/com/xabber/android/ui/helper/ContactTitleInflater.java
+26
-7
No files found.
app/src/main/java/com/xabber/android/ui/helper/ContactTitleInflater.java
View file @
d1090259
...
...
@@ -47,8 +47,7 @@ public class ContactTitleInflater {
AbstractContact
abstractContact
)
{
final
TextView
nameView
=
(
TextView
)
titleView
.
findViewById
(
R
.
id
.
name
);
final
ImageView
avatarView
=
(
ImageView
)
titleView
.
findViewById
(
R
.
id
.
avatar
);
final
ImageView
statusModeView
=
(
ImageView
)
titleView
.
findViewById
(
R
.
id
.
status_mode
);
final
TextView
statusTextView
=
(
TextView
)
titleView
.
findViewById
(
R
.
id
.
status_text
);
int
[]
accountActionBarColors
=
activity
.
getResources
().
getIntArray
(
R
.
array
.
account_action_bar
);
...
...
@@ -56,14 +55,26 @@ public class ContactTitleInflater {
AccountManager
.
getInstance
().
getColorLevel
(
abstractContact
.
getAccount
())]));
nameView
.
setTextColor
(
activity
.
getResources
().
getColor
(
R
.
color
.
primary_text_default_material_dark
));
nameView
.
setText
(
abstractContact
.
getName
());
statusModeView
.
setImageLevel
(
abstractContact
.
getStatusMode
().
getStatusLevel
());
avatarView
.
setImageDrawable
(
abstractContact
.
getAvatar
());
setStatus
Text
(
activity
,
abstractContact
,
statusTextView
);
setStatus
(
activity
,
titleView
,
abstractContact
);
}
private
static
void
setStatusText
(
Activity
activity
,
AbstractContact
abstractContact
,
TextView
statusTextView
)
{
private
static
void
setStatus
(
Activity
activity
,
View
titleView
,
AbstractContact
abstractContact
)
{
final
ImageView
statusModeView
=
(
ImageView
)
titleView
.
findViewById
(
R
.
id
.
status_mode
);
int
statusLevel
=
abstractContact
.
getStatusMode
().
getStatusLevel
();
if
(
isContactOffline
(
statusLevel
))
{
statusModeView
.
setVisibility
(
View
.
INVISIBLE
);
}
else
{
statusModeView
.
setVisibility
(
View
.
VISIBLE
);
statusModeView
.
setImageLevel
(
statusLevel
);
}
final
TextView
statusTextView
=
(
TextView
)
titleView
.
findViewById
(
R
.
id
.
status_text
);
ChatState
chatState
=
ChatStateManager
.
getInstance
().
getChatState
(
abstractContact
.
getAccount
(),
abstractContact
.
getUser
());
...
...
@@ -73,9 +84,17 @@ public class ContactTitleInflater {
}
else
if
(
chatState
==
ChatState
.
paused
)
{
statusText
=
activity
.
getString
(
R
.
string
.
chat_state_paused
);
}
else
{
statusText
=
Emoticons
.
getSmiledText
(
activity
,
abstractContact
.
getStatusText
());
if
(
isContactOffline
(
statusLevel
))
{
statusText
=
activity
.
getString
(
R
.
string
.
unavailable
);
}
else
{
statusText
=
Emoticons
.
getSmiledText
(
activity
,
abstractContact
.
getStatusText
());
}
}
statusTextView
.
setText
(
statusText
);
}
private
static
boolean
isContactOffline
(
int
statusLevel
)
{
return
statusLevel
==
6
;
}
}
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