Last active
June 6, 2020 23:31
-
-
Save mustafayigitt/49e0ad58f46616f19d0eb72294128cf7 to your computer and use it in GitHub Desktop.
sample databinding layout
This file contains 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:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<data> | |
<variable | |
name="user" | |
type="com.mustafayigit.databindingexample.data.User" /> | |
</data> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
tools:context=".MainActivity"> | |
<ImageView | |
android:id="@+id/imgUserProfile" | |
android:layout_width="match_parent" | |
android:layout_height="150dp" /> | |
<TextView | |
android:id="@+id/txtUsername" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center" | |
android:text="@{user.username}" /> | |
<TextView | |
android:id="@+id/txtUserAge" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center" | |
android:text="@{String.valueOf(user.age)}" /> | |
<TextView | |
android:id="@+id/txtUserLocation" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center" | |
android:text="@{user.location}" /> | |
</LinearLayout> | |
</layout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment