am b199cff2: Add missing permission.
* commit 'b199cff238541bb8ccc38aa15fe70e2978095613':
Add missing permission.
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 613033a..29ad60b 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -34,7 +34,7 @@
<activity
android:name=".ActivityMusic"
android:theme="@android:style/Theme.Holo"
- android:label="@string/app_name">
+ android:label="@string/eq_dialog_title">
<intent-filter>
<action
android:name="android.media.action.DISPLAY_AUDIO_EFFECT_CONTROL_PANEL" />
diff --git a/res/layout-land/music_main.xml b/res/layout-land/music_main.xml
index fc3eacb..11fcf5e 100644
--- a/res/layout-land/music_main.xml
+++ b/res/layout-land/music_main.xml
@@ -33,28 +33,6 @@
android:layout_weight="1"
android:visibility="gone" />
- <RelativeLayout
- android:id="@+id/mainToggleEffectsLayout"
- android:layout_width="match_parent"
- android:layout_height="50dip"
- android:background="#999"
- android:gravity="center_vertical"
- android:paddingRight="4dip">
- <TextView
- android:id="@+id/mainToggleEffectsTitleTextView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="15dip"
- android:layout_alignParentLeft="true"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:text="@string/eq_dialog_title" />
- <Switch
- android:id="@+id/mainToggleEffectsCheckBox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true" />
- </RelativeLayout>
-
<FrameLayout
android:id="@+id/contentSoundEffects"
android:layout_width="match_parent"
diff --git a/res/layout/music_main.xml b/res/layout/music_main.xml
index 90c23ff..367d5a2 100644
--- a/res/layout/music_main.xml
+++ b/res/layout/music_main.xml
@@ -33,28 +33,6 @@
android:layout_weight="1"
android:visibility="gone" />
- <RelativeLayout
- android:id="@+id/mainToggleEffectsLayout"
- android:layout_width="match_parent"
- android:layout_height="50dip"
- android:background="#999"
- android:gravity="center_vertical"
- android:paddingRight="4dip">
- <TextView
- android:id="@+id/mainToggleEffectsTitleTextView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="15dip"
- android:layout_alignParentLeft="true"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:text="@string/eq_dialog_title" />
- <Switch
- android:id="@+id/mainToggleEffectsCheckBox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true" />
- </RelativeLayout>
-
<ScrollView
android:id="@+id/contentSoundEffects"
android:orientation="vertical"
@@ -94,7 +72,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:textAppearance="?android:attr/textAppearanceLarge"
+ android:textAppearance="?android:attr/textAppearanceMedium"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:text="@string/bass_boost_strength" />
@@ -125,7 +103,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:textAppearance="?android:attr/textAppearanceLarge"
+ android:textAppearance="?android:attr/textAppearanceMedium"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:text="@string/virtualizer_strength" />
diff --git a/res/values-be/strings.xml b/res/values-be/strings.xml
new file mode 100644
index 0000000..7293548
--- /dev/null
+++ b/res/values-be/strings.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2010-2011 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="app_name" msgid="5717136097222561957">"MusicFX"</string>
+ <string name="no_effects" msgid="2597309825423473135">"Эфекты недаступныя"</string>
+ <string name="main_toggle_effects_title" msgid="612896145300512593">"Гукавыя эфекты"</string>
+ <string name="eq_dialog_title" msgid="2020244436368289652">"Эквалайзер"</string>
+ <string name="headset_plug" msgid="1161319499289612110">"Падключыце навушнікі для гэтых эфектаў"</string>
+ <string name="bass_boost_strength" msgid="882301530007752270">"Bass Boost"</string>
+ <string name="virtualizer_strength" msgid="5035111173763913313">"3D-эфект"</string>
+ <string name="pr_title" msgid="873875523196045130">"Штучнае рэха:"</string>
+ <string name="pr_summary" msgid="7457279522425453515">"Дадатковыя эфекты штучнага рэха ў пакоі"</string>
+ <string name="pr_dialog_title" msgid="5858360745954538612">"Папярэдняя ўстаноўка штучнага рэха"</string>
+ <string name="setup" msgid="1103677904576339192">"Наладзiць"</string>
+ <string name="ci_extreme" msgid="8814436348926909207">"FX Booster"</string>
+ <string name="user" msgid="3949460956502898057">"Карыстальнік"</string>
+ <string name="picker_title" msgid="8464126693702817261">"Панэль кірав. музыч. эфектамі"</string>
+</resources>
diff --git a/res/values-et/strings.xml b/res/values-et/strings.xml
new file mode 100644
index 0000000..2beefc8
--- /dev/null
+++ b/res/values-et/strings.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2010-2011 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="app_name" msgid="5717136097222561957">"MusicFX"</string>
+ <string name="no_effects" msgid="2597309825423473135">"Efektid pole saadaval"</string>
+ <string name="main_toggle_effects_title" msgid="612896145300512593">"Heliefektid"</string>
+ <string name="eq_dialog_title" msgid="2020244436368289652">"Ekvalaiser"</string>
+ <string name="headset_plug" msgid="1161319499289612110">"Nende efektide jaoks ühendage kõrvaklapid"</string>
+ <string name="bass_boost_strength" msgid="882301530007752270">"Bassivõimendi"</string>
+ <string name="virtualizer_strength" msgid="5035111173763913313">"3D-efekt"</string>
+ <string name="pr_title" msgid="873875523196045130">"Järelkõla:"</string>
+ <string name="pr_summary" msgid="7457279522425453515">"Täiendavad ruumi järelkõla efektid"</string>
+ <string name="pr_dialog_title" msgid="5858360745954538612">"Järelkõla eelseade"</string>
+ <string name="setup" msgid="1103677904576339192">"Seadista"</string>
+ <string name="ci_extreme" msgid="8814436348926909207">"FX Booster"</string>
+ <string name="user" msgid="3949460956502898057">"Kasutaja"</string>
+ <string name="picker_title" msgid="8464126693702817261">"Muusikaefektide juhtpaneel"</string>
+</resources>
diff --git a/res/values-hi/strings.xml b/res/values-hi/strings.xml
index cef9aad..3944b17 100644
--- a/res/values-hi/strings.xml
+++ b/res/values-hi/strings.xml
@@ -20,7 +20,7 @@
<string name="no_effects" msgid="2597309825423473135">"प्रभाव उपलब्ध नहीं"</string>
<string name="main_toggle_effects_title" msgid="612896145300512593">"ऑडियो प्रभाव"</string>
<string name="eq_dialog_title" msgid="2020244436368289652">"इक्वलाइज़र"</string>
- <string name="headset_plug" msgid="1161319499289612110">"कृपया इन प्रभावों के लिए हेडफ़ोन प्लग करें"</string>
+ <string name="headset_plug" msgid="1161319499289612110">"कृपया इन प्रभावों के लिए हेडफ़ोन प्लग करें"</string>
<string name="bass_boost_strength" msgid="882301530007752270">"बेस बढ़ाएं"</string>
<string name="virtualizer_strength" msgid="5035111173763913313">"3D प्रभाव"</string>
<string name="pr_title" msgid="873875523196045130">"गूंज:"</string>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 11789cb..4e640ba 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -17,4 +17,5 @@
<resources>
<dimen name="eq_slider_margin">5dip</dimen>
<dimen name="eq_slider_height">180dip</dimen>
+ <dimen name="action_bar_switch_padding">16dip</dimen>
</resources>
diff --git a/src/com/android/musicfx/ActivityMusic.java b/src/com/android/musicfx/ActivityMusic.java
index 8e9dab2..b130b0b 100644
--- a/src/com/android/musicfx/ActivityMusic.java
+++ b/src/com/android/musicfx/ActivityMusic.java
@@ -20,6 +20,7 @@
import com.android.musicfx.seekbar.SeekBar;
import com.android.musicfx.seekbar.SeekBar.OnSeekBarChangeListener;
+import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
@@ -52,6 +53,7 @@
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.Spinner;
+import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
@@ -100,6 +102,7 @@
private int mPRPresetPrevious;
private boolean mIsHeadsetOn = false;
+ private CompoundButton mToggleSwitch;
private StringBuilder mFormatBuilder = new StringBuilder();
private Formatter mFormatter = new Formatter(mFormatBuilder, Locale.getDefault());
@@ -256,7 +259,6 @@
setContentView(R.layout.music_main);
final ViewGroup viewGroup = (ViewGroup) findViewById(R.id.contentSoundEffects);
- final View mainToggleView = findViewById(R.id.mainToggleEffectsLayout);
// Fill array with presets from AudioEffects call.
// allocate a space for 2 extra strings (CI Extreme & User)
@@ -277,8 +279,8 @@
// Set the listener for the main enhancements toggle button.
// Depending on the state enable the supported effects if they were
// checked in the setup tab.
- final CompoundButton toggleEffects = (CompoundButton) findViewById(R.id.mainToggleEffectsCheckBox);
- toggleEffects.setOnCheckedChangeListener(new OnCheckedChangeListener() {
+ mToggleSwitch = new Switch(this);
+ mToggleSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(final CompoundButton buttonView,
final boolean isChecked) {
@@ -294,8 +296,6 @@
}
});
- mainToggleView.setVisibility(View.VISIBLE);
-
// Initialize the Virtualizer elements.
// Set the SeekBar listener.
if (mVirtualizerSupported) {
@@ -424,12 +424,18 @@
} else {
viewGroup.setVisibility(View.GONE);
- mainToggleView.setVisibility(View.GONE);
((TextView) findViewById(R.id.noEffectsTextView)).setVisibility(View.VISIBLE);
}
- // TODO, actually use the action bar
- getActionBar().hide();
+ ActionBar ab = getActionBar();
+ final int padding = getResources().getDimensionPixelSize(
+ R.dimen.action_bar_switch_padding);
+ mToggleSwitch.setPadding(0,0, padding, 0);
+ ab.setCustomView(mToggleSwitch, new ActionBar.LayoutParams(
+ ActionBar.LayoutParams.WRAP_CONTENT,
+ ActionBar.LayoutParams.WRAP_CONTENT,
+ Gravity.CENTER_VERTICAL | Gravity.RIGHT));
+ ab.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_CUSTOM);
}
/*
@@ -543,7 +549,7 @@
private void updateUI() {
final boolean isEnabled = ControlPanelEffect.getParameterBoolean(mContext,
mCallingPackageName, mAudioSession, ControlPanelEffect.Key.global_enabled);
- ((CompoundButton) findViewById(R.id.mainToggleEffectsCheckBox)).setChecked(isEnabled);
+ mToggleSwitch.setChecked(isEnabled);
setEnabledAllChildren((ViewGroup) findViewById(R.id.contentSoundEffects), isEnabled);
updateUIHeadset();
@@ -574,7 +580,7 @@
* control/events.
*/
private void updateUIHeadset() {
- if (((CompoundButton) findViewById(R.id.mainToggleEffectsCheckBox)).isChecked()) {
+ if (mToggleSwitch.isChecked()) {
((TextView) findViewById(R.id.vIStrengthText)).setEnabled(mIsHeadsetOn);
((SeekBar) findViewById(R.id.vIStrengthSeekBar)).setEnabled(mIsHeadsetOn);
findViewById(R.id.vILayout).setEnabled(!mIsHeadsetOn);
@@ -683,6 +689,7 @@
equalizerBandUpdate(band, bandLevels[band]);
}
equalizerSetPreset(mEQPresetUserPos);
+ ((Spinner)findViewById(R.id.eqSpinner)).setSelection(mEQPresetUserPos);
}
/*