Last active
November 6, 2015 10:28
-
-
Save plnice/ac9051c7bb0b2c0b57b4 to your computer and use it in GitHub Desktop.
Data binding & MVP
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
1. (IMHO lepszy, brak odniesienia do View.VISIBLE/GONE w presenterze) | |
<layout xmlns:android="http://schemas.android.com/apk/res/android"> | |
<data> | |
<import type="android.view.View"/> | |
<variable name="user" type="com.example.UserModel"/> | |
<variable name="presenter" type="com.example.UserPresenter"/> | |
</data> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:id="@+id/user_name" | |
android:visibility="@{presenter.shouldShowUserName(user) ? View.VISIBLE : View.GONE}"/> | |
</layout> | |
2. | |
<layout xmlns:android="http://schemas.android.com/apk/res/android"> | |
<data> | |
<variable name="user" type="com.example.UserModel"/> | |
<variable name="presenter" type="com.example.UserPresenter"/> | |
</data> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:id="@+id/user_name" | |
android:visibility="@{presenter.getUserNameVisibility(user)}"/> | |
</layout> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment