Consistent titles
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".NewEmailActivity"
|
||||
android:label="@string/compose"
|
||||
android:parentActivityName=".EmailListActivity" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
@@ -54,6 +55,7 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".addressbook.AddressBookActivity"
|
||||
android:label="@string/address_book"
|
||||
android:parentActivityName=".EmailListActivity" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
@@ -68,6 +70,7 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".addressbook.EditContactActivity"
|
||||
android:label="@string/action_new_contact"
|
||||
android:parentActivityName=".addressbook.ViewContactActivity" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
@@ -85,6 +88,7 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".NetworkInfoActivity"
|
||||
android:label="@string/network_status"
|
||||
android:parentActivityName=".EmailListActivity" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
@@ -92,6 +96,7 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".config.SettingsActivity"
|
||||
android:label="@string/action_settings"
|
||||
android:parentActivityName=".EmailListActivity" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
@@ -99,6 +104,7 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".config.SetPasswordActivity"
|
||||
android:label="@string/pref_title_change_password"
|
||||
android:parentActivityName=".config.SettingsActivity" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
@@ -113,6 +119,7 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".config.EditIdentityActivity"
|
||||
android:label="@string/title_new_identity"
|
||||
android:parentActivityName=".config.ViewIdentityActivity" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
|
||||
@@ -9,7 +9,6 @@ public class NetworkInfoActivity extends ActionBarActivity {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_toolbar);
|
||||
setTitle(R.string.network_status);
|
||||
|
||||
// Initialize I2P settings
|
||||
InitActivities init = new InitActivities(this);
|
||||
|
||||
@@ -11,7 +11,6 @@ public class NewEmailActivity extends ActionBarActivity implements
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_toolbar);
|
||||
setTitle(R.string.compose);
|
||||
|
||||
// Initialize I2P settings
|
||||
InitActivities init = new InitActivities(this);
|
||||
|
||||
@@ -21,7 +21,6 @@ public class AddressBookActivity extends ActionBarActivity implements
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_toolbar);
|
||||
setTitle(R.string.address_book);
|
||||
|
||||
// Initialize I2P settings
|
||||
InitActivities init = new InitActivities(this);
|
||||
|
||||
@@ -44,6 +44,8 @@ public class EditContactActivity extends ActionBarActivity {
|
||||
destination = args.getString(EditContactFragment.CONTACT_DESTINATION);
|
||||
f = EditContactFragment.newInstance(destination);
|
||||
}
|
||||
if (destination != null)
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
} else
|
||||
f = EditContactFragment.newInstance(null);
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
|
||||
@@ -30,6 +30,8 @@ public class EditIdentityActivity extends ActionBarActivity implements
|
||||
Bundle args = getIntent().getExtras();
|
||||
if (args != null)
|
||||
key = args.getString(EditIdentityFragment.IDENTITY_KEY);
|
||||
if (key != null)
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
EditIdentityFragment f = EditIdentityFragment.newInstance(key);
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.add(R.id.edit_identity_frag, f).commit();
|
||||
|
||||
@@ -10,11 +10,9 @@ import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -83,6 +81,12 @@ public abstract class IdentityShipFragment extends Fragment {
|
||||
mError = (TextView) view.findViewById(R.id.error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
getActivity().setTitle(getTitle());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode == SHIP_WAITER) {
|
||||
@@ -97,6 +101,7 @@ public abstract class IdentityShipFragment extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract int getTitle();
|
||||
protected abstract void setInterfaceEnabled(boolean enabled);
|
||||
|
||||
public static class ShipWaiterFrag extends TaskFragment<Object, String, String> {
|
||||
@@ -238,6 +243,11 @@ public abstract class IdentityShipFragment extends Fragment {
|
||||
.commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getTitle() {
|
||||
return R.string.export_identities;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setInterfaceEnabled(boolean enabled) {
|
||||
mExportFilename.setEnabled(enabled);
|
||||
@@ -365,6 +375,11 @@ public abstract class IdentityShipFragment extends Fragment {
|
||||
.commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getTitle() {
|
||||
return R.string.import_identities;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setInterfaceEnabled(boolean enabled) {
|
||||
mPassword.setEnabled(enabled);
|
||||
|
||||
@@ -12,7 +12,6 @@ public class SetPasswordActivity extends ActionBarActivity implements
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setTitle(R.string.pref_title_change_password);
|
||||
setContentView(R.layout.activity_set_password);
|
||||
|
||||
// Initialize I2P settings
|
||||
|
||||
@@ -200,6 +200,7 @@
|
||||
<string name="pref_title_identities">Identities</string>
|
||||
<string name="new_identity">New identity…</string>
|
||||
<string name="edit_identity">Edit identity</string>
|
||||
<string name="title_new_identity">New identity</string>
|
||||
<string name="public_name">Public name</string>
|
||||
<string name="description">Description</string>
|
||||
<string name="default_identity">Default identity</string>
|
||||
|
||||
Reference in New Issue
Block a user