Add service setting
This commit is contained in:
parent
4b0a071a35
commit
b500c3f526
|
@ -1,6 +1,7 @@
|
|||
package org.schabi.newpipe.fragments;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.support.v4.app.Fragment;
|
||||
|
@ -75,7 +76,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
|
|||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_search:
|
||||
NavigationHelper.openSearchFragment(getFragmentManager(), 0, "");
|
||||
NavigationHelper.openSearchFragment(getFragmentManager(), Integer.parseInt(PreferenceManager.getDefaultSharedPreferences(getActivity()).getString("service", "0")), "");
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
|
|
|
@ -43,6 +43,17 @@
|
|||
<item>144p</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="service_list_description" translatable="false">
|
||||
<item>YouTube</item>
|
||||
<item>SoundCloud</item>
|
||||
</string-array>
|
||||
<string-array name="service_list_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
</string-array>
|
||||
<string name="service_key" translatable="false">service</string>
|
||||
<string name="default_service_value" translatable="false">0</string>
|
||||
|
||||
<string name="video_mp4_key" translatable="false">video_mp4</string>
|
||||
<string name="video_webm_key" translatable="false">video_webm</string>
|
||||
<string name="video_3gp_key" translatable="false">video_3gp</string>
|
||||
|
|
|
@ -81,6 +81,7 @@
|
|||
<string name="next_video_title">Next video</string>
|
||||
<string name="show_next_and_similar_title">Show next and similar videos</string>
|
||||
<string name="url_not_supported_toast">URL not supported</string>
|
||||
<string name="service_title">Service</string>
|
||||
<string name="search_language_title">Default content language</string>
|
||||
<string name="settings_category_player_title">Player</string>
|
||||
<string name="settings_category_player_behavior_title">Behavior</string>
|
||||
|
|
|
@ -3,6 +3,14 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:title="@string/content">
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="@string/default_service_value"
|
||||
android:entries="@array/service_list_description"
|
||||
android:entryValues="@array/service_list_values"
|
||||
android:key="@string/service_key"
|
||||
android:summary="%s"
|
||||
android:title="@string/service_title"/>
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="@string/default_language_value"
|
||||
android:entries="@array/language_names"
|
||||
|
|
Loading…
Reference in New Issue