Skip to content
Permalink
Browse files

Fix grid header layout

  • Loading branch information...
chrisbanes committed Aug 13, 2019
1 parent 91a0c1d commit a4ffe4c0aec87cc8a4c488b994592f3e498fc8d5
@@ -34,6 +34,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurface"
android:paddingHorizontal="4dp"
android:elevation="@dimen/sticky_header_elevation"
app:materialBackgroundColor="?attr/colorSurface" />

@@ -17,53 +17,44 @@
-->

<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>
<import type="android.content.Context" />

<variable
name="title"
type="int" />

<variable
name="titleString"
type="CharSequence" />

<variable
name="buttonTitle"
type="int" />

<variable
name="buttonClickListener"
type="android.view.View.OnClickListener" />
</data>

<FrameLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_height="wrap_content"
android:foreground="?android:attr/selectableItemBackground"
android:orientation="horizontal"
android:paddingHorizontal="@dimen/header_margin"
android:transitionGroup="true">

<TextView
android:id="@+id/header_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/header_margin"
android:layout_marginStart="@dimen/header_margin"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_small"
android:layout_marginEnd="@dimen/spacing_small"
android:layout_marginTop="@dimen/spacing_small"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="@{titleString ?? context.getString(title)}"
android:textAppearance="?attr/textAppearanceSubtitle1"
tools:text="Popular" />

<ProgressBar
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:visible="@{showProgress}" />

<TextView
android:id="@+id/header_more"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:layout_marginEnd="@dimen/header_margin"
android:layout_marginStart="@dimen/header_margin"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_small"
android:layout_marginStart="@dimen/spacing_small"
android:layout_marginTop="@dimen/spacing_small"
android:gravity="center_vertical"
android:onClick="@{buttonClickListener}"
android:text="@{buttonTitle != 0 ? context.getString(buttonTitle) : @string/header_more}"
@@ -72,5 +63,29 @@
android:textColor="?attr/colorSecondary"
app:visibleIfNotNull="@{buttonClickListener}" />

</FrameLayout>
</LinearLayout>

<data>
<import type="android.content.Context" />

<variable
name="title"
type="int" />

<variable
name="titleString"
type="CharSequence" />

<variable
name="buttonTitle"
type="int" />

<variable
name="showProgress"
type="boolean" />

<variable
name="buttonClickListener"
type="android.view.View.OnClickListener" />
</data>
</layout>

0 comments on commit a4ffe4c

Please sign in to comment.
You can’t perform that action at this time.