Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.
Florent CHAMPIGNY edited this page Apr 24, 2015 · 1 revision

##Permission Don't forget to add WRITE_EXTERNAL_STORAGE in your Wear AndroidManifest.xml

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

##Simple usage And use it wherever you want

DaVinci.with(context).load("/image/0").into(imageView);
DaVinci.with(context).load("http://i.imgur.com/o3ELrbX.jpg").into(imageView);

##Sources You can use DaVinci with -Url : http://i.imgur.com/o3ELrbX.jpg -Path : /image/0

The default asset name will be "image".

##Into an imageview

DaVinci.with(context).load("/image/0").into(imageView);

##Into a FragmentGridPagerAdapter

@Override
public Drawable getBackgroundForRow(final int row) {
    return DaVinci.with(context).load("/image/" + row).into(this, row);
}

##Into a CallBack

DaVinci.with(context).load("http://i.imgur.com/o3ELrbX.jpg").into(new DaVinci.Callback() {
            @Override
            public void onBitmapLoaded(String path, Bitmap bitmap) {

            }
});

##Asset name By default, the asset name used for the bitmap is "image", you can modify this

DaVinci.with(context).load("/image/0").setImageAssetName("myImage").into(imageView);
Clone this wiki locally