summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/drawable-hdpi/avatar_default_1.pngbin4159 -> 0 bytes
-rw-r--r--res/drawable-hdpi/avatar_default_2.pngbin3703 -> 0 bytes
-rw-r--r--res/drawable-hdpi/avatar_default_3.pngbin3562 -> 0 bytes
-rw-r--r--res/drawable-hdpi/avatar_default_4.pngbin3541 -> 0 bytes
-rw-r--r--res/drawable-hdpi/avatar_default_5.pngbin4405 -> 0 bytes
-rw-r--r--res/drawable-hdpi/avatar_default_6.pngbin4317 -> 0 bytes
-rw-r--r--res/drawable-hdpi/avatar_default_7.pngbin4115 -> 0 bytes
-rw-r--r--res/drawable-hdpi/avatar_default_8.pngbin4484 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_person_white.pngbin0 -> 884 bytes
-rw-r--r--res/drawable-ldrtl-hdpi/avatar_default_1.pngbin6976 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-hdpi/avatar_default_2.pngbin6509 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-hdpi/avatar_default_3.pngbin6352 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-hdpi/avatar_default_4.pngbin6189 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-hdpi/avatar_default_5.pngbin6897 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-hdpi/avatar_default_6.pngbin6781 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-hdpi/avatar_default_7.pngbin6622 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-hdpi/avatar_default_8.pngbin6943 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-mdpi/avatar_default_1.pngbin5546 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-mdpi/avatar_default_2.pngbin5194 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-mdpi/avatar_default_3.pngbin5091 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-mdpi/avatar_default_4.pngbin5087 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-mdpi/avatar_default_5.pngbin5511 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-mdpi/avatar_default_6.pngbin5471 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-mdpi/avatar_default_7.pngbin5361 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-mdpi/avatar_default_8.pngbin5434 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-xhdpi/avatar_default_1.pngbin8690 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-xhdpi/avatar_default_2.pngbin8061 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-xhdpi/avatar_default_3.pngbin7849 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-xhdpi/avatar_default_4.pngbin7645 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-xhdpi/avatar_default_5.pngbin8693 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-xhdpi/avatar_default_6.pngbin8496 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-xhdpi/avatar_default_7.pngbin8237 -> 0 bytes
-rw-r--r--res/drawable-ldrtl-xhdpi/avatar_default_8.pngbin8950 -> 0 bytes
-rw-r--r--res/drawable-mdpi/avatar_default_1.pngbin2740 -> 0 bytes
-rw-r--r--res/drawable-mdpi/avatar_default_2.pngbin2417 -> 0 bytes
-rw-r--r--res/drawable-mdpi/avatar_default_3.pngbin2360 -> 0 bytes
-rw-r--r--res/drawable-mdpi/avatar_default_4.pngbin2353 -> 0 bytes
-rw-r--r--res/drawable-mdpi/avatar_default_5.pngbin2934 -> 0 bytes
-rw-r--r--res/drawable-mdpi/avatar_default_6.pngbin2859 -> 0 bytes
-rw-r--r--res/drawable-mdpi/avatar_default_7.pngbin2744 -> 0 bytes
-rw-r--r--res/drawable-mdpi/avatar_default_8.pngbin2856 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_person_white.pngbin0 -> 695 bytes
-rw-r--r--res/drawable-xhdpi/avatar_default_1.pngbin5874 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/avatar_default_2.pngbin5278 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/avatar_default_3.pngbin5027 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/avatar_default_4.pngbin5011 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/avatar_default_5.pngbin6296 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/avatar_default_6.pngbin6151 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/avatar_default_7.pngbin5838 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/avatar_default_8.pngbin6575 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_person_white.pngbin0 -> 1042 bytes
-rw-r--r--res/drawable-xxhdpi/ic_person_white.pngbin0 -> 1433 bytes
-rw-r--r--res/drawable-xxxhdpi/ic_person_white.pngbin0 -> 1925 bytes
-rw-r--r--res/drawable/ic_avatar_default_1.xml28
-rw-r--r--res/drawable/ic_avatar_default_2.xml28
-rw-r--r--res/drawable/ic_avatar_default_3.xml28
-rw-r--r--res/drawable/ic_avatar_default_4.xml28
-rw-r--r--res/drawable/ic_avatar_default_5.xml28
-rw-r--r--res/drawable/ic_avatar_default_6.xml28
-rw-r--r--res/drawable/ic_avatar_default_7.xml28
-rw-r--r--res/drawable/ic_avatar_default_8.xml28
-rw-r--r--res/drawable/ic_avatar_guest.xml28
-rw-r--r--res/values/colors.xml13
-rw-r--r--res/values/strings.xml6
-rw-r--r--src/com/android/settings/users/UserSettings.java109
65 files changed, 362 insertions, 18 deletions
diff --git a/res/drawable-hdpi/avatar_default_1.png b/res/drawable-hdpi/avatar_default_1.png
deleted file mode 100644
index 39ffd73..0000000
--- a/res/drawable-hdpi/avatar_default_1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/avatar_default_2.png b/res/drawable-hdpi/avatar_default_2.png
deleted file mode 100644
index 79203c5..0000000
--- a/res/drawable-hdpi/avatar_default_2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/avatar_default_3.png b/res/drawable-hdpi/avatar_default_3.png
deleted file mode 100644
index 4d179b3..0000000
--- a/res/drawable-hdpi/avatar_default_3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/avatar_default_4.png b/res/drawable-hdpi/avatar_default_4.png
deleted file mode 100644
index 1a0332f..0000000
--- a/res/drawable-hdpi/avatar_default_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/avatar_default_5.png b/res/drawable-hdpi/avatar_default_5.png
deleted file mode 100644
index 2487e66..0000000
--- a/res/drawable-hdpi/avatar_default_5.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/avatar_default_6.png b/res/drawable-hdpi/avatar_default_6.png
deleted file mode 100644
index f57e1eb..0000000
--- a/res/drawable-hdpi/avatar_default_6.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/avatar_default_7.png b/res/drawable-hdpi/avatar_default_7.png
deleted file mode 100644
index dc4b2ce..0000000
--- a/res/drawable-hdpi/avatar_default_7.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/avatar_default_8.png b/res/drawable-hdpi/avatar_default_8.png
deleted file mode 100644
index 64e7936..0000000
--- a/res/drawable-hdpi/avatar_default_8.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_person_white.png b/res/drawable-hdpi/ic_person_white.png
new file mode 100644
index 0000000..009524a
--- /dev/null
+++ b/res/drawable-hdpi/ic_person_white.png
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/avatar_default_1.png b/res/drawable-ldrtl-hdpi/avatar_default_1.png
deleted file mode 100644
index 4ebe7fe..0000000
--- a/res/drawable-ldrtl-hdpi/avatar_default_1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/avatar_default_2.png b/res/drawable-ldrtl-hdpi/avatar_default_2.png
deleted file mode 100644
index 524e556..0000000
--- a/res/drawable-ldrtl-hdpi/avatar_default_2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/avatar_default_3.png b/res/drawable-ldrtl-hdpi/avatar_default_3.png
deleted file mode 100644
index ea0d69d..0000000
--- a/res/drawable-ldrtl-hdpi/avatar_default_3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/avatar_default_4.png b/res/drawable-ldrtl-hdpi/avatar_default_4.png
deleted file mode 100644
index 7387835..0000000
--- a/res/drawable-ldrtl-hdpi/avatar_default_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/avatar_default_5.png b/res/drawable-ldrtl-hdpi/avatar_default_5.png
deleted file mode 100644
index 0bb455c..0000000
--- a/res/drawable-ldrtl-hdpi/avatar_default_5.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/avatar_default_6.png b/res/drawable-ldrtl-hdpi/avatar_default_6.png
deleted file mode 100644
index fa42704..0000000
--- a/res/drawable-ldrtl-hdpi/avatar_default_6.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/avatar_default_7.png b/res/drawable-ldrtl-hdpi/avatar_default_7.png
deleted file mode 100644
index 79c0fb7..0000000
--- a/res/drawable-ldrtl-hdpi/avatar_default_7.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/avatar_default_8.png b/res/drawable-ldrtl-hdpi/avatar_default_8.png
deleted file mode 100644
index a254b84..0000000
--- a/res/drawable-ldrtl-hdpi/avatar_default_8.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/avatar_default_1.png b/res/drawable-ldrtl-mdpi/avatar_default_1.png
deleted file mode 100644
index 2b2c00c..0000000
--- a/res/drawable-ldrtl-mdpi/avatar_default_1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/avatar_default_2.png b/res/drawable-ldrtl-mdpi/avatar_default_2.png
deleted file mode 100644
index fa05e11..0000000
--- a/res/drawable-ldrtl-mdpi/avatar_default_2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/avatar_default_3.png b/res/drawable-ldrtl-mdpi/avatar_default_3.png
deleted file mode 100644
index 91c7d5a..0000000
--- a/res/drawable-ldrtl-mdpi/avatar_default_3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/avatar_default_4.png b/res/drawable-ldrtl-mdpi/avatar_default_4.png
deleted file mode 100644
index 4638ac2..0000000
--- a/res/drawable-ldrtl-mdpi/avatar_default_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/avatar_default_5.png b/res/drawable-ldrtl-mdpi/avatar_default_5.png
deleted file mode 100644
index 6d84a15..0000000
--- a/res/drawable-ldrtl-mdpi/avatar_default_5.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/avatar_default_6.png b/res/drawable-ldrtl-mdpi/avatar_default_6.png
deleted file mode 100644
index c62ea5b..0000000
--- a/res/drawable-ldrtl-mdpi/avatar_default_6.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/avatar_default_7.png b/res/drawable-ldrtl-mdpi/avatar_default_7.png
deleted file mode 100644
index fe0cbfe..0000000
--- a/res/drawable-ldrtl-mdpi/avatar_default_7.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/avatar_default_8.png b/res/drawable-ldrtl-mdpi/avatar_default_8.png
deleted file mode 100644
index 424ba3d..0000000
--- a/res/drawable-ldrtl-mdpi/avatar_default_8.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/avatar_default_1.png b/res/drawable-ldrtl-xhdpi/avatar_default_1.png
deleted file mode 100644
index 1fdbd46..0000000
--- a/res/drawable-ldrtl-xhdpi/avatar_default_1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/avatar_default_2.png b/res/drawable-ldrtl-xhdpi/avatar_default_2.png
deleted file mode 100644
index 9d3d693..0000000
--- a/res/drawable-ldrtl-xhdpi/avatar_default_2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/avatar_default_3.png b/res/drawable-ldrtl-xhdpi/avatar_default_3.png
deleted file mode 100644
index 3778914..0000000
--- a/res/drawable-ldrtl-xhdpi/avatar_default_3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/avatar_default_4.png b/res/drawable-ldrtl-xhdpi/avatar_default_4.png
deleted file mode 100644
index a25b4f8..0000000
--- a/res/drawable-ldrtl-xhdpi/avatar_default_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/avatar_default_5.png b/res/drawable-ldrtl-xhdpi/avatar_default_5.png
deleted file mode 100644
index 2840f22..0000000
--- a/res/drawable-ldrtl-xhdpi/avatar_default_5.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/avatar_default_6.png b/res/drawable-ldrtl-xhdpi/avatar_default_6.png
deleted file mode 100644
index d438170..0000000
--- a/res/drawable-ldrtl-xhdpi/avatar_default_6.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/avatar_default_7.png b/res/drawable-ldrtl-xhdpi/avatar_default_7.png
deleted file mode 100644
index b155d9e..0000000
--- a/res/drawable-ldrtl-xhdpi/avatar_default_7.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/avatar_default_8.png b/res/drawable-ldrtl-xhdpi/avatar_default_8.png
deleted file mode 100644
index a17e3a4..0000000
--- a/res/drawable-ldrtl-xhdpi/avatar_default_8.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/avatar_default_1.png b/res/drawable-mdpi/avatar_default_1.png
deleted file mode 100644
index 0d8e3a2..0000000
--- a/res/drawable-mdpi/avatar_default_1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/avatar_default_2.png b/res/drawable-mdpi/avatar_default_2.png
deleted file mode 100644
index 0cc4c3d..0000000
--- a/res/drawable-mdpi/avatar_default_2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/avatar_default_3.png b/res/drawable-mdpi/avatar_default_3.png
deleted file mode 100644
index c43ad6f..0000000
--- a/res/drawable-mdpi/avatar_default_3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/avatar_default_4.png b/res/drawable-mdpi/avatar_default_4.png
deleted file mode 100644
index 6906489..0000000
--- a/res/drawable-mdpi/avatar_default_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/avatar_default_5.png b/res/drawable-mdpi/avatar_default_5.png
deleted file mode 100644
index 857f277..0000000
--- a/res/drawable-mdpi/avatar_default_5.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/avatar_default_6.png b/res/drawable-mdpi/avatar_default_6.png
deleted file mode 100644
index 9d0f968..0000000
--- a/res/drawable-mdpi/avatar_default_6.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/avatar_default_7.png b/res/drawable-mdpi/avatar_default_7.png
deleted file mode 100644
index 7db8864..0000000
--- a/res/drawable-mdpi/avatar_default_7.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/avatar_default_8.png b/res/drawable-mdpi/avatar_default_8.png
deleted file mode 100644
index 98d67d9..0000000
--- a/res/drawable-mdpi/avatar_default_8.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_person_white.png b/res/drawable-mdpi/ic_person_white.png
new file mode 100644
index 0000000..563f1d1
--- /dev/null
+++ b/res/drawable-mdpi/ic_person_white.png
Binary files differ
diff --git a/res/drawable-xhdpi/avatar_default_1.png b/res/drawable-xhdpi/avatar_default_1.png
deleted file mode 100644
index 6caa06a..0000000
--- a/res/drawable-xhdpi/avatar_default_1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/avatar_default_2.png b/res/drawable-xhdpi/avatar_default_2.png
deleted file mode 100644
index faf3b15..0000000
--- a/res/drawable-xhdpi/avatar_default_2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/avatar_default_3.png b/res/drawable-xhdpi/avatar_default_3.png
deleted file mode 100644
index 63a80ff..0000000
--- a/res/drawable-xhdpi/avatar_default_3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/avatar_default_4.png b/res/drawable-xhdpi/avatar_default_4.png
deleted file mode 100644
index d743dc6..0000000
--- a/res/drawable-xhdpi/avatar_default_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/avatar_default_5.png b/res/drawable-xhdpi/avatar_default_5.png
deleted file mode 100644
index b7b822b..0000000
--- a/res/drawable-xhdpi/avatar_default_5.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/avatar_default_6.png b/res/drawable-xhdpi/avatar_default_6.png
deleted file mode 100644
index f5b5e84..0000000
--- a/res/drawable-xhdpi/avatar_default_6.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/avatar_default_7.png b/res/drawable-xhdpi/avatar_default_7.png
deleted file mode 100644
index 4271c0d..0000000
--- a/res/drawable-xhdpi/avatar_default_7.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/avatar_default_8.png b/res/drawable-xhdpi/avatar_default_8.png
deleted file mode 100644
index 27261a5..0000000
--- a/res/drawable-xhdpi/avatar_default_8.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_person_white.png b/res/drawable-xhdpi/ic_person_white.png
new file mode 100644
index 0000000..0200ece
--- /dev/null
+++ b/res/drawable-xhdpi/ic_person_white.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_person_white.png b/res/drawable-xxhdpi/ic_person_white.png
new file mode 100644
index 0000000..6a6f033
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_person_white.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_person_white.png b/res/drawable-xxxhdpi/ic_person_white.png
new file mode 100644
index 0000000..9092553
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_person_white.png
Binary files differ
diff --git a/res/drawable/ic_avatar_default_1.xml b/res/drawable/ic_avatar_default_1.xml
new file mode 100644
index 0000000..edd919a
--- /dev/null
+++ b/res/drawable/ic_avatar_default_1.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="oval">
+ <size android:width="40dp" android:height="40dp" />
+ <solid android:color="@color/pink_500" />
+ </shape>
+ </item>
+ <item android:top="8dp" android:bottom="8dp" android:left="8dp" android:right="8dp"
+ android:drawable="@drawable/ic_person_white" />
+</layer-list>
+
diff --git a/res/drawable/ic_avatar_default_2.xml b/res/drawable/ic_avatar_default_2.xml
new file mode 100644
index 0000000..77918a0
--- /dev/null
+++ b/res/drawable/ic_avatar_default_2.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="oval">
+ <size android:width="40dp" android:height="40dp" />
+ <solid android:color="@color/indigo_500" />
+ </shape>
+ </item>
+ <item android:top="8dp" android:bottom="8dp" android:left="8dp" android:right="8dp"
+ android:drawable="@drawable/ic_person_white" />
+</layer-list>
+
diff --git a/res/drawable/ic_avatar_default_3.xml b/res/drawable/ic_avatar_default_3.xml
new file mode 100644
index 0000000..49fd6c4
--- /dev/null
+++ b/res/drawable/ic_avatar_default_3.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="oval">
+ <size android:width="40dp" android:height="40dp" />
+ <solid android:color="@color/blue_500" />
+ </shape>
+ </item>
+ <item android:top="8dp" android:bottom="8dp" android:left="8dp" android:right="8dp"
+ android:drawable="@drawable/ic_person_white" />
+</layer-list>
+
diff --git a/res/drawable/ic_avatar_default_4.xml b/res/drawable/ic_avatar_default_4.xml
new file mode 100644
index 0000000..6992f90
--- /dev/null
+++ b/res/drawable/ic_avatar_default_4.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="oval">
+ <size android:width="40dp" android:height="40dp" />
+ <solid android:color="@color/teal_500" />
+ </shape>
+ </item>
+ <item android:top="8dp" android:bottom="8dp" android:left="8dp" android:right="8dp"
+ android:drawable="@drawable/ic_person_white" />
+</layer-list>
+
diff --git a/res/drawable/ic_avatar_default_5.xml b/res/drawable/ic_avatar_default_5.xml
new file mode 100644
index 0000000..2aa0db2
--- /dev/null
+++ b/res/drawable/ic_avatar_default_5.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="oval">
+ <size android:width="40dp" android:height="40dp" />
+ <solid android:color="@color/green_500" />
+ </shape>
+ </item>
+ <item android:top="8dp" android:bottom="8dp" android:left="8dp" android:right="8dp"
+ android:drawable="@drawable/ic_person_white" />
+</layer-list>
+
diff --git a/res/drawable/ic_avatar_default_6.xml b/res/drawable/ic_avatar_default_6.xml
new file mode 100644
index 0000000..7f9bb32
--- /dev/null
+++ b/res/drawable/ic_avatar_default_6.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="oval">
+ <size android:width="40dp" android:height="40dp" />
+ <solid android:color="@color/light_green_500" />
+ </shape>
+ </item>
+ <item android:top="8dp" android:bottom="8dp" android:left="8dp" android:right="8dp"
+ android:drawable="@drawable/ic_person_white" />
+</layer-list>
+
diff --git a/res/drawable/ic_avatar_default_7.xml b/res/drawable/ic_avatar_default_7.xml
new file mode 100644
index 0000000..1c1c5f3
--- /dev/null
+++ b/res/drawable/ic_avatar_default_7.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="oval">
+ <size android:width="40dp" android:height="40dp" />
+ <solid android:color="@color/orange_500" />
+ </shape>
+ </item>
+ <item android:top="8dp" android:bottom="8dp" android:left="8dp" android:right="8dp"
+ android:drawable="@drawable/ic_person_white" />
+</layer-list>
+
diff --git a/res/drawable/ic_avatar_default_8.xml b/res/drawable/ic_avatar_default_8.xml
new file mode 100644
index 0000000..478454e
--- /dev/null
+++ b/res/drawable/ic_avatar_default_8.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="oval">
+ <size android:width="40dp" android:height="40dp" />
+ <solid android:color="@color/deep_orange_500" />
+ </shape>
+ </item>
+ <item android:top="8dp" android:bottom="8dp" android:left="8dp" android:right="8dp"
+ android:drawable="@drawable/ic_person_white" />
+</layer-list>
+
diff --git a/res/drawable/ic_avatar_guest.xml b/res/drawable/ic_avatar_guest.xml
new file mode 100644
index 0000000..f81fe89
--- /dev/null
+++ b/res/drawable/ic_avatar_guest.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="oval">
+ <size android:width="40dp" android:height="40dp" />
+ <solid android:color="@color/grey_500" />
+ </shape>
+ </item>
+ <item android:top="8dp" android:bottom="8dp" android:left="8dp" android:right="8dp"
+ android:drawable="@drawable/ic_person_white" />
+</layer-list>
+
diff --git a/res/values/colors.xml b/res/values/colors.xml
index b523801..ee9c4c4 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -67,4 +67,17 @@
<color name="default_preference_background_color">@android:color/white</color>
<color name="preference_list_fragment_background_color">@color/default_preference_background_color</color>
<color name="search_panel_list_background_color">@color/default_preference_background_color</color>
+
+ <!-- Default avatar colors -->
+ <color name="pink_500">#ffe91e63</color>
+ <color name="indigo_500">#ff3f51b5</color>
+ <color name="blue_500">@*android:color/material_blue_500</color>
+ <color name="teal_500">@*android:color/material_teal_500</color>
+ <color name="green_500">@*android:color/material_green_500</color>
+ <color name="light_green_500">#ff8bc34a</color>
+ <color name="orange_500">@*android:color/material_orange_500</color>
+ <color name="deep_orange_500">@*android:color/material_deep_orange_500</color>
+ <!-- Avatar color used for guest -->
+ <color name="grey_500">@*android:color/material_grey_500</color>
+
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ec4e13c..d938772 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5171,6 +5171,12 @@
<string name="user_delete_button">Delete</string>
<!-- Title for Guest user [CHAR LIMIT=35] -->
<string name="user_guest">Guest</string>
+ <!-- Label for item to exit guest mode [CHAR LIMIT=35] -->
+ <string name="user_exit_guest_title">Exit guest</string>
+ <!-- Title of dialog to user to confirm exiting guest. [CHAR LIMIT=50] -->
+ <string name="user_exit_guest_confirm_title">Exiting guest session?</string>
+ <!-- Message to user to confirm exiting guest. [CHAR LIMIT=none] -->
+ <string name="user_exit_guest_confirm_message">Ending the guest session will remove local data.</string>
<!-- Title of preference to enable calling[CHAR LIMIT=35] -->
<string name="user_enable_calling">Enable phone calls?</string>
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java
index 2d58327..e8c99ad 100644
--- a/src/com/android/settings/users/UserSettings.java
+++ b/src/com/android/settings/users/UserSettings.java
@@ -37,6 +37,7 @@ import android.content.pm.UserInfo;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
@@ -93,6 +94,7 @@ public class UserSettings extends SettingsPreferenceFragment
private static final int DIALOG_USER_CANNOT_MANAGE = 5;
private static final int DIALOG_CHOOSE_USER_TYPE = 6;
private static final int DIALOG_NEED_LOCKSCREEN = 7;
+ private static final int DIALOG_CONFIRM_EXIT_GUEST = 8;
private static final int MESSAGE_UPDATE_LIST = 1;
private static final int MESSAGE_SETUP_USER = 2;
@@ -107,16 +109,18 @@ public class UserSettings extends SettingsPreferenceFragment
"key_add_user_long_message_displayed";
static final int[] USER_DRAWABLES = {
- R.drawable.avatar_default_1,
- R.drawable.avatar_default_2,
- R.drawable.avatar_default_3,
- R.drawable.avatar_default_4,
- R.drawable.avatar_default_5,
- R.drawable.avatar_default_6,
- R.drawable.avatar_default_7,
- R.drawable.avatar_default_8
+ R.drawable.ic_avatar_default_1,
+ R.drawable.ic_avatar_default_2,
+ R.drawable.ic_avatar_default_3,
+ R.drawable.ic_avatar_default_4,
+ R.drawable.ic_avatar_default_5,
+ R.drawable.ic_avatar_default_6,
+ R.drawable.ic_avatar_default_7,
+ R.drawable.ic_avatar_default_8
};
+ private static final int GUEST_DRAWABLE_ID = R.drawable.ic_avatar_guest;
+
private static final String KEY_TITLE = "title";
private static final String KEY_SUMMARY = "summary";
@@ -137,6 +141,11 @@ public class UserSettings extends SettingsPreferenceFragment
private boolean mIsOwner = UserHandle.myUserId() == UserHandle.USER_OWNER;
private boolean mIsGuest;
+ // A place to cache the generated guest avatar
+ private Drawable mGuestDrawable;
+ // A place to cache the generated default avatar
+ private Drawable mDefaultAvatarDrawable;
+
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
@@ -195,8 +204,9 @@ public class UserSettings extends SettingsPreferenceFragment
addPreferencesFromResource(R.xml.user_settings);
mUserListCategory = (PreferenceGroup) findPreference(KEY_USER_LIST);
- mMePreference = new UserPreference(context, null, myUserId,
- mUserManager.isLinkedUser() ? null : this, null);
+ mMePreference = new UserPreference(context, null /* attrs */, myUserId,
+ mUserManager.isLinkedUser() || mIsGuest ? null : this /* settings icon handler */,
+ null /* delete icon handler */);
mMePreference.setKey(KEY_USER_ME);
mMePreference.setOnPreferenceClickListener(this);
if (mIsOwner) {
@@ -275,8 +285,18 @@ public class UserSettings extends SettingsPreferenceFragment
}
}
+ /**
+ * Loads profile information for the current user.
+ */
private void loadProfile() {
mProfileExists = false;
+ if (mIsGuest) {
+ // No need to load profile information
+ mMePreference.setIcon(getEncircledGuestDrawable());
+ mMePreference.setTitle(R.string.user_exit_guest_title);
+ return;
+ }
+
new AsyncTask<Void, Void, String>() {
@Override
protected void onPostExecute(String result) {
@@ -370,9 +390,8 @@ public class UserSettings extends SettingsPreferenceFragment
mUserManager.setUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, true, user);
Secure.putIntForUser(getContentResolver(),
Secure.LOCATION_MODE, Secure.LOCATION_MODE_OFF, userId);
- Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
- UserSettings.USER_DRAWABLES[
- userId % UserSettings.USER_DRAWABLES.length]);
+ Bitmap bitmap = createBitmapFromDrawable(
+ USER_DRAWABLES[userId % UserSettings.USER_DRAWABLES.length]);
mUserManager.setUserIcon(userId, bitmap);
// Add shared accounts
AccountManager am = AccountManager.get(getActivity());
@@ -385,6 +404,15 @@ public class UserSettings extends SettingsPreferenceFragment
return newUserInfo;
}
+ private Bitmap createBitmapFromDrawable(int resId) {
+ Drawable icon = getResources().getDrawable(resId);
+ icon.setBounds(0, 0, icon.getIntrinsicWidth(), icon.getIntrinsicHeight());
+ Bitmap bitmap = Bitmap.createBitmap(icon.getIntrinsicWidth(), icon.getIntrinsicHeight(),
+ Bitmap.Config.ARGB_8888);
+ icon.draw(new Canvas(bitmap));
+ return bitmap;
+ }
+
private UserInfo createTrustedUser() {
UserInfo newUserInfo = mUserManager.createUser(
getResources().getString(R.string.user_new_user_name), 0);
@@ -567,6 +595,21 @@ public class UserSettings extends SettingsPreferenceFragment
.create();
return dlg;
}
+ case DIALOG_CONFIRM_EXIT_GUEST: {
+ Dialog dlg = new AlertDialog.Builder(context)
+ .setTitle(R.string.user_exit_guest_confirm_title)
+ .setMessage(R.string.user_exit_guest_confirm_message)
+ .setPositiveButton(android.R.string.yes,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ exitGuest();
+ }
+ })
+ .setNegativeButton(android.R.string.no, null)
+ .create();
+ return dlg;
+ }
default:
return null;
}
@@ -634,6 +677,17 @@ public class UserSettings extends SettingsPreferenceFragment
}
}
+ /**
+ * Erase the current user (guest) and switch to another user.
+ */
+ private void exitGuest() {
+ // Just to be safe
+ if (!mIsGuest) {
+ return;
+ }
+ removeThisUser();
+ }
+
private void updateUserList() {
if (getActivity() == null) return;
List<UserInfo> users = mUserManager.getUsers(true);
@@ -695,7 +749,7 @@ public class UserSettings extends SettingsPreferenceFragment
if (user.iconPath != null) {
if (mUserIcons.get(user.id) == null) {
missingIcons.add(user.id);
- pref.setIcon(encircle(R.drawable.avatar_default_1));
+ pref.setIcon(getEncircledDefaultAvatar());
} else {
setPhotoId(pref, user);
}
@@ -707,7 +761,7 @@ public class UserSettings extends SettingsPreferenceFragment
null, null);
pref.setEnabled(false);
pref.setTitle(R.string.user_new_user_name);
- pref.setIcon(encircle(R.drawable.avatar_default_1));
+ pref.setIcon(getEncircledDefaultAvatar());
mUserListCategory.addPreference(pref);
}
@@ -716,7 +770,7 @@ public class UserSettings extends SettingsPreferenceFragment
Preference pref = new UserPreference(getActivity(), null,
UserPreference.USERID_GUEST_DEFAULTS, mIsOwner ? this : null, null);
pref.setTitle(R.string.user_guest);
- pref.setIcon(encircle(R.drawable.ic_settings_accounts));
+ pref.setIcon(getEncircledGuestDrawable());
pref.setOnPreferenceClickListener(this);
mUserListCategory.addPreference(pref);
}
@@ -765,11 +819,26 @@ public class UserSettings extends SettingsPreferenceFragment
}
private void assignDefaultPhoto(UserInfo user) {
- Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
- USER_DRAWABLES[user.id % USER_DRAWABLES.length]);
+ Bitmap bitmap = createBitmapFromDrawable(
+ USER_DRAWABLES[user.id % UserSettings.USER_DRAWABLES.length]);
mUserManager.setUserIcon(user.id, bitmap);
}
+ private Drawable getEncircledGuestDrawable() {
+ if (mGuestDrawable == null) {
+ mGuestDrawable = encircle(createBitmapFromDrawable(GUEST_DRAWABLE_ID));
+ }
+ return mGuestDrawable;
+ }
+
+ private Drawable getEncircledDefaultAvatar() {
+ if (mDefaultAvatarDrawable == null) {
+ mDefaultAvatarDrawable =
+ encircle(createBitmapFromDrawable(R.drawable.ic_avatar_default_1));
+ }
+ return mDefaultAvatarDrawable;
+ }
+
private void setPhotoId(Preference pref, UserInfo user) {
Bitmap bitmap = mUserIcons.get(user.id);
if (bitmap != null) {
@@ -786,6 +855,10 @@ public class UserSettings extends SettingsPreferenceFragment
@Override
public boolean onPreferenceClick(Preference pref) {
if (pref == mMePreference) {
+ if (mIsGuest) {
+ showDialog(DIALOG_CONFIRM_EXIT_GUEST);
+ return true;
+ }
Intent editProfile;
if (!mProfileExists) {
editProfile = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);