mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 19:52:17 -05:00
Use HoloColorPicker to generate random account colors
This commit is contained in:
parent
8084964c23
commit
0844b4d394
@ -9,7 +9,6 @@ import java.util.Date;
|
|||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Random;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
@ -40,6 +39,7 @@ import com.fsck.k9.search.SearchSpecification.Attribute;
|
|||||||
import com.fsck.k9.search.SearchSpecification.SearchCondition;
|
import com.fsck.k9.search.SearchSpecification.SearchCondition;
|
||||||
import com.fsck.k9.search.SearchSpecification.Searchfield;
|
import com.fsck.k9.search.SearchSpecification.Searchfield;
|
||||||
import com.fsck.k9.view.ColorChip;
|
import com.fsck.k9.view.ColorChip;
|
||||||
|
import com.larswerkman.colorpicker.ColorPicker;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
@ -283,11 +283,7 @@ public class Account implements BaseAccount {
|
|||||||
mAutoExpandFolderName = INBOX;
|
mAutoExpandFolderName = INBOX;
|
||||||
mInboxFolderName = INBOX;
|
mInboxFolderName = INBOX;
|
||||||
mMaxPushFolders = 10;
|
mMaxPushFolders = 10;
|
||||||
Random random = new Random((long)mAccountNumber + 4);
|
mChipColor = ColorPicker.getRandomColor();
|
||||||
mChipColor = (random.nextInt(0x70) +
|
|
||||||
(random.nextInt(0x70) * 0xff) +
|
|
||||||
(random.nextInt(0x70) * 0xffff) +
|
|
||||||
0xff000000);
|
|
||||||
goToUnreadMessageSearch = false;
|
goToUnreadMessageSearch = false;
|
||||||
mNotificationShowsUnreadCount = true;
|
mNotificationShowsUnreadCount = true;
|
||||||
subscribedFoldersOnly = false;
|
subscribedFoldersOnly = false;
|
||||||
@ -399,13 +395,7 @@ public class Account implements BaseAccount {
|
|||||||
|
|
||||||
mAccountNumber = prefs.getInt(mUuid + ".accountNumber", 0);
|
mAccountNumber = prefs.getInt(mUuid + ".accountNumber", 0);
|
||||||
|
|
||||||
Random random = new Random((long)mAccountNumber + 4);
|
mChipColor = prefs.getInt(mUuid + ".chipColor", ColorPicker.getRandomColor());
|
||||||
|
|
||||||
mChipColor = prefs.getInt(mUuid + ".chipColor",
|
|
||||||
(random.nextInt(0x70)) +
|
|
||||||
(random.nextInt(0x70) * 0xff) +
|
|
||||||
(random.nextInt(0x70) * 0xffff) +
|
|
||||||
0xff000000);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mSortType = SortType.valueOf(prefs.getString(mUuid + ".sortTypeEnum",
|
mSortType = SortType.valueOf(prefs.getString(mUuid + ".sortTypeEnum",
|
||||||
|
Loading…
Reference in New Issue
Block a user