Add preliminary landscape layout, remove reset.
Change-Id: Ib55481157a572d29a6ca0c3ab4de10020898c74a
diff --git a/res/layout-land/music_main.xml b/res/layout-land/music_main.xml
new file mode 100644
index 0000000..5aa745a
--- /dev/null
+++ b/res/layout-land/music_main.xml
@@ -0,0 +1,241 @@
+<?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.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <TextView
+ android:id="@+id/noEffectsTextView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal"
+ android:layout_gravity="center"
+ android:gravity="center"
+ android:text="@string/no_effects"
+ 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/main_toggle_effects_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"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:gravity="center_vertical"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:id="@+id/eqLayout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:gravity="center_vertical"
+ android:paddingRight="?android:attr/scrollbarSize"
+ android:focusable="true"
+ android:background="@android:drawable/list_selector_background">
+
+ <RelativeLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="15dip"
+ android:layout_marginRight="6dip"
+ android:layout_marginTop="6dip"
+ android:layout_marginBottom="6dip"
+ android:layout_weight="1">
+ <TextView
+ android:id="@+id/eqPresetsTitleTextView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal"
+ android:text="@string/eq_title" />
+ <TextView
+ android:id="@+id/eqPresetsSummaryTextView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/eqPresetsTitleTextView"
+ android:layout_alignLeft="@+id/eqPresetsTitleTextView"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:maxLines="4" />
+ </RelativeLayout>
+ <ImageView
+ android:id="@+id/eqPresetsImageView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="4dip"
+ android:layout_gravity="center_vertical"
+ android:background="@drawable/btn_circle"
+ android:src="@drawable/ic_btn_round_more" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <include layout="@layout/music_eq" />
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:id="@+id/bBLayout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:gravity="center_vertical"
+ android:paddingRight="?android:attr/scrollbarSize"
+ android:layout_marginLeft="15dip"
+ android:layout_marginRight="6dip"
+ android:layout_marginTop="6dip"
+ android:layout_marginBottom="6dip"
+ android:orientation="vertical"
+ android:background="@android:drawable/list_selector_background">
+ <TextView
+ android:id="@+id/bBStrengthText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal"
+ android:text="@string/bass_boost_strength" />
+ <com.android.musicfx.seekbar.SeekBar
+ android:id="@+id/bBStrengthSeekBar"
+ android:layout_width="170dip"
+ android:layout_height="wrap_content"
+ android:paddingTop="2dip"
+ android:paddingLeft="20dip"
+ android:paddingRight="20dip" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/vILayout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:gravity="center_vertical"
+ android:paddingRight="?android:attr/scrollbarSize"
+ android:layout_marginLeft="15dip"
+ android:layout_marginRight="6dip"
+ android:layout_marginTop="6dip"
+ android:layout_marginBottom="6dip"
+ android:orientation="vertical"
+ android:background="@android:drawable/list_selector_background">
+ <TextView
+ android:id="@+id/vIStrengthText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal"
+ android:text="@string/virtualizer_strength" />
+ <com.android.musicfx.seekbar.SeekBar
+ android:id="@+id/vIStrengthSeekBar"
+ android:layout_width="170dip"
+ android:layout_height="wrap_content"
+ android:paddingTop="2dip"
+ android:paddingLeft="20dip"
+ android:paddingRight="20dip" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/eRLayout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:gravity="center_vertical"
+ android:paddingRight="?android:attr/scrollbarSize"
+ android:focusable="true"
+ android:background="@android:drawable/list_selector_background"
+ android:visibility="gone">
+ <RelativeLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="15dip"
+ android:layout_marginRight="6dip"
+ android:layout_marginTop="6dip"
+ android:layout_marginBottom="6dip"
+ android:layout_weight="1">
+ <TextView
+ android:id="@+id/eRPresetsTitleTextView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal"
+ android:text="@string/pr_title" />
+ <TextView
+ android:id="@+id/eRPresetsSummaryTextView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/eRPresetsTitleTextView"
+ android:layout_alignLeft="@+id/eRPresetsTitleTextView"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:maxLines="4"
+ android:text="@string/pr_summary" />
+ </RelativeLayout>
+ <ImageView
+ android:id="@+id/eRPresetsImageView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="4dip"
+ android:layout_gravity="center_vertical"
+ android:background="@drawable/btn_circle"
+ android:src="@drawable/ic_btn_round_more" />
+ </LinearLayout>
+
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+ </ScrollView>
+</LinearLayout>
diff --git a/res/layout/music_main.xml b/res/layout/music_main.xml
index 9cb2c32..8993309 100644
--- a/res/layout/music_main.xml
+++ b/res/layout/music_main.xml
@@ -224,36 +224,6 @@
android:src="@drawable/ic_btn_round_more" />
</LinearLayout>
- <LinearLayout
- android:id="@+id/resetDefaultsLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:gravity="center_vertical"
- android:paddingRight="?android:attr/scrollbarSize"
- android:layout_marginLeft="15dip"
- android:layout_marginRight="6dip"
- android:layout_marginTop="6dip"
- android:layout_marginBottom="6dip"
- android:orientation="vertical"
- android:focusable="true"
- android:background="@android:drawable/list_selector_background">
- <TextView
- android:id="@+id/resetDefaultsTitleTextView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:ellipsize="marquee"
- android:fadingEdge="horizontal"
- android:text="@string/reset_defaults_title" />
- <TextView
- android:id="@+id/resetDefaultsSummaryTextView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:maxLines="4"
- android:text="@string/reset_defaults_summary" />
- </LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
diff --git a/src/com/android/musicfx/ActivityMusic.java b/src/com/android/musicfx/ActivityMusic.java
index 47f10bc..b3c8e99 100644
--- a/src/com/android/musicfx/ActivityMusic.java
+++ b/src/com/android/musicfx/ActivityMusic.java
@@ -70,7 +70,6 @@
*/
static final int DIALOG_EQUALIZER = 0;
static final int DIALOG_PRESET_REVERB = 1;
- static final int DIALOG_RESET_DEFAULTS = 2;
/**
* Indicates if Virtualizer effect is supported.
@@ -429,15 +428,6 @@
});
}
- // init reset defaults
- final View view = findViewById(R.id.resetDefaultsLayout);
- view.setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(final View v) {
- showDialog(DIALOG_RESET_DEFAULTS);
- }
- });
} else {
viewGroup.setVisibility(View.GONE);
mainToggleView.setVisibility(View.GONE);
@@ -594,22 +584,6 @@
alertDialog = builder.create();
break;
}
- case DIALOG_RESET_DEFAULTS: {
- final AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle(R.string.reset_defaults_dialog_title);
- builder.setMessage(getString(R.string.reset_defaults_dialog_message));
- builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(final DialogInterface dialog, final int whichButton) {
- ControlPanelEffect.setEffectDefaults(mContext, mCallingPackageName,
- mAudioSession);
- updateUI();
- }
- });
- builder.setNegativeButton(android.R.string.cancel, null);
- alertDialog = builder.create();
- break;
- }
default:
Log.e(TAG, "onCreateDialog invalid Dialog id: " + id);
alertDialog = null;
@@ -651,9 +625,6 @@
listView.setSelection(mPRPreset);
break;
}
- case DIALOG_RESET_DEFAULTS: {
- break;
- }
default:
Log.e(TAG, "onPrepareDialog invalid Dialog id: " + id);
break;
diff --git a/src/com/android/musicfx/ControlPanelEffect.java b/src/com/android/musicfx/ControlPanelEffect.java
index d8729bd..15d0445 100644
--- a/src/com/android/musicfx/ControlPanelEffect.java
+++ b/src/com/android/musicfx/ControlPanelEffect.java
@@ -1259,50 +1259,6 @@
}
/**
- * Sets the defaults for all effects.
- *
- * @param context
- * @param packageName
- * @param audioSession
- * System wide unique audio session identifier.
- */
- public static void setEffectDefaults(final Context context, final String packageName,
- final int audioSession) {
- final SharedPreferences prefs = context.getSharedPreferences(packageName,
- Context.MODE_PRIVATE);
- final SharedPreferences.Editor editor = prefs.edit();
-
- setParameterBoolean(context, packageName, audioSession, Key.global_enabled,
- GLOBAL_ENABLED_DEFAULT);
- setParameterBoolean(context, packageName, audioSession, Key.virt_enabled,
- VIRTUALIZER_ENABLED_DEFAULT);
- setParameterInt(context, packageName, audioSession, Key.virt_strength,
- VIRTUALIZER_STRENGTH_DEFAULT);
- setParameterBoolean(context, packageName, audioSession, Key.bb_enabled,
- BASS_BOOST_ENABLED_DEFAULT);
- setParameterInt(context, packageName, audioSession, Key.bb_strength,
- BASS_BOOST_STRENGTH_DEFAULT);
- setParameterBoolean(context, packageName, audioSession, Key.eq_enabled,
- EQUALIZER_ENABLED_DEFAULT);
- // CI preset idx = numPresets
- final int numPresets = prefs.getInt(Key.eq_num_presets.toString(), EQUALIZER_NUMBER_PRESETS_DEFAULT);
- setParameterInt(context, packageName, audioSession, Key.eq_current_preset, numPresets);
- // Reset User EQ levels
- final int numBands = prefs.getInt(Key.eq_num_bands.toString(), EQUALIZER_NUMBER_BANDS_DEFAULT);
- final short[] eQPresetUserBandLevelDefault = Arrays.copyOf(
- EQUALIZER_PRESET_USER_BAND_LEVEL_DEFAULT, numBands);
- for (short band = 0; band < numBands; band++) {
- editor.putInt(Key.eq_preset_user_band_level.toString() + band,
- eQPresetUserBandLevelDefault[band]);
- }
- setParameterBoolean(context, packageName, numBands, Key.pr_enabled,
- PRESET_REVERB_ENABLED_DEFAULT);
- setParameterInt(context, packageName, numBands, Key.pr_current_preset,
- PRESET_REVERB_CURRENT_PRESET_DEFAULT);
- editor.commit();
- }
-
- /**
* Gets the virtualizer effect for the given audio session. If the effect on the session doesn't
* exist yet, create it and add to collection.
*