Move "New Identity" action to list item
This commit is contained in:
1
TODO
1
TODO
@ -7,7 +7,6 @@ Fixes:
|
||||
-- Show full network error? Make it copy-able?
|
||||
|
||||
Tasks:
|
||||
- Move "New Identity" action to list item
|
||||
- Subclass EmailListFragment for each default mailbox
|
||||
- Refactor code
|
||||
-- Reorganize for clarity
|
||||
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item
|
||||
android:id="@+id/action_new_identity"
|
||||
android:icon="@drawable/ic_device_access_new_account"
|
||||
android:title="@string/new_identity"
|
||||
android:showAsAction="ifRoom"/>
|
||||
|
||||
</menu>
|
@ -121,7 +121,7 @@
|
||||
<string name="password_changed">Password changed successfully</string>
|
||||
|
||||
<string name="pref_title_identities">Identities</string>
|
||||
<string name="new_identity">New identity</string>
|
||||
<string name="new_identity">New identity...</string>
|
||||
<string name="edit_identity">Edit identity</string>
|
||||
<string name="public_name">Public name</string>
|
||||
<string name="description">Description</string>
|
||||
|
@ -17,5 +17,12 @@
|
||||
<header
|
||||
android:id="@+id/identity_settings"
|
||||
android:title="@string/pref_title_identities" />
|
||||
<header
|
||||
android:id="@+id/new_identity"
|
||||
android:title="@string/new_identity" >
|
||||
<intent
|
||||
android:targetClass="i2p.bote.android.config.EditIdentityActivity"
|
||||
android:targetPackage="i2p.bote.android" />
|
||||
</header>
|
||||
|
||||
</preference-headers>
|
@ -12,5 +12,6 @@
|
||||
android:targetClass="i2p.bote.android.config.SetPasswordActivity"
|
||||
android:targetPackage="i2p.bote.android" />
|
||||
</Preference>
|
||||
<Preference android:title="@string/new_identity" />
|
||||
|
||||
</PreferenceScreen>
|
@ -15,7 +15,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
@ -31,8 +30,6 @@ import android.preference.PreferenceCategory;
|
||||
import android.preference.PreferenceFragment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
@ -113,35 +110,6 @@ public class SettingsActivity extends PreferenceActivity {
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu
|
||||
getMenuInflater().inflate(R.menu.settings, menu);
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_new_identity:
|
||||
Intent ni = new Intent(this, EditIdentityActivity.class);
|
||||
startActivityForResult(ni, ALTER_IDENTITY_LIST);
|
||||
return true;
|
||||
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode == ALTER_IDENTITY_LIST) {
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
updateIdentities();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isValidFragment(String fragmentName) {
|
||||
return SettingsFragment.class.getName().equals(fragmentName);
|
||||
|
Reference in New Issue
Block a user