Что идентифицирует фрагмент ящика в макете ящика? - PullRequest
0 голосов
/ 09 ноября 2018

Предположим, у нас есть этот XML-файл:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".DeviceControlActivity">

<!-- As the main content view, the view below consumes the entire
     space available using match_parent in both dimensions. -->
<FrameLayout
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

<!-- The drawer is given a fixed width in dp and extends the full height of
     the container. -->
<fragment
    android:id="@+id/navigation_drawer"
    android:name="com.anis.windowscontrollerclient.NavigationDrawerFragment"
    android:layout_width="@dimen/navigation_drawer_width"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    tools:layout="@layout/drawer_device_control" />
</android.support.v4.widget.DrawerLayout>

Что определяет то, что представляет собой фрагмент ящика?Более конкретно, когда вы нажимаете кнопку «Ящик» на панели действий, как он может определить, с каким «View Id» он будет вызывать openDrawer(layouId)?

...