Skip to content

Instantly share code, notes, and snippets.

@hlnstepanova
Created December 14, 2020 12:40
Show Gist options
  • Save hlnstepanova/fb57fad2bb22d5128a25308405d19448 to your computer and use it in GitHub Desktop.
Save hlnstepanova/fb57fad2bb22d5128a25308405d19448 to your computer and use it in GitHub Desktop.
nav_header.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">
<data>
<import type="android.view.View"/>
<variable
name="viewModel"
type="de.comp.proj.shared.models.LoginModel"/>
</data>
<RelativeLayout
android:id="@+id/navHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_margin"
android:orientation="vertical"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<TextView
android:id="@+id/tvUsername"
android:padding="@dimen/default_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="@{viewModel.logged.ld?View.VISIBLE:View.GONE}"
android:text="@{viewModel.username.ld}"
android:textColor="@color/colorAccent"/>
<View
android:id="@+id/divider"
android:layout_below="@id/tvUsername"
android:layout_width="match_parent"
android:layout_height="@dimen/divider_height"
android:visibility="@{viewModel.logged.ld?View.VISIBLE:View.GONE}"
android:layout_marginVertical="@dimen/tiny_margin"
android:background="@drawable/divider_view" />
</RelativeLayout>
</layout>
comp.proj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment