paramterize about activity title

This commit is contained in:
Daniel Gultsch 2018-11-08 13:02:14 +01:00
parent e450626d5c
commit 41b9c0de55
5 changed files with 10 additions and 12 deletions

View File

@ -209,7 +209,6 @@
android:windowSoftInputMode="stateAlwaysHidden"/>
<activity
android:name=".ui.AboutActivity"
android:label="@string/title_activity_about"
android:parentActivityName=".ui.SettingsActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"

View File

@ -20,5 +20,7 @@ public class AboutActivity extends AppCompatActivity {
setContentView(R.layout.activity_about);
setSupportActionBar(findViewById(R.id.toolbar));
configureActionBar(getSupportActionBar());
setTitle(getString(R.string.title_activity_about_x, getString(R.string.app_name
)));
}
}

View File

@ -11,12 +11,16 @@ import eu.siacs.conversations.utils.PhoneHelper;
public class AboutPreference extends Preference {
public AboutPreference(final Context context, final AttributeSet attrs, final int defStyle) {
super(context, attrs, defStyle);
setSummary();
final String appName = context.getString(R.string.app_name);
setSummary(appName +' '+ PhoneHelper.getVersionName(context));
setTitle(context.getString(R.string.title_activity_about_x, appName));
}
public AboutPreference(final Context context, final AttributeSet attrs) {
super(context, attrs);
setSummary();
final String appName = context.getString(R.string.app_name);
setSummary(appName +' '+ PhoneHelper.getVersionName(context));
setTitle(context.getString(R.string.title_activity_about_x, appName));
}
@Override
@ -25,9 +29,5 @@ public class AboutPreference extends Preference {
final Intent intent = new Intent(getContext(), AboutActivity.class);
getContext().startActivity(intent);
}
private void setSummary() {
setSummary(getContext().getString(R.string.app_name) +' '+ PhoneHelper.getVersionName(getContext()));
}
}

View File

@ -268,8 +268,7 @@
<string name="pref_allow_message_correction_summary">Allow your contacts to retroactively edit their messages</string>
<string name="pref_expert_options">Expert settings</string>
<string name="pref_expert_options_summary">Please be careful with these</string>
<string name="title_activity_about">About Conversations</string>
<string name="pref_about_conversations_summary">Build and licensing information</string>
<string name="title_activity_about_x">About %s</string>
<string name="title_pref_quiet_hours">Quiet Hours</string>
<string name="title_pref_quiet_hours_start_time">Start time</string>
<string name="title_pref_quiet_hours_end_time">End time</string>

View File

@ -342,7 +342,5 @@
android:summary="@string/pref_never_send_crash_summary"
android:title="@string/pref_never_send_crash" />
</PreferenceCategory>
<eu.siacs.conversations.ui.AboutPreference
android:summary="@string/pref_about_conversations_summary"
android:title="@string/title_activity_about" />
<eu.siacs.conversations.ui.AboutPreference/>
</PreferenceScreen>