Implement "account settings"/"add account"

- Implemented "account settings".
- Added "add account" menu.  It's not clear how to get to the screen at
  this point, so just added a menu item for this for testing.

Change-Id: I78cfa54f2533917cc742b6ec027c2a0624cf0c1a
This commit is contained in:
Makoto Onuki 2010-08-09 17:25:42 -07:00
parent b98f219cf0
commit 76681d906a
2 changed files with 24 additions and 4 deletions

View File

@ -32,6 +32,11 @@
android:icon="@android:drawable/ic_menu_preferences" android:icon="@android:drawable/ic_menu_preferences"
/> />
<!-- STOPSHIP: Dev version only. Remove this. --> <!-- STOPSHIP: Dev version only. Remove this. -->
<item android:id="@+id/add_new_account"
android:title="@string/add_account_action"
android:icon="@android:drawable/ic_menu_add"
/>
<!-- STOPSHIP: Dev version only. Remove this. -->
<item android:id="@+id/change_orientation" <item android:id="@+id/change_orientation"
android:title="@string/menu_change_orientation" android:title="@string/menu_change_orientation"
/> />

View File

@ -19,6 +19,8 @@ package com.android.email.activity;
import com.android.email.Email; import com.android.email.Email;
import com.android.email.R; import com.android.email.R;
import com.android.email.Utility; import com.android.email.Utility;
import com.android.email.activity.setup.AccountSettings;
import com.android.email.activity.setup.AccountSetupBasics;
import android.app.ActionBar; import android.app.ActionBar;
import android.app.Activity; import android.app.Activity;
@ -449,12 +451,12 @@ public class MessageListXL extends Activity implements View.OnClickListener,
// TODO Implement this // TODO Implement this
return true; return true;
case R.id.account_settings: case R.id.account_settings:
// TODO Implement this return onAccountSettings();
return true; case R.id.change_orientation: // STOPSHIP remove this
// STOPSHIP remove this
case R.id.change_orientation:
Utility.changeOrientation(this); Utility.changeOrientation(this);
return true; return true;
case R.id.add_new_account: // STOPSHIP remove this
return onAddNewAccount();
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
@ -467,6 +469,19 @@ public class MessageListXL extends Activity implements View.OnClickListener,
return true; return true;
} }
private boolean onAccountSettings() {
if (!mFragmentManager.isAccountSelected()) {
return false; // this shouldn't really happen
}
AccountSettings.actionSettings(this, mFragmentManager.getAccountId());
return true;
}
private boolean onAddNewAccount() {
AccountSetupBasics.actionNewAccount(this);
return true;
}
/** /**
* STOPSHIP: Remove this. * STOPSHIP: Remove this.
* Rotate screen when the R key is pressed. Workaround for auto-orientation not working. * Rotate screen when the R key is pressed. Workaround for auto-orientation not working.