add button taking you to the (new) FAQ

This commit is contained in:
Eric House 2020-08-05 13:46:44 -07:00
parent b8f359c3e5
commit 92c1180411
5 changed files with 46 additions and 4 deletions

View file

@ -319,6 +319,13 @@ public class DelegateBase implements DlgClickNotify,
}
}
private void showFaq( String category, String entry )
{
Context context = getActivity();
String uri = getString( R.string.faq_uri_fmt, category, entry );
NetUtils.launchWebBrowserWith( context, uri );
}
protected String getString( int resID, Object... params )
{
return LocUtils.getString( m_activity, resID, params );
@ -737,7 +744,7 @@ public class DelegateBase implements DlgClickNotify,
public boolean onPosButton( Action action, Object[] params )
{
boolean handled = true;
Log.d( TAG, "%s.onPosButton(%s)", getClass().getSimpleName(), action );
// Log.d( TAG, "%s.onPosButton(%s)", getClass().getSimpleName(), action );
switch( action ) {
case ENABLE_NBS_ASK:
showSMSEnableDialog( Action.ENABLE_NBS_DO );
@ -757,8 +764,11 @@ public class DelegateBase implements DlgClickNotify,
case PERMS_BANNED_INFO:
NetUtils.launchWebBrowserWith( m_activity, R.string.nbs_ban_url );
break;
case SHOW_FAQ:
showFaq( (String)params[0], (String)params[1] );
break;
default:
Log.d( TAG, "unhandled action %s", action.toString() );
Log.d( TAG, "onPosButton(): unhandled action %s", action.toString() );
// Assert.assertTrue( !BuildConfig.DEBUG );
handled = false;
break;

View file

@ -133,6 +133,7 @@ public class DictBrowseDelegate extends DelegateBase
private PatTableRow m_rows[] = { null, null, null };
private Spinner m_spinnerMin;
private Spinner m_spinnerMax;
private boolean m_newAlertShown;
private class DictListAdapter extends BaseAdapter
implements SectionIndexer {
@ -688,12 +689,26 @@ public class DictBrowseDelegate extends DelegateBase
m_browseState.onFilterAccepted( m_dict, null );
initList( wrapper );
setFindPats( m_browseState.m_pats );
newFeatureAlert();
}
} );
}
} );
}
private void newFeatureAlert()
{
if ( ! m_newAlertShown ) {
m_newAlertShown = true;
makeNotAgainBuilder( R.string.new_feature_filter, R.string.key_na_newFeatureFilter )
.setActionPair( Action.SHOW_FAQ, R.string.button_faq )
.setParams("filters", "intro")
.setTitle(R.string.new_feature_title)
.show();
}
}
private void initList( IterWrapper newIter )
{
FrameLayout parent = removeList();

View file

@ -124,6 +124,7 @@ public class DlgDelegate {
ASKED_PHONE_STATE,
PERMS_QUERY,
PERMS_BANNED_INFO,
SHOW_FAQ,
} // Action enum
public static class ActionPair implements Serializable {

View file

@ -156,6 +156,7 @@
<string name="key_na_longtap_lookup">key_na_longtap_lookup</string>
<string name="key_na_perms_phonestate">key_na_perms_phonestate</string>
<string name="key_na_addBlankButton">key_na_addBlankButton</string>
<string name="key_na_newFeatureFilter">key_na_newFeatureFilter</string>
<string name="key_na_dupstatus_host">key_na_dupstatus_host</string>
<string name="key_na_dupstatus_guest">key_na_dupstatus_guest</string>
@ -176,6 +177,8 @@
<string name="default_relay_url">https://eehouse.org/xw4/relay.py</string>
<string name="default_mqtt_url">https://liquidsugar.net/xw4/api/v1</string>
<string name="faq_uri_fmt">https://eehouse.org/xw4/faq.html#%1$s</string>
<string-array name="board_sizes">
<item>15x15</item>
<item>13x13</item>

View file

@ -732,13 +732,13 @@
<string name="button_revert_all">Restore all</string>
<!-- Text of confirmation dialog for above -->
<string name="confirm_revert_colors">Are you sure you want to
restore all color settings to their original values?</string>
restore all color settings to their default values?</string>
<!-- Second menu item. Reverts only the colors to their
default/original values -->
<string name="button_revert_colors">Restore colors</string>
<!-- Text of confirmation dialog for above -->
<string name="confirm_revert_all">Are you sure you want to restore
all settings to their original values?</string>
all settings to their default values?</string>
<!--
############################################################
# :Screens:
@ -1622,6 +1622,15 @@
<!-- Message in progress alert shown while wordlist is loading -->
<string name="filter_progress_fmt">Processing %1$d words</string>
<!-- Text of alert shown when user first opens wordlist
browser. Shown until not-again checkbox checked. -->
<string name="new_feature_filter">This wordlist browser now has
dramatically improved filtering abilities. As an example, you can
show all words containing \"QU\" and ending in \"ING\".\n\nAccess
filtering by tapping the Expander button at the upper-right corner
of the window.\n\nRead more on the FAQ by tapping the button
below.</string>
<string name="board_menu_file_email">Email author</string>
<!-- -->
<string name="email_author_subject">Comment about CrossWords</string>
@ -2611,6 +2620,10 @@
language -->
<string name="no_tiles_exist">\"%1$s\" cannot be spelled with %2$s tiles.</string>
<string name="new_feature_title">New Feature Alert</string>
<string name="button_faq">Show FAQ</string>
<!-- MQTT stuff. May not see the light of day -->
<string name="invite_choice_mqtt">Internet/MQTT</string>
<string name="mqtt_invite_title">MQTT Invitation</string>