Make replaygain-config a subitem

This commit is contained in:
Adrian Ulrich 2013-04-01 20:36:50 +02:00
parent 737e545ae4
commit 7b0fb5a07f
5 changed files with 71 additions and 7 deletions

View File

@ -140,6 +140,9 @@ THE SOFTWARE.
<activity
android:name="PreferencesActivity"
android:theme="@style/BackActionBar" />
<activity
android:name="PreferencesActivity$ReplayGainActivity"
android:theme="@style/BackActionBar" />
<activity android:name="PreferencesActivity$AudioActivity" />
<activity android:name="PreferencesActivity$PlaybackActivity" />
<activity android:name="PreferencesActivity$LibraryActivity" />

View File

@ -152,8 +152,9 @@ THE SOFTWARE.
<string name="headset_pause_summary">Pause when the headphones are unplugged.</string>
<string name="headset_play_title">Play When Plugged</string>
<string name="headset_play_summary">Play when the headphones are plugged in. (Only works when the service is running.)</string>
<string name="replaygain_title">Enable replay gain</string>
<string name="replaygain_summary">Read replay gain information from tags and decrease volume if needed</string>
<string name="replaygain">Replay Gain</string>
<string name="replaygain_title">Enable Replay Gain</string>
<string name="replaygain_summary">Configure handling of Replay Gain information</string>
<string name="notifications">Notifications</string>
<string name="notification_mode_title">Notification Mode</string>

View File

@ -48,9 +48,12 @@ THE SOFTWARE.
android:title="@string/headset_play_title"
android:summary="@string/headset_play_summary"
android:defaultValue="false" />
<CheckBoxPreference
android:key="enable_replaygain"
android:title="@string/replaygain_title"
android:summary="@string/replaygain_summary"
android:defaultValue="false" />
<PreferenceScreen
android:title="@string/replaygain"
android:summary="@string/replaygain_summary">
<intent
android:targetPackage="ch.blinkenlights.android.vanilla"
android:targetClass="ch.blinkenlights.android.vanilla.PreferencesActivity$ReplayGainActivity" />
</PreferenceScreen>
</PreferenceScreen>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright (C) 2012 Christopher Eby <kreed@kreed.org>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:persistent="true">
<CheckBoxPreference
android:key="enable_replaygain"
android:title="@string/replaygain_title"
android:summary="@string/replaygain_summary"
android:defaultValue="false" />
</PreferenceScreen>

View File

@ -89,6 +89,32 @@ public class PreferencesActivity extends PreferenceActivity {
}
}
public static class ReplayGainActivity extends PreferenceActivity {
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setTitle(R.string.replaygain);
addPreferencesFromResource(R.xml.preference_replaygain);
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
finish();
return true;
}
}
public static class ReplayGainFragment extends PreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preference_replaygain);
}
}
public static class PlaybackActivity extends PreferenceActivity {
@SuppressWarnings("deprecation")
@Override