Comment obtenir la vue à partir de tiroir en-tête de mise en page avec la liaison de l'activité?

Donc c'est mon activity_main.xml:

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="MainActivity"
>
<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<!-- As the main content view, the view below consumes the entire
space available using match_parent in both dimensions. -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/ll_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/my_awesome_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/black"
android:fitsSystemWindows="true"
>
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:textColor="@android:color/white"
android:textSize="@dimen/abc_text_size_title_material_toolbar"
tools:text="@string/default_toolbar_title"/>
</android.support.v7.widget.Toolbar>
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_fuf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="20dp"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
android:src="@drawable/flamme"
app:fabSize="normal"
/>
</RelativeLayout>
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/black"
**app:headerLayout="@layout/drawer_header"**
app:itemTextColor="@color/drawer_item_color_selector"
app:menu="@menu/menu_drawer"/>
</android.support.v4.widget.DrawerLayout>
</layout>

et je suis en utilisant la liaison de l'activité donc je n'ai pas à utiliser le findViewById, et de le jeter etc.. comme ceci:

ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
Toolbar toolbar = binding.myAwesomeToolbar;
toolbarTitle = binding.toolbarTitle;
BalrogFontsHelper.SetKhandBoldToView(toolbarTitle);
setSupportActionBar(toolbar);
final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setHomeAsUpIndicator(R.drawable.ic_dehaze_white_24);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
actionBar.setDisplayShowTitleEnabled(false);
}
drawerLayout = binding.drawerLayout;
**tvLoggedUserEmail = (TextView) findViewById(R.id.tv_logged_user_email);**
BalrogFontsHelper.SetKhandBoldToView(tvLoggedUserEmail);

Comme vous pouvez le voir, je peux obtenir les points de vue qui sont directement dans le activity_main.xml mise en page par contraignant, mais quand l'idée que j'essaie de le faire n'est pas là, je peux pas voir la variable de l'objet de liaison.

drawer_header.xml:

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="96dp"
xmlns:tools="http://schemas.android.com/tools"
android:background="@android:color/black"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<TextView
android:id="@+id/tv_logged_user_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
tools:text="@string/login_placeholder_email"
android:textAllCaps="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textSize="20sp"/>
</RelativeLayout>

Comment pourrais-je obtenir ce tv_logged_user_email TextView dans une voie de liaison j'ai donc:

**tvLoggedUserEmail = binding.tvLoggedUserEmail;**
InformationsquelleAutor RogerParis | 2015-08-27