В моем приложении я хочу, чтобы при затемнении экрана добавлялся слой поверх всего, поэтому, когда пользователи нажимают на экран, затемнение исчезает, и тогда он может использовать приложение. Если я не сделаю этого, когда экран затемнен и пользователь нажмет на экран, он активирует что-то в приложении.
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<!-- The main content view -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/radio_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</FrameLayout>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</FrameLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/disc"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:gravity="center"
android:visibility="gone"
android:orientation="vertical" />
<!-- The navigation drawer -->
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#ffffff"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="10dp" />
this is my layout. When the screen dims i make the disc visible and when the user touches something on screen I make it View.gone. The problem is that the click on the disc is also activating something on my content frame fragment.
Есть ли способ сделать это сейчас? Я хочу, чтобы щелчок активировал только диск onclickhandler, а не что-то еще. Или есть другой способ сделать это?