Skip to content

Instantly share code, notes, and snippets.

@quangson91
Created January 20, 2018 09:39
Show Gist options
  • Select an option

  • Save quangson91/6fae50f5540f8624e71c9eb2f397dfe3 to your computer and use it in GitHub Desktop.

Select an option

Save quangson91/6fae50f5540f8624e71c9eb2f397dfe3 to your computer and use it in GitHub Desktop.

Revisions

  1. quangson91 created this gist Jan 20, 2018.
    150 changes: 150 additions & 0 deletions demo-layout-todo.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,150 @@
    <?xml version="1.0" encoding="utf-8"?>
    <android.support.v4.widget.DrawerLayout 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"
    android:id="@+id/drawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <FrameLayout
    android:id="@+id/content_frame"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:ignore="RtlHardcoded">


    <FrameLayout
    android:id="@+id/header"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    app:layout_constraintBottom_toTopOf="@+id/rvTodo"
    app:layout_constraintTop_toTopOf="parent">

    <FrameLayout
    android:id="@+id/sloganFrame"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.AppCompatImageView
    android:id="@+id/headerImage"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/md_green_500"
    android:scaleType="centerCrop" />

    <android.support.v4.view.ViewPager
    android:id="@+id/vpSlogans"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
    </FrameLayout>

    <android.support.v7.widget.AppCompatImageView
    android:id="@+id/btnShowSettingContainer"
    android:layout_width="36dp"
    android:layout_height="36dp"
    android:padding="5dp"
    android:scaleType="center"
    app:srcCompat="@drawable/ic_menu_black_24dp"
    app:tint="@android:color/white" />

    </FrameLayout>

    <TextView
    android:id="@+id/tvDate"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:paddingLeft="8dp"
    android:paddingRight="8dp"
    android:textAllCaps="true"
    android:textColor="@color/md_white_1000"
    android:textSize="12sp"
    android:textStyle="bold"
    app:layout_constraintEnd_toEndOf="parent"
    tools:text="MON, OCT 10, 2017" />


    <android.support.v7.widget.RecyclerView
    android:id="@+id/rvTodo"
    android:fillViewport="true"
    android:layout_width="0dp"
    android:layout_height="341dp"
    android:background="@color/md_blue_500"
    android:minWidth="1000dp"
    app:layout_constraintBottom_toTopOf="@+id/summaryContainer"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/header"
    tools:listitem="@layout/item_todo" />

    <RelativeLayout
    android:id="@+id/emptyView"
    android:layout_width="0dp"
    android:layout_height="0dp"
    android:background="@color/md_grey_100"
    android:orientation="vertical"
    android:visibility="invisible"
    app:layout_constraintBottom_toBottomOf="@+id/rvTodo"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="@+id/rvTodo"
    tools:visibility="visible">

    <TextView
    android:id="@+id/tvEmpty"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="30dp"
    android:fontFamily="@font/roboto"
    android:gravity="center"
    android:text="@string/msg_empty_doing"
    android:textSize="18sp"
    android:textStyle="bold" />

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/tvEmpty"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="5dp"
    android:text="@string/msg_hint_touch_rocket"
    android:textSize="16sp"
    android:textStyle="italic" />

    <android.support.v7.widget.AppCompatImageView
    android:id="@+id/btnPullMore"
    android:layout_width="@dimen/rocket_size"
    android:layout_height="@dimen/rocket_size"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="15dp"
    app:srcCompat="@drawable/ic_rocket" />

    </RelativeLayout>

    <include
    android:id="@+id/summaryContainer"
    layout="@layout/home_summary"
    android:layout_width="0dp"
    android:layout_height="100dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent" />

    </android.support.constraint.ConstraintLayout>
    </FrameLayout>
    <!-- The navigation drawer -->
    <android.support.design.widget.NavigationView
    android:id="@+id/navigationView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    app:headerLayout="@layout/nav_home_header"
    app:menu="@menu/nav_home" />
    </android.support.v4.widget.DrawerLayout>