add help fragment

This commit is contained in:
Adrian Ulrich 2017-08-05 13:02:56 +02:00
parent 34ec873cf7
commit 34ad6a24b4
3 changed files with 19 additions and 0 deletions

View File

@ -254,6 +254,7 @@ THE SOFTWARE.
<string name="stock_broadcast_title">Emulate stock broadcasts</string>
<string name="stock_broadcast_summary">Send broadcasts emulating those sent by the stock music player to work with 3rd party lockscreen controls, widgets, etc.</string>
<string name="help">Help</string>
<string name="about">About</string>
<string name="tabs">Tab order</string>

View File

@ -48,6 +48,9 @@ THE SOFTWARE.
<header
android:fragment="ch.blinkenlights.android.vanilla.PreferencesTheme"
android:title="@string/theme" />
<header
android:fragment="ch.blinkenlights.android.vanilla.PreferencesActivity$HelpFragment"
android:title="@string/help" />
<header
android:fragment="ch.blinkenlights.android.vanilla.PreferencesActivity$AboutFragment"
android:title="@string/about" />

View File

@ -239,6 +239,21 @@ public class PreferencesActivity extends PreferenceActivity
}
}
public static class HelpFragment extends PreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
Activity activity = getActivity();
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/vanilla-music/vanilla-music.github.io/wiki"));
if (intent != null) {
startActivity(intent);
}
activity.finish();
}
}
public static class AboutFragment extends WebViewFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)