GithubHelp home page GithubHelp logo

florent37 / carpaccio Goto Github PK

View Code? Open in Web Editor NEW
414.0 414.0 70.0 30.53 MB

Data Mapping & Smarter Views framework for android

Home Page: https://github.com/florent37/Carpaccio/wiki

License: Apache License 2.0

Java 100.00%

carpaccio's People

Contributors

bryant1410 avatar florent37 avatar gitter-badger avatar vbauer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

carpaccio's Issues

Android Studio Preview not working

Hi Florent,
Firstly, thank so much for awesome work, I really love it.
I checkout project then try to run on my own but there's something not correct

Here is design mode:
screen shot 2015-07-31 at 9 29 36 am

In activity:
screen shot 2015-07-31 at 9 32 45 am

Image preview and set text seems not working. Can you help me to find out what going not correct ?
Thanks :)

Hashmap setText

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?

Error while syncing gradle in Android Studio

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

Making a music player app

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

ImageLoad with custom controller

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

Two way binding support ?

Hi Florent,

Do you plan support two way binding in future ?

I'm so exiciting and thankful if you do it :)

Cheers

url problem

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>

from 1.0.1 to 1.0.2.7 problem

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.