Skip to content

AccountHeaderView

TR4Android edited this page Aug 19, 2015 · 3 revisions

This wiki hightlights the setup needed for using the AccountHeaderView and the customization options available. It is designed as a step by step guide with simple instructions. Just follow along to achieve awesome results.

1. Create the header layout

Create a new layout file called account_header.xml (if you haven't already) and put the following layout in it:

<?xml version="1.0" encoding="utf-8"?>
<com.tr4android.support.extension.widget.AccountHeaderView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/account_header"
    android:background="@drawable/account_header_cover_background"
    android:layout_width="match_parent"
    android:layout_height="@dimen/account_header_height"
    app:accountHeaderManageEnabled="true"
    app:accountHeaderAddEnabled="true" />

At this point you have the following two options:

  • app:accountHeaderManageEnabled: Whether or not to show the "Manage Accounts" item in the dropdown account list. Defaults to true.
  • app:accountHeaderAddEnabled: Whether or not to show the "Add Account" item in the dropdown account list. Defaults to true.

2. Setup your activity layout with NavigationView

To be continued ...

Clone this wiki locally