add a show-faq menu

This commit is contained in:
Eric House 2020-08-05 13:57:43 -07:00
parent 92c1180411
commit 87337ba789
3 changed files with 11 additions and 4 deletions

View file

@ -319,10 +319,10 @@ public class DelegateBase implements DlgClickNotify,
}
}
private void showFaq( String category, String entry )
void showFaq( String[] params )
{
Context context = getActivity();
String uri = getString( R.string.faq_uri_fmt, category, entry );
String uri = getString( R.string.faq_uri_fmt, params[0], params[1] );
NetUtils.launchWebBrowserWith( context, uri );
}
@ -765,7 +765,7 @@ public class DelegateBase implements DlgClickNotify,
NetUtils.launchWebBrowserWith( m_activity, R.string.nbs_ban_url );
break;
case SHOW_FAQ:
showFaq( (String)params[0], (String)params[1] );
showFaq( (String[])params[0] );
break;
default:
Log.d( TAG, "onPosButton(): unhandled action %s", action.toString() );

View file

@ -60,6 +60,7 @@ public class DictBrowseDelegate extends DelegateBase
private static final String TAG = DictBrowseDelegate.class.getSimpleName();
private static final String DELIM = ".";
private static final boolean SHOW_NUM = false;
private static final String[] FAQ_PARAMS = {"filters", "intro"};
private static final String DICT_NAME = "DICT_NAME";
private static final String DICT_LOC = "DICT_LOC";
@ -362,6 +363,9 @@ public class DictBrowseDelegate extends DelegateBase
case R.id.dicts_showtiles:
showTiles();
break;
case R.id.dicts_showfaq:
showFaq( FAQ_PARAMS );
break;
default:
handled = false;
}
@ -703,7 +707,7 @@ public class DictBrowseDelegate extends DelegateBase
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")
.setParams( (Object)FAQ_PARAMS )
.setTitle(R.string.new_feature_title)
.show();
}

View file

@ -5,4 +5,7 @@
<item android:id="@+id/dicts_showtiles"
android:title="@string/show_tiles_menu"
/>
<item android:id="@+id/dicts_showfaq"
android:title="@string/button_faq"
/>
</menu>