You can achieve this with a little hack (I think): create your own attribute refreshing, and then just bind it to booleans.
, attrs.xml res/values, , :
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="SwipeRefreshLayout">
<attr name="refreshing" format="boolean"/>
</declare-styleable>
</resources>
:
<android.support.v4.widget.SwipeRefreshLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:refreshing="@{habitListViewModel.isLoading}">
...
//ListView,RecyclerView or something
</android.support.v4.widget.SwipeRefreshLayout>
! , @{true} @{false} @{habitListViewModel.isLoading}. , .