Commit 32fde8e6 authored by Adrien Maglo's avatar Adrien Maglo

Audio player: hide the action bar when the player is fully shown

parent 61390d38
......@@ -11,6 +11,11 @@
android:layout_height="fill_parent"
android:orientation="vertical" >
<View
android:layout_width="fill_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/actionbar_background" />
<FrameLayout
android:id="@+id/fragment_placeholder"
android:layout_width="fill_parent"
......
......@@ -5,6 +5,7 @@
android:divider="?attr/background_menu_divider"
android:dividerHeight="0.2dp"
android:layout_width="208dp"
android:paddingTop="?attr/actionBarSize"
android:cacheColorHint="#0000"
android:fastScrollEnabled="true"
android:background="?attr/background_menu">
......
......@@ -3,6 +3,7 @@
<style name="Theme.VLC" parent="Theme.Sherlock.Light">
<item name="android:actionBarStyle">@style/ActionBar</item>
<item name="actionBarStyle">@style/ActionBar</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:listViewStyle">@style/Theme.VLC.List</item>
<item name="android:gridViewStyle">@style/Theme.VLC.List</item>
<item name="android:expandableListViewStyle">@style/Theme.VLC.List</item>
......
......@@ -11,6 +11,8 @@
<style name="Theme.VLC" parent="Theme.Sherlock.Light">
<item name="actionBarStyle">@style/ActionBar</item>
<item name="android:actionBarStyle">@style/ActionBar</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
<item name="android:listViewStyle">@style/Theme.VLC.List</item>
<item name="android:gridViewStyle">@style/Theme.VLC.List</item>
<item name="android:expandableListViewStyle">@style/Theme.VLC.List</item>
......
......@@ -180,12 +180,11 @@ public class MainActivity extends SherlockFragmentActivity {
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
// Set up the sliding menu
setContentView(R.layout.sliding_menu);
mMenu = (SlidingMenu) findViewById(R.id.sliding_menu);
mMenu = (SlidingMenu) LayoutInflater.from(this).inflate(R.layout.sliding_menu, null);
changeMenuOffset();
View v_main = LayoutInflater.from(this).inflate(R.layout.main, null);
mMenu.setContent(v_main);
setContentView(v_main);
mSlidingPane = (SlidingPaneLayout) v_main.findViewById(R.id.pane);
mSlidingPane.setPanelSlideListener(mPanelSlideListener);
......@@ -196,6 +195,7 @@ public class MainActivity extends SherlockFragmentActivity {
mSidebarAdapter = new SidebarAdapter();
listView.setAdapter(mSidebarAdapter);
mMenu.setMenu(sidebar);
mMenu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT, true);
/* Initialize UI variables */
mInfoLayout = v_main.findViewById(R.id.info_layout);
......@@ -864,7 +864,12 @@ public class MainActivity extends SherlockFragmentActivity {
= new SlidingPaneLayout.PanelSlideListener() {
@Override
public void onPanelSlide(float slideOffset) {}
public void onPanelSlide(float slideOffset) {
if (slideOffset <= 0.1)
getSupportActionBar().hide();
else
getSupportActionBar().show();
}
@Override
public void onPanelOpened() {
......
......@@ -882,13 +882,13 @@ public class SlidingPaneLayout extends ViewGroup {
}
}
}
else if (mPanelSlideListener != null)
mPanelSlideListener.onPanelSlide(mSlideOffset);
}
@Override
public void onViewPositionChanged(View changedView, int left, int top, int dx, int dy) {
onPanelDragged(top);
if (mPanelSlideListener != null)
mPanelSlideListener.onPanelSlide(mSlideOffset);
invalidate();
}
......
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