Android数据映射和更智能的视图框:Carpaccio
dgbm
10年前
Android数据映射和更智能的视图框
With Carpaccio, your views became smarter, instead of calling functions on views, now your views can call functions ! You no longer need to extend a view to set a custom behavior
Carpaccio also come with a beautiful mapping engine !
This is kind of magic !
You can preview custom fonts & image loaded from url directly from Android Studio Preview !
用法
<com.github.florent37.carpaccio.Carpaccio android:id="@+id/carpaccio" android:layout_width="match_parent" android:layout_height="match_parent" app:register=" com.github.florent37.carpaccio.controllers.ImageViewController; com.github.florent37.carpaccio.controllers.TextViewController "> <ImageView android:layout_width="match_parent" android:layout_height="150dp" android:scaleType="centerCrop" android:tag="url(http://i.imgur.com/DSjXNox.jpg)" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="20sp" android:tag=" font(Roboto-Thin.ttf); setText($user.name);"/> </com.github.florent37.carpaccio.Carpaccio>
</span>