Skip to content

Commit

Permalink
ShareInto format/prefix: Improve wording, restore previous defaultvalue
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantner committed Nov 20, 2021
1 parent 23f79cf commit 687ef52
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ protected void onPreferenceChanged(final SharedPreferences prefs, final String k
Toast.makeText(getContext(), e.getLocalizedMessage() + "\n\n" + getString(R.string.loading_default_value), Toast.LENGTH_SHORT).show();
prefs.edit().putString(key, "").commit();
}
} else if (eq(key, R.string.pref_key__share_into_prefix)) {
} else if (eq(key, R.string.pref_key__share_into_format)) {
try {
Toast.makeText(context, ShareUtil.formatDateTime(context, prefs.getString(key, ""), System.currentTimeMillis(), null), Toast.LENGTH_SHORT).show();
} catch (IllegalArgumentException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,6 @@ public boolean isZimWikiDynamicNotebookRootEnabled() {
}

public String getShareIntoPrefix() {
return getString(R.string.pref_key__share_into_prefix, "");
return getString(R.string.pref_key__share_into_format, "\n----\n");
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/values/string-not_translatable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -330,5 +330,5 @@ work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
<string name="action_format_markdown" translatable="false">action_format_markdown</string>
<string name="action_format_todotxt" translatable="false">action_format_todotxt</string>
<string name="action_format_zimwiki" translatable="false">action_format_zimwiki</string>
<string name="pref_key__share_into_prefix" translatable="false">pref_key__share_into_prefix</string>
<string name="pref_key__share_into_format" translatable="false">pref_key__share_into_format</string>
</resources>
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,6 @@ work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
<string name="match_all">Match All</string>
<string name="dynamic_notebook_root_links">Dynamic search for notebook root</string>
<string name="search_dynamically_for_notebook_root">In order to follow wiki links, dynamically search for the notebook.zim file to identify the root directory for the current notebook. Check this if you use multiple zim notebooks or the notebook directory set in the app does not correspond to your zim notebook.</string>
<string name="share_into_prefix_format_dialog">Prefix for any text shared into Markor. Follows Android\'s SimpleDateFormat rules.\n\nA single string placeholder \'%s\' (including quotes - see SimpleDateFormat rules) can be used to specify shared text positioning. Otherwise, this text will be used as a prefix.</string>
<string name="share_into_prefix">Shared text prefix</string>
<string name="share_into_format_prefix_for_text_shared">Format/Prefix for text shared into Markor. Follows Android\'s SimpleDateFormat rules.\n\nUse the placeholder \'%s\' (surrounded by single quotes) to position the shared text. If not specified, the shared text is appended and the format used as a prefix.</string>
<string name="share_into_format">Share into format</string>
</resources>
8 changes: 4 additions & 4 deletions app/src/main/res/xml/preferences_master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@
android:title="@string/keep_screen_on" />

<android.support.v7.preference.EditTextPreference
android:defaultValue="----\\n"
android:dialogMessage="@string/share_into_prefix_format_dialog"
android:defaultValue="\\n----\\n"
android:dialogMessage="@string/share_into_format_prefix_for_text_shared"
android:icon="@drawable/ic_share_black_24dp"
android:key="@string/pref_key__share_into_prefix"
android:title="@string/share_into_prefix" />
android:key="@string/pref_key__share_into_format"
android:title="@string/share_into_format" />
</PreferenceCategory>

<PreferenceCategory android:title="@string/main_view">
Expand Down

0 comments on commit 687ef52

Please sign in to comment.