Skip to content

Commit

Permalink
Move previously hardcoded text to strings.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
zeevox committed May 29, 2018
1 parent a63ae2e commit 3bbeb66
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,16 @@ public boolean onPreferenceClick(Preference preference) {

final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());

builder.setTitle("Random gradient")
.setMessage("Apply gradient called " + ColorUtils.getGradientName(randomGradientDetails[0])
+ "?\n\nIf you would like to try a different gradient, press cancel and select \"Random gradient\" again.")
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
builder.setTitle(R.string.prefs_uigradients_dialog_title)
.setMessage(String.format(getResources().getString(R.string.prefs_uigradients_dialog_description),
ColorUtils.getGradientName(randomGradientDetails[0])))
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
})
.setPositiveButton("Apply", new DialogInterface.OnClickListener() {
.setPositiveButton(R.string.action_apply, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
ColorPreference startColor = (ColorPreference) findPreference("gradient_start_color");
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
<string name="about_desc_app_icon">Ocquarium application icon</string>
<string name="about_text_author">Author</string>

<string name="action_ok">OK</string>
<string name="action_apply">Apply</string>
<string name="action_ok">@android:string/ok</string>
<string name="action_send_feedback">Send feedback</string>

<string name="anim_even_longer">5000</string>
Expand Down Expand Up @@ -130,6 +131,10 @@
<string name="prefs_show_navigation_bar_summary">Display the navigation bar while playing Ocquarium</string>
<string name="prefs_show_platlogo_summary">Display the Android Oreo logo before the octopus.</string>
<string name="prefs_show_platlogo_title">Show platform logo</string>
<string name="prefs_uigradients_dialog_title">Random gradient</string>
<string name="prefs_uigradients_dialog_description">Apply gradient called %s? If you would like to try a different gradient, press cancel and select \"Random gradient\" again.</string>
<string name="prefs_uigradients_summary">Random gradient</string>
<string name="prefs_uigradients_title">Pick a random set of colors from uigradients.com</string>
<string name="prefs_wallpaper_disabled_desc">Ocquarium live wallpaper already set.</string>

<string name="share_text">Check out \"%s\"\nhttps://play.google.com/store/apps/details?id=com.zeevox.octo</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/xml/pref_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
android:title="@string/prefs_reset_colors_title" />
<Preference
android:key="random_ui_gradients"
android:summary="Pick a random set of colors from uigradients.com"
android:title="Random gradient" />
android:summary="@string/prefs_uigradients_title"
android:title="@string/prefs_uigradients_summary" />
</PreferenceScreen>

0 comments on commit 3bbeb66

Please sign in to comment.