Commit cda86159 authored by Adrien Maglo's avatar Adrien Maglo
Browse files

Equalizer fragment: add a layout for landscape mode

parent d368611a
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ToggleButton
android:id="@+id/equalizer_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Spinner
android:id="@+id/equalizer_presets"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<SeekBar
android:id="@+id/equalizer_preamp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:maxHeight="4dip"
android:minHeight="4dip"
android:progressDrawable="@drawable/po_seekbar"
android:thumb="@drawable/seekbar_thumb" />
</LinearLayout>
<HorizontalScrollView
android:id="@+id/equalizer_scroll"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:fillViewport="true"
android:fadeScrollbars="false" >
<LinearLayout
android:id="@+id/equalizer_bands"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:orientation="horizontal" />
</HorizontalScrollView>
</LinearLayout>
\ No newline at end of file
......@@ -31,15 +31,17 @@
<HorizontalScrollView
android:id="@+id/equalizer_scroll"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:fillViewport="true"
android:fadeScrollbars="false" >
<LinearLayout
android:id="@+id/equalizer_bands"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:orientation="horizontal" />
</HorizontalScrollView>
......
......@@ -29,7 +29,9 @@ import org.videolan.vlc.widget.EqualizerBar;
import com.actionbarsherlock.app.SherlockFragment;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
......@@ -71,13 +73,30 @@ public class EqualizerFragment extends SherlockFragment {
super.onCreateView(inflater, container, savedInstanceState);
View v = inflater.inflate(R.layout.equalizer, container, false);
saveViewChildren(v);
return v;
}
private void saveViewChildren(View v) {
button = (ToggleButton) v.findViewById(R.id.equalizer_button);
equalizer_presets = (Spinner) v.findViewById(R.id.equalizer_presets);
preamp = (SeekBar) v.findViewById(R.id.equalizer_preamp);
bands_layout = (LinearLayout) v.findViewById(R.id.equalizer_bands);
}
return v;
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflater.inflate(R.layout.equalizer, null);
ViewGroup rootView = (ViewGroup) getView();
rootView.removeAllViews();
rootView.addView(v);
saveViewChildren(v);
onResume();
}
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment