Commit 74fcb628 authored by Geoffrey Métais's avatar Geoffrey Métais

Fix menudrawer being removed from view hierarchy

parent efe3a4bb
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/audio_tips"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent_white"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/audio_tips"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent_white"
......
......@@ -72,11 +72,11 @@ import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.DrawerLayout.LayoutParams;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.text.InputType;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
......@@ -89,9 +89,7 @@ import android.widget.AdapterView.OnItemClickListener;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.view.KeyEvent;
public class MainActivity extends ActionBarActivity {
public final static String TAG = "VLC/MainActivity";
......@@ -990,14 +988,6 @@ public class MainActivity extends ActionBarActivity {
mRootContainer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
removeTipViewIfDisplayed();
mAudioPlayer.showAudioPlayerTips();
/*
* TODO proper resolution of this bug
* Drawer listview disappears when audio player is displayed
* Here we restore it, this is just a workaround...
*/
if (findViewById(R.id.sidelist) == null){
mRootContainer.addView(mListView);
}
}
@Override
......@@ -1053,7 +1043,11 @@ public class MainActivity extends ActionBarActivity {
* Remove the current tip view if there is one displayed.
*/
public void removeTipViewIfDisplayed() {
if (mRootContainer.getChildCount() > 1)
mRootContainer.removeViewAt(1);
if (mRootContainer.getChildCount() > 2){
for (int i = 0 ; i< mRootContainer.getChildCount() ; ++i){
if (mRootContainer.getChildAt(i).getId() == R.id.audio_tips)
mRootContainer.removeViewAt(i);
}
}
}
}
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