Last active
July 28, 2016 06:56
-
-
Save miquelbeltran/d121083e71bb79d2c53408d2d6dbda2b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:bind="http://schemas.android.com/apk/res-auto" | |
xmlns:app="http://schemas.android.com/apk/res-auto"> | |
<data> | |
<variable | |
name="dataSource" | |
type="com.beltranfebrer.databindingcourse.DataSource"/> | |
<variable | |
name="includeSource" | |
type="com.beltranfebrer.databindingcourse.DataSource"/> | |
<variable | |
name="listeners" | |
type="com.beltranfebrer.databindingcourse.MainActivity.Listeners"/> | |
</data> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
android:orientation="vertical" | |
tools:context="com.beltranfebrer.databindingcourse.MainActivity"> | |
<!-- Simple data source example --> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="@{dataSource.message}"/> | |
<!-- Fragment example --> | |
<fragment | |
android:id="@+id/data_fragment" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
class="com.beltranfebrer.databindingcourse.DataFragment" | |
tools:layout="@layout/fragment_data" /> | |
<!-- data binding language example --> | |
<LinearLayout | |
android:id="@+id/menu" | |
android:orientation="vertical" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"/> | |
<!-- OnClickListener Example --> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
app:numberText="@{dataSource.numberInc}"/> | |
<Button | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="+" | |
android:onClick="@{listeners}"/> | |
<!-- Custom Binding adapter example --> | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
app:imageUrl="@{dataSource.imageUrl}" | |
app:imagePlaceHolder="@{@android:drawable/ic_dialog_info}" | |
app:imageError="@{@android:drawable/stat_sys_warning}"/> | |
<!-- Custom Binding adapter example --> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
app:numberText="@{dataSource.number}"/> | |
<!-- RecyclerView Example --> | |
<android.support.v7.widget.RecyclerView | |
android:id="@+id/list" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" /> | |
<!-- Included layout Example --> | |
<include layout="@layout/include_view" | |
bind:dataSource="@{includeSource}"/> | |
</LinearLayout> | |
</layout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment