NavigationDrawer blocks other button on the activity



I'm working on the UI of my app and I'm facing a problem when I implement the Navigation Drawer. As you can see here, I have some buttons to manage my Media Player, these are not responding to my clicks when I implement the Navigation Drawer (working fine without Navigation Drawer).


I think the problem is coming from my XML file because there are no changing when I delete the implementation in Java.


Here are my XML sheets :


main_activity.xml



<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
xmlns:tools="http://ift.tt/LrGmb4"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MyActivity">

<fragment
android:id="@+id/fragments"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.example.ilan.myapplication.fragments.FragmentHome" >
</fragment>


<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Buffering"
android:id="@+id/tV_Buffering"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true" />

<include
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_weight="1"
layout="@layout/player_controls"
android:layout_alignParentBottom="true"/>

<include
layout="@layout/navigation_drawer_main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</RelativeLayout>


Note that I put the Navigation Drawer in the end to have it to cover the all activity.


navigation_drawer_main_layout.xml



<?xml version="1.0" encoding="utf-8"?>

<android.support.v4.widget.DrawerLayout
xmlns:android="http://ift.tt/nIICcg"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">

<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<ListView android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#FFFFFF"/>
</android.support.v4.widget.DrawerLayout>


player_controls.xml



<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/blue">

<Button
android:layout_width="100dp"
android:layout_height="100dp"
android:id="@+id/button_play_pause"
android:layout_toStartOf="@+id/tV_Buffering"
android:background="@drawable/bouton_play"
android:layout_centerInParent="true"
/>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Stop"
android:id="@+id/button_stop"
android:layout_toRightOf="@id/button_play_pause"
android:layout_centerInParent="true"
android:layout_marginLeft="20dp"/>
</RelativeLayout>


Well, if anyone has any idea from where this come from it would be awesome, thanks !


No comments:

Post a Comment