1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

Fix a bug that caused accounts to not have a color on initial load

(and now caused a crash on inital load)
This commit is contained in:
Jesse Vincent 2012-09-24 12:10:53 -04:00
parent 50a9a90b55
commit 6e3ac2317e

View File

@ -267,7 +267,11 @@ public class Account implements BaseAccount {
mAutoExpandFolderName = INBOX; mAutoExpandFolderName = INBOX;
mInboxFolderName = INBOX; mInboxFolderName = INBOX;
mMaxPushFolders = 10; mMaxPushFolders = 10;
mChipColor = (new Random()).nextInt(0xffffff) + 0xff000000; Random random = new Random((long)mAccountNumber + 4);
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;
@ -306,6 +310,8 @@ public class Account implements BaseAccount {
mNotificationSetting.setRing(true); mNotificationSetting.setRing(true);
mNotificationSetting.setRingtone("content://settings/system/notification_sound"); mNotificationSetting.setRingtone("content://settings/system/notification_sound");
mNotificationSetting.setLedColor(mChipColor); mNotificationSetting.setLedColor(mChipColor);
cacheChips();
} }
protected Account(Preferences preferences, String uuid) { protected Account(Preferences preferences, String uuid) {