1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-12 06:08:25 -05:00

Astyle recent changes for StorageManager listener.

This commit is contained in:
danapple 2011-03-20 15:37:51 -05:00
parent 90fc3d2c8d
commit 3f45df2bd4

View File

@ -293,22 +293,19 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
outState.putSerializable(ACCOUNT_STATS, accountStats); outState.putSerializable(ACCOUNT_STATS, accountStats);
} }
private StorageManager.StorageListener storageListener = new StorageManager.StorageListener() private StorageManager.StorageListener storageListener = new StorageManager.StorageListener() {
{
@Override
@Override public void onUnmount(String providerId) {
public void onUnmount(String providerId) refresh();
{ }
refresh();
} @Override
public void onMount(String providerId) {
@Override refresh();
public void onMount(String providerId) }
{ };
refresh();
}
};
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
@ -323,7 +320,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
super.onPause(); super.onPause();
MessagingController.getInstance(getApplication()).removeListener(mListener); MessagingController.getInstance(getApplication()).removeListener(mListener);
StorageManager.getInstance(getApplication()).removeListener(storageListener); StorageManager.getInstance(getApplication()).removeListener(storageListener);
} }
private void refresh() { private void refresh() {
@ -331,12 +328,11 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
List<BaseAccount> newAccounts; List<BaseAccount> newAccounts;
if (!K9.isHideSpecialAccounts() if (!K9.isHideSpecialAccounts()
&& accounts.length > 0) { && accounts.length > 0) {
newAccounts = new ArrayList<BaseAccount>(accounts.length + 2); newAccounts = new ArrayList<BaseAccount>(accounts.length + 2);
newAccounts.add(integratedInboxAccount); newAccounts.add(integratedInboxAccount);
newAccounts.add(unreadAccount); newAccounts.add(unreadAccount);
} } else {
else {
newAccounts = new ArrayList<BaseAccount>(accounts.length); newAccounts = new ArrayList<BaseAccount>(accounts.length);
} }
@ -432,7 +428,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
String toastText = getString(R.string.account_unavailable, account.getDescription()); String toastText = getString(R.string.account_unavailable, account.getDescription());
Toast toast = Toast.makeText(getApplication(), toastText, Toast.LENGTH_SHORT); Toast toast = Toast.makeText(getApplication(), toastText, Toast.LENGTH_SHORT);
toast.show(); toast.show();
Log.i(K9.LOG_TAG, "refusing to open account that is not available"); Log.i(K9.LOG_TAG, "refusing to open account that is not available");
return false; return false;
} }
@ -835,7 +831,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
holder.flaggedMessageCount.setOnClickListener(new AccountClickListener(account, SearchModifier.FLAGGED)); holder.flaggedMessageCount.setOnClickListener(new AccountClickListener(account, SearchModifier.FLAGGED));
holder.newMessageCount.setOnClickListener(new AccountClickListener(account, SearchModifier.UNREAD)); holder.newMessageCount.setOnClickListener(new AccountClickListener(account, SearchModifier.UNREAD));
view.getBackground().setAlpha(stats.available ? 0 : 127); view.getBackground().setAlpha(stats.available ? 0 : 127);
holder.activeIcons.setOnClickListener(new OnClickListener() { holder.activeIcons.setOnClickListener(new OnClickListener() {