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
822404c0
Commit
822404c0
authored
May 19, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Material color 900 used for account names in navigation drawer. #449
parent
75e65596
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
NavigationDrawerAccountAdapter.java
...er/android/ui/adapter/NavigationDrawerAccountAdapter.java
+1
-1
AccountPainter.java
...ain/java/com/xabber/android/ui/helper/AccountPainter.java
+7
-0
color_arrays.xml
app/src/main/res/values/color_arrays.xml
+10
-0
No files found.
app/src/main/java/com/xabber/android/ui/adapter/NavigationDrawerAccountAdapter.java
View file @
822404c0
...
...
@@ -46,7 +46,7 @@ public class NavigationDrawerAccountAdapter extends BaseListEditorAdapter<String
TextView
accountName
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
name
);
accountName
.
setText
(
RosterManager
.
getInstance
().
getBestContact
(
account
,
accountManager
.
getVerboseName
(
account
)).
getName
());
accountName
.
setTextColor
(
accountPainter
.
getAccountDarkColor
(
account
));
accountName
.
setTextColor
(
accountPainter
.
getAccountDark
est
Color
(
account
));
((
TextView
)
view
.
findViewById
(
R
.
id
.
account_jid
)).
setText
(
accountManager
.
getVerboseName
(
account
));
...
...
app/src/main/java/com/xabber/android/ui/helper/AccountPainter.java
View file @
822404c0
...
...
@@ -17,11 +17,13 @@ public class AccountPainter {
private
int
[]
accountMainColors
;
private
int
[]
accountDarkColors
;
private
int
[]
accountDarkestColors
;
public
AccountPainter
(
Context
context
)
{
accountMainColors
=
context
.
getResources
().
getIntArray
(
R
.
array
.
account_action_bar
);
accountDarkColors
=
context
.
getResources
().
getIntArray
(
R
.
array
.
account_status_bar
);
accountDarkestColors
=
context
.
getResources
().
getIntArray
(
R
.
array
.
account_900
);
accountColorNames
=
context
.
getResources
().
getStringArray
(
R
.
array
.
account_color_names
);
...
...
@@ -84,6 +86,11 @@ public class AccountPainter {
return
accountDarkColors
[
getAccountColorLevel
(
account
)];
}
public
int
getAccountDarkestColor
(
String
account
)
{
return
accountDarkestColors
[
getAccountColorLevel
(
account
)];
}
public
int
getDefaultDarkColor
()
{
String
firstAccount
=
getFirstAccount
();
if
(
firstAccount
==
null
)
{
...
...
app/src/main/res/values/color_arrays.xml
View file @
822404c0
...
...
@@ -67,6 +67,16 @@
<item>
@color/teal_50
</item>
</array>
<array
name=
"account_900"
>
<item>
@color/green_900
</item>
<item>
@color/orange_900
</item>
<item>
@color/red_900
</item>
<item>
@color/blue_900
</item>
<item>
@color/indigo_900
</item>
<item>
@color/blue_grey_900
</item>
<item>
@color/cyan_900
</item>
<item>
@color/teal_900
</item>
</array>
<color
name=
"color_primary_light"
>
@color/grey_200
</color>
...
...
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