florent37 / carpaccio Goto Github PK
View Code? Open in Web Editor NEWData Mapping & Smarter Views framework for android
Home Page: https://github.com/florent37/Carpaccio/wiki
License: Apache License 2.0
Data Mapping & Smarter Views framework for android
Home Page: https://github.com/florent37/Carpaccio/wiki
License: Apache License 2.0
Hello! How can access list mapped to Carpaccio and notifiydatasetchanged??? Thanks
Hi! I'm trying your library and i think is cool! But i have one problem: i use a Hashmap, and i 'm not able to use 'SetText' with a method like '$object.get("test")'; Do you think is possibile implement a solution for this?
are you thinking to implement empty/error view in list view?
I get the following error if I add this to my project in my build.gradle file:
Error:Module version com.github.florent37:carpacciocontrollers:1.0.0 depends on libraries but is not a library itself
I have visualizer attached to a view holder of a recycler thats needed to be shown whenever music is playing with carpaccio is there any direct function / method from which i can access the state of it being triggered with the music playing in the background as a service
my project is similar to this #6 and the customController i made with this is not working at all , dont know why
open class CustomController {
fun loadUri(view: ImageView, uri: Uri) {
Picasso.with(view.context).load(uri).placeholder(R.drawable.default_image).into(view)
}
}
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.github.florent37.carpaccio.Carpaccio xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/carpaccioLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:register="
com.github.florent37.carpaccio.controllers.RecyclerViewController;
com.github.florent37.carpaccio.controllers.TextViewController;
com.github.florent37.carpaccio.controllers.ImageViewController;
com.merkmod.mosiqi.application.CustomController;">
<android.support.v7.widget.RecyclerView
android:id="@+id/songList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="4dp"
android:tag="adapter(songs, R.layout.song_viewholder)" />
</com.github.florent37.carpaccio.Carpaccio>
</android.support.design.widget.CoordinatorLayout>
<com.github.florent37.carpaccio.Carpaccio xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:register="
com.github.florent37.carpaccio.controllers.CommonViewController;
com.github.florent37.carpaccio.controllers.TextViewController;
com.github.florent37.carpaccio.controllers.ImageViewController;
com.merkmod.mosiqi.application.CustomController;">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="6dp"
android:paddingLeft="8dp"
android:paddingTop="6dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/albumArt"
android:layout_width="55dp"
android:layout_height="55dp"
android:tag="
loadUri($songs.albumArt);
"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:padding="1dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_toEndOf="@+id/albumArt"
android:layout_toRightOf="@+id/albumArt"
android:orientation="vertical"
android:paddingLeft="12dp"
android:paddingStart="12dp"
android:paddingTop="5dp">
<TextView
android:id="@+id/songTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:tag="setText($songs.songName)"
android:textSize="16sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:tag="setText($songs.artistName)"
android:paddingTop="3dp"
android:textSize="13sp" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
class SongFragment: LifecycleFragment() {
override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater?.inflate(R.layout.song_screen, container, false)
val model = ViewModelProviders.of(this)[SongViewModel::class.java]
model.getData().observe(this, Observer {
carpaccioLayout.mapList("songs", it?.sortedBy {
it.songName
})
})
return view
}
}
and i have the permissions setup as well
Hi Florent,
Do you plan support two way binding in future ?
I'm so exiciting and thankful if you do it :)
Cheers
I have created a blank project to test recyclerview with images, but i have problem with url function. I have even tested with my own controller and Picasso/Glide, but nothing happens.
Tha log, scrolling, write: GC_FOR_ALLOC freed 431K, 12% free 3687K/4172K, paused 21ms, total 21ms
I have written a sample using code similar to yours.
MainActivity:
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Carpaccio carpaccio = (Carpaccio)findViewById(R.id.carpaccio);
List<Object> users = new ArrayList<>();
for (int i = 0; i < 20; ++i) {
users.add(new User("Username n°" + i, "http://lorempixel.com/" + generateRandom() + "/" + generateRandom() + "/"));
}
carpaccio.mapList("user", users);
}
main activity layout:
<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.CommonViewController;
com.github.florent37.carpaccio.controllers.ImageViewController;
com.github.florent37.carpaccio.controllers.TextViewController;
com.example.pgulinelli.glidetest.Contr;
">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:tag="
adapter(user,R.layout.item)
"
/>
</com.github.florent37.carpaccio.Carpaccio>
single row:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="100dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/image_episode"
android:layout_width="100dp"
android:layout_height="match_parent"
android:src="@drawable/ic_launcher"
android:layout_marginRight="20dp"
android:tag="
url(http://lorempixel.com/400/400/);
" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:tag="
setText($user.name);" />
</LinearLayout>
I am not able to use recyclerview with new version, the layout on the activity remains empty. Same code with version 1.0.1 works with no problem
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.