lottie/example: Added image_test.json(resource with image resource ) 80/197680/1 master submit/tizen/20190116.045417 submit/tizen/20190116.084147 submit/tizen/20190117.121937 submit/tizen/20190118.024659 submit/tizen/20190118.084922
authorsubhransu mohanty <sub.mohanty@samsung.com>
Tue, 15 Jan 2019 08:12:40 +0000 (17:12 +0900)
committersubhransu mohanty <sub.mohanty@samsung.com>
Tue, 15 Jan 2019 08:14:04 +0000 (17:14 +0900)
Change-Id: If79f5892347be0dcc850380f1520dfd0f2c70724

example/demo.cpp
example/resource/image_test.json [new file with mode: 0755]
example/resource/images/img_0.png [new file with mode: 0755]

index 78f3fdd..9b14d55 100644 (file)
@@ -45,21 +45,15 @@ main(void)
    app->setup();
 
    std::string filePath = DEMO_DIR;
-   filePath +="mask.json";
-
-   std::ifstream f;
-   f.open(filePath);
-   std::stringstream buf;
-   buf << f.rdbuf();
-   f.close();
+   filePath +="image_test.json";
 
    LottieView *view = new LottieView(app->evas());
-   view->loadFromData(buf.str().data(), "test_key");
+   view->setFilePath(filePath.c_str());
    view->setPos(0, 0);
    view->setSize(800, 800);
    view->show();
-   view->setMinProgress(0.5);
-   view->setMaxProgress(0.0);
+//   view->setMinProgress(0.5);
+//   view->setMaxProgress(0.0);
    view->play();
    view->loop(true);
    view->setRepeatMode(LottieView::RepeatMode::Reverse);
diff --git a/example/resource/image_test.json b/example/resource/image_test.json
new file mode 100755 (executable)
index 0000000..e60c955
--- /dev/null
@@ -0,0 +1 @@
+{"v":"5.4.3","fr":60,"ip":0,"op":60,"w":800,"h":800,"nm":"test","ddd":0,"assets":[{"id":"image_0","w":200,"h":300,"u":"images/","p":"img_0.png","e":0}],"layers":[{"ddd":0,"ind":1,"ty":2,"nm":"img_0.png","cl":"png","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[56]},{"t":50}],"ix":10},"p":{"a":0,"k":[400,400,0],"ix":2},"a":{"a":0,"k":[100,150,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":0,"s":[99,99,100],"e":[152,152,100]},{"t":50}],"ix":6}},"ao":0,"ip":0,"op":60,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file
diff --git a/example/resource/images/img_0.png b/example/resource/images/img_0.png
new file mode 100755 (executable)
index 0000000..35ee257
Binary files /dev/null and b/example/resource/images/img_0.png differ