Skip to content

Instantly share code, notes, and snippets.

@nuhkoca
Last active December 25, 2017 00:13
Show Gist options
  • Save nuhkoca/a448bbf1e50aa411db7bc281c84ac1f2 to your computer and use it in GitHub Desktop.
Save nuhkoca/a448bbf1e50aa411db7bc281c84ac1f2 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name="touchListener"
type="com.mobilemovement.databindinginterface.callback.IViewTouchListener" />
<variable
name="demoText"
type="String" />
</data>
<android.support.constraint.ConstraintLayout
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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click Me!"
android:onClick="@{() -> touchListener.onTouched(demoText)}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</layout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment