mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-17 05:49:58 +00:00
Begin work on new preferences UI and massive code cleanup of settings-related activities
This commit is contained in:
@@ -11,53 +11,12 @@
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/advancedSettingsText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:layout_alignParentTop="true"
|
||||
android:paddingTop="0dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="@string/button_advanced_settings" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/decoderConfigGroup"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/advancedSettingsText"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/softwareDec"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/radio_forceSoftware" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/autoDec"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/radio_autoSelect" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/hardwareDec"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/radio_forceHardware" />
|
||||
</RadioGroup>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bitrateLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@+id/decoderConfigGroup"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginTop="10dp" />
|
||||
|
||||
@@ -66,7 +25,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_below="@+id/decoderConfigGroup"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_toLeftOf="@+id/bitrateLabel" />
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -1,99 +1,12 @@
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="10dp"
|
||||
tools:context=".Connection" >
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/streamSettingsText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:layout_alignParentTop="true"
|
||||
android:paddingTop="0dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="@string/title_streaming_settings" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/streamConfigGroup"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/streamSettingsText"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="vertical" >
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:id="@+id/stream_settings"
|
||||
tools:context=".StreamSettings">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/config720p30Selected"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/radio_720p30" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/config720p60Selected"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
android:text="@string/radio_720p60" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/config1080p30Selected"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
android:text="@string/radio_1080p30" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/config1080p60Selected"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
android:text="@string/radio_1080p60" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<Button
|
||||
android:id="@+id/advancedSettingsButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/disableToasts"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="@string/button_advanced_settings" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/stretchToFill"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/streamConfigGroup"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="@string/check_stretchToFill" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/enableSops"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/stretchToFill"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="@string/check_enableSops" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/disableToasts"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/enableSops"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="@string/check_disableToasts" />
|
||||
</RelativeLayout>
|
||||
|
||||
</ScrollView>
|
||||
</RelativeLayout>
|
||||
26
app/src/main/res/values/arrays.xml
Normal file
26
app/src/main/res/values/arrays.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string-array name="resolution_names">
|
||||
<item>720p 30 FPS</item>
|
||||
<item>720p 60 FPS</item>
|
||||
<item>1080p 30 FPS</item>
|
||||
<item>1080p 60 FPS</item>
|
||||
</string-array>
|
||||
<string-array name="resolution_values">
|
||||
<item>720p30</item>
|
||||
<item>720p60</item>
|
||||
<item>1080p30</item>
|
||||
<item>1080p60</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="decoder_names">
|
||||
<item>Force Software Decoding</item>
|
||||
<item>Auto-select Decoder</item>
|
||||
<item>Force Hardware Decoding</item>
|
||||
</string-array>
|
||||
<string-array name="decoder_values">
|
||||
<item>software</item>
|
||||
<item>auto</item>
|
||||
<item>hardware</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
@@ -11,21 +11,21 @@
|
||||
|
||||
<!-- Add computer manually activity -->
|
||||
<string name="button_add_pc">Manually Add PC</string>
|
||||
|
||||
<!-- Stream settings activity -->
|
||||
<string name="title_streaming_settings">Streaming Settings</string>
|
||||
<string name="button_advanced_settings">Advanced Settings</string>
|
||||
<string name="radio_720p30">720p 30 FPS (Only recommended for poor devices or networks)</string>
|
||||
<string name="radio_720p60">720p 60 FPS (Recommended for most devices and networks)</string>
|
||||
<string name="radio_1080p30">1080p 30 FPS (Recommended for most devices if 1080p streaming is desired)</string>
|
||||
<string name="radio_1080p60">1080p 60 FPS (Requires extremely fast device and network)</string>
|
||||
<string name="check_stretchToFill">Stretch video to fill screen</string>
|
||||
<string name="check_enableSops">Allow GFE to modify game settings for optimal streaming</string>
|
||||
<string name="check_disableToasts">Disable on-screen connection warning messages"</string>
|
||||
|
||||
<!-- Advanced settings activity -->
|
||||
<string name="radio_forceSoftware">Force Software Decoding</string>
|
||||
<string name="radio_autoSelect">Auto-select Decoder (Recommended)</string>
|
||||
<string name="radio_forceHardware">Force Hardware Decoding</string>
|
||||
|
||||
|
||||
<!-- Preferences -->
|
||||
<string name="category_basic_settings">Basic Settings</string>
|
||||
<string name="title_resolution_list">Select resolution and FPS target</string>
|
||||
<string name="summary_resolution_list">Setting values too high for your device may cause lag or crashing</string>
|
||||
<string name="title_checkbox_stretch_video">Stretch video to full-screen</string>
|
||||
|
||||
<string name="category_host_settings">Host Settings</string>
|
||||
<string name="title_checkbox_enable_sops">Optimize game settings</string>
|
||||
<string name="summary_checkbox_enable_sops">Allow GFE to modify game settings for optimal streaming</string>
|
||||
<string name="title_checkbox_host_audio">Play audio on PC</string>
|
||||
<string name="summary_checkbox_host_audio">Play audio from the computer instead of the device</string>
|
||||
|
||||
<string name="category_advanced_settings">Advanced Settings</string>
|
||||
<string name="title_decoder_list">Change decoder</string>
|
||||
<string name="title_checkbox_disable_warnings">Disable warning messages</string>
|
||||
<string name="summary_checkbox_disable_warnings">Disable on-screen connection warning messages while streaming</string>
|
||||
</resources>
|
||||
|
||||
43
app/src/main/res/xml/preferences.xml
Normal file
43
app/src/main/res/xml/preferences.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<PreferenceCategory android:title="@string/category_basic_settings">
|
||||
<ListPreference
|
||||
android:key="list_resolution_fps"
|
||||
android:title="@string/title_resolution_list"
|
||||
android:summary="@string/summary_resolution_list"
|
||||
android:entries="@array/resolution_names"
|
||||
android:entryValues="@array/resolution_values"
|
||||
android:defaultValue="720p60" />
|
||||
<CheckBoxPreference
|
||||
android:key="checkbox_stretch_video"
|
||||
android:title="@string/title_checkbox_stretch_video"
|
||||
android:defaultValue="false" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/category_host_settings">
|
||||
<CheckBoxPreference
|
||||
android:key="checkbox_enable_sops"
|
||||
android:title="@string/title_checkbox_enable_sops"
|
||||
android:summary="@string/summary_checkbox_enable_sops"
|
||||
android:defaultValue="true" />
|
||||
<CheckBoxPreference
|
||||
android:key="checkbox_host_audio"
|
||||
android:title="@string/title_checkbox_host_audio"
|
||||
android:summary="@string/summary_checkbox_host_audio"
|
||||
android:defaultValue="false" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/category_advanced_settings">
|
||||
<ListPreference
|
||||
android:key="list_decoders"
|
||||
android:title="@string/title_decoder_list"
|
||||
android:entries="@array/decoder_names"
|
||||
android:entryValues="@array/decoder_values"
|
||||
android:defaultValue="auto" />
|
||||
<CheckBoxPreference
|
||||
android:key="checkbox_disable_warnings"
|
||||
android:title="@string/title_checkbox_disable_warnings"
|
||||
android:summary="@string/summary_checkbox_disable_warnings"
|
||||
android:defaultValue="false" />
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
Reference in New Issue
Block a user