{"id":1652,"date":"2024-04-09T10:25:27","date_gmt":"2024-04-09T02:25:27","guid":{"rendered":"https:\/\/www.gyxwsjdxh.com\/?p=1652"},"modified":"2024-04-09T10:25:27","modified_gmt":"2024-04-09T02:25:27","slug":"android%e8%bd%a6%e8%bd%bdhmi-lottie%e8%ae%b2%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.gyxwsjdxh.com\/1652.html","title":{"rendered":"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3"},"content":{"rendered":"\n

\n

1.\u524d\u8a00<\/h2>\n

\u591a\u5e74\u4ee5\u524d\u6c7d\u8f66\u8fd8\u662f\u4ee5\u673a\u68b0\u4eea\u8868\u4e3b\u4f53\u7684\u5e74\u4ee3\uff0c\u5404\u5927\u6c7d\u8f66\u4e3b\u673a\u5382\u5546\u5e76\u4e0d\u5341\u5206\u5173\u6ce8\u64cd\u4f5c\u7cfb\u7edfUI\u7684\u4ea4\u4e92\u529f\u80fd\uff0c\u4f46\u662f\u968f\u7740\u8f66\u8f7dSOC\u7b97\u529b\u7684\u4e0d\u65ad\u63d0\u9ad8\u4ee5\u53ca\u4e3b\u673a\u5382\u5546\u5bf9\u6c7d\u8f66\u5ea7\u8231\u7ade\u4e89\u7684\u767d\u70ed\u5316\u3002\u5ea7\u8231\u7684HMI\u5728\u8bbe\u8ba1\u4e0a\u5728\u5f3a\u8c03\u529f\u80fd\u6027\u7684\u540c\u65f6\u4e5f\u5f00\u59cb\u5173\u6ce8UI\u7684\u827a\u672f\u6027\uff0cHMI\u7684\u8bbe\u8ba1\u5e08\u4eec\u671f\u671b\u827a\u672f\u4e0e\u529f\u80fd\u5e94\u8be5\u534f\u540c\u5de5\u4f5c\uff0c\u8ba9\u7528\u6237\u6c89\u6d78\u5728\u201c\u7b2c\u4e09\u7a7a\u95f4\u201d\u7684\u4f53\u9a8c\u4e2d\u3002<\/p>\n

\u6709\u4e86\u9700\u6c42\u7a0b\u5e8f\u5458\u5c31\u9700\u8981\u5173\u6ce8\u5982\u4f55\u5b9e\u65bd\u548c\u843d\u5730\uff0c\u7136\u800cAndroid\u5e94\u7528\u672c\u8eab\u867d\u7136\u6709\u7740\u5b8c\u6574\u7684\u52a8\u753b\u6846\u67b6\u652f\u6301\uff0c\u4f46\u662f\u5f00\u53d1\u590d\u6742\u3001\u8c03\u8bd5\u8017\u65f6\uff0c\u5927\u578b\u7684gif\u6216\u9010\u5e27\u52a8\u753b\u5bf9\u4e8eCPU&\u5185\u5b58\u5360\u7528\u90fd\u4e0d\u592a\u7406\u60f3\uff0c\u6240\u4ee5\u8bb8\u591aAndroid\u7684\u624b\u673a\u5e94\u7528\u57fa\u672c\u4e0a\u4e0d\u600e\u4e48\u6709\u52a8\u753b\u3002\u800c\u4e14\u8f66\u8f7dHMI\u4e0a\u8d8a\u6765\u8d8a\u591a\u7684\u5f00\u59cb\u5f15\u5165\u5404\u79cd\u5149\u5f71\u3001\u7c92\u5b50\u6548\u679c\uff0c\u5982\u679c\u57fa\u4e8eAndroid\u7684\u539f\u751f\u63a7\u4ef6\u6765\u5b9e\u73b0\u8fd9\u4e9b\u7c92\u5b50\u6548\u679c\uff0c\u96be\u5ea6\u975e\u5e38\u5927\uff0c\u8fd9\u5c31\u9700\u8981\u4eca\u5929\u7684\u4e3b\u89d2Lottie\u6765\u5b9e\u73b0\u4e86\u3002<\/p>\n

\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe\"<\/div>\n

2.Lottie\u6982\u8ff0<\/h3>\n

Lottie\u662f\u4e00\u79cd\u57fa\u4e8eJSON\u7684\u52a8\u753b\u6587\u4ef6\u683c\u5f0f\uff0c\u5b83\u4f7f\u8bbe\u8ba1\u5e08\u80fd\u591f\u5728\u4efb\u4f55\u5e73\u53f0\u4e0a\u53d1\u5e03\u52a8\u753b\uff0c\u5c31\u50cf\u53d1\u5e03\u9759\u6001\u8d44\u4ea7\u4e00\u6837\u7b80\u5355\u3002\u5b83\u4eec\u662f\u5728\u4efb\u4f55\u8bbe\u5907\u4e0a\u5de5\u4f5c\u7684\u5c0f\u6587\u4ef6\uff0c\u53ef\u4ee5\u5728\u4e0d\u8fdb\u884c\u50cf\u7d20\u5316\u7684\u60c5\u51b5\u4e0b\u653e\u5927\u6216\u7f29\u5c0f\u3002<\/p> GitHub\uff1ahttps:\/\/github.com\/airbnb\/lottie-android<\/a> \u5b98\u65b9\u6587\u6863\uff1ahttp:\/\/airbnb.io\/lottie\/<\/a>\n

Lottie\u5728\u8f66\u8f7dHMI\u4e2d\u7684\u4f18\u52bf<\/h3>\n

\u9002\u91cf\u56fe\u5f62\uff0c\u4e0d\u4f1a\u51fa\u73b0\u5931\u771f<\/p>\n

\u5360\u7528\u7a7a\u95f4\u6bd4\u5e8f\u5217\u5e27\u52a8\u753b\u5c0f<\/p>\n

\u53ef\u4ee5\u4fee\u6539\u5c5e\u6027\uff0c\u52a8\u6001\u751f\u6210\u53ef\u4ea4\u4e92\u7684\u52a8\u753b\uff08\u4f7f\u7528\u89c6\u9891\u52a8\u753b\u96be\u4ee5\u5b9e\u73b0\u4ea4\u4e92\u529f\u80fd\uff09<\/p>\n

\u8282\u7701HMI\u7684\u5f00\u53d1\u3001\u8c03\u8bd5\u65f6\u95f4<\/p>\n

\u53ef\u4ee5\u66f4\u8f7b\u677e\u7684\u5b9e\u73b0\u7c92\u5b50\u3001\u5149\u5f71\u7b49\u7279\u6548<\/p>\n

Lottie\u7684\u4f7f\u7528\u65b9\u6cd5<\/h3>\u5728build.gradle\u4e2d\u6dfb\u52a0\u4f9d\u8d56
dependencies<\/span> {<\/span>\n def<\/span> lottieVersion<\/span> =<\/span> “5.2.0”<\/span>\n implementation<\/span> com.airbnb.android:lottie:<\/span>$<\/span>lottieVersion<\/span>\n }<\/span>\n <\/div>\u4f7f\u7528LottieAnimationView \u9996\u5148\u5c06lottie\u52a8\u753b\u7684json\u6587\u4ef6\u653e\u5728assets\u6587\u4ef6\u5939\u4e0b
\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe1\"<\/div>img

\u7136\u540e\u5c31\u53ef\u4ee5\u5728\u5e03\u5c40\u6587\u4ef6\u4e2d\u4f7f\u7528LottieAnimationView\u4e86<\/p>\n

<com.airbnb.lottie.LottieAnimationView\n android:id=”@+id\/dynamic_text”\n android:layout_width=”wrap_content”\n android:layout_height=”wrap_content”\n app:lottie_fileName=”HamburgerArrow.json”\n app:lottie_autoPlay=”true”\n app:lottie_loop=”true”\/><\/div>\n

\u7136\u540e\u8fd0\u884cAPP\u5c31\u53ef\u4ee5\u770b\u5230\u52a8\u753b\u6548\u679c<\/p>\n

\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe2\"<\/div>\n

3.Lottie\u7684\u5e38\u7528\u5c5e\u6027&API<\/h3>\n

LottieAnimationView\u7ee7\u627f\u81eaAppCompatImageView\uff0c\u6240\u4ee5ImageView\u652f\u6301\u7684\u5c5e\u6027\uff0cLottieAnimationView\u90fd\u662f\u652f\u6301\u7684\uff0c\u8fd9\u90e8\u5206\u5c31\u4e0d\u518d\u4ecb\u7ecd\u4e86\u3002<\/p>lottie_fileName \u8bbe\u5b9alottie\u52a8\u753b\u6240\u5bf9\u5e94\u7684json\u6587\u4ef6\u5730\u5740\u3002json\u6587\u4ef6\u9ed8\u8ba4\u9700\u8981\u653e\u7f6e\u5728assets\u4e0b\uff0c\u8bbe\u5b9a\u65f6\u4e0d\u9700\u8981\u518d\u5f3a\u8c03assets

app:lottie_fileName=<\/span>“HamburgerArrow.json”<\/span><\/div>\n

\u5982\u679c\u8bbe\u5b9a app:lottie_fileName=”other\/HamburgerArrow.json”\uff0c\u90a3\u4e48lottie\u5c31\u4f1a\u8bfb\u53d6assets\/other\/HamburgerArrow.json\u3002 void setAnimationFromJson(String jsonString, @Nullable String cacheKey\uff09<\/p>lottie_rawRes \u8bbe\u5b9alottie\u52a8\u753b\u7684json\u6587\u4ef6\u5730\u5740\u3002json\u6587\u4ef6\u9664\u4e86\u53ef\u4ee5\u653e\u7f6eassets\u6587\u4ef6\u5939\u4e0b\uff0c\u8fd8\u53ef\u4ee5\u653e\u5728raw\u6587\u4ef6\u5939\u4e0b\u3002\u4f7f\u7528\u65f6\u9700\u8981\u6ce8\u610f\uff0c\u5229\u7528lottie_rawRes\u5f15\u5165\u8d44\u6e90\u65f6\uff0cjson\u6587\u4ef6\u540d\u524d\u9700\u8981\u52a0\u4e0a@raw\uff0c\u5e76\u4e14\u6587\u4ef6\u540d\u4e0d\u5e26.json\u540e\u7f00

app:lottie_rawRes=<\/span>“@raw\/name”<\/span><\/div>\n
\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe3\"<\/div>\n

imglottie_autoPlay \u8bbe\u5b9a\u662f\u5426\u81ea\u52a8\u64ad\u653e\uff0c\u53d6\u503c\u4e3atrue | false<\/p>\n

lottie_loop \u8bbe\u5b9a\u662f\u5426\u5faa\u73af\u64ad\u653e\uff0c\u53d6\u503c\u4e3atrue | false<\/p>\n

lottie_url \u5f53\u9700\u8981\u52a0\u8f7d\u5728\u7ebf\u8d44\u6e90\u65f6\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528lottie_url void setAnimationFromUrl(String url) void setAnimationFromUrl(String url, @Nullable String cacheKey)<\/p>\n

lottie_fallbackRes \u8bbe\u7f6e\u4e00\u4e2adrawable\uff0c\u5982\u679clotticomposition\u7531\u4e8e\u4efb\u4f55\u539f\u56e0\u672a\u80fd\u52a0\u8f7d\uff0c\u5219\u5c06\u5448\u73b0\u8be5drawable\u3002 \u5982\u679c\u8fd9\u662f\u7f51\u7edc\u52a8\u753b\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b83\u5411\u7528\u6237\u663e\u793a\u9519\u8bef\uff0c\u4e5f\u53ef\u4ee5\u6dfb\u52a0\u4e00\u4e2a\u5931\u8d25\u7684\u76d1\u542c\u5668\u91cd\u8bd5\u4e0b\u8f7d\u3002 void setFallbackResource(@DrawableRes int fallbackResource)<\/p>\n

lottie_repeatMode \u8bbe\u5b9a\u5faa\u73af\u64ad\u653e\u7684\u987a\u5e8f\u3002\u53d6\u503c\u4e3arestart | reverse \u3002restart\u8868\u793a\u6b63\u5e38\u5faa\u73af\u64ad\u653e\uff0creverse\u8868\u793a\u5012\u5e8f\u64ad\u653e void setRepeatMode(@LottieDrawable.RepeatMode int mode) int getRepeatMode()<\/p>\n

lottie_repeatCount \u8bbe\u5b9a\u5faa\u73af\u64ad\u653e\u6b21\u6570\uff0c\u53d6\u503c\u4e3a\u6574\u6570\u7c7b\u578b\u3002 void setRepeatCount(int count) int getRepeatCount()<\/p>\n

lottie_imageAssetsFolder \u8bbe\u5b9a\u56fe\u7247\u6587\u4ef6\u5728assets\u6587\u4ef6\u5939\u4e0b\u7684\u8bbf\u95ee\u8def\u5f84\u3002\u6709\u7684\u65f6\u5019\u4f7f\u7528AE\u5bfc\u51falottie\u7684json\u65f6\u4e5f\u4f1a\u5bfc\u51fa\u4e00\u4e9b\u56fe\u7247\uff0c\u8fd9\u65f6\u5019\u5c31\u9700\u8981\u8be5\u5c5e\u6027\u8bbe\u5b9a\u56fe\u7247\u7684\u5730\u5740\u3002 void setImageAssetsFolder(String imageAssetsFolder) String getImageAssetsFolder()<\/p>\n

void setFrame(int frame) \u5c06\u8fdb\u5ea6\u8bbe\u7f6e\u4e3a\u6307\u5b9a\u7684\u5e27\u3002\u5c06\u8fdb\u5ea6\u8bbe\u7f6e\u4e3a\u6307\u5b9a\u7684\u5e27\u3002\u5982\u679c\u5c1a\u672a\u8bbe\u7f6e\u5408\u6210\uff0c\u5219\u8fdb\u5ea6\u5c06\u5728\u8bbe\u7f6e\u65f6\u8bbe\u7f6e\u4e3a\u5e27\u3002 \u901a\u8fc7int getFrame()\u53ef\u4ee5\u83b7\u53d6\u5f53\u524d\u6e32\u67d3\u7684\u5e27\u3002<\/p>\n

void setMaxFrame(int endFrame) \u8bbe\u7f6e\u64ad\u653e\u6216\u5faa\u73af\u65f6\u52a8\u753b\u5c06\u7ed3\u675f\u7684\u6700\u5927\u5e27\u3002 \u8be5\u503c\u5c06\u88ab\u94b3\u5236\u5230\u5408\u6210\u8fb9\u754c\u3002\u4f8b\u5982\uff0c\u8bbe\u7f6e\u6574\u6570\u6700\u5927\u503c\u5c06\u4ea7\u751f\u4e0e\u5408\u6210\u76f8\u540c\u7684\u7ed3\u679c\u3002 \u901a\u8fc7float getMaxFrame()\u53ef\u4ee5\u83b7\u53d6\u5f53\u524d\u8bbe\u5b9a\u7684\u6700\u5927\u5e27<\/p>\n

void setMinFrame(int startFrame) \u8bbe\u7f6e\u64ad\u653e\u6216\u5faa\u73af\u65f6\u52a8\u753b\u5f00\u59cb\u7684\u6700\u5c0f\u5e27\u3002 \u8bbe\u5b9a\u6700\u5927\u3001\u6700\u5c0f\u5e27\u53ef\u4ee5\u53ea\u64ad\u653elottie\u52a8\u753b\u4e2d\u7684\u4e00\u90e8\u5206\uff0c\u4f8b\u5982\u4e0b\u9762\u7684\u4e24\u5f20\u56fe\uff0c\u7b2c\u4e00\u5f20\u662f\u5b8c\u6574\u7684\u4ece0\u64ad\u653e\u5230183\u5e27\uff0c\u7b2c\u4e8c\u5f20\u5219\u662f\u4ece60\u64ad\u653e\u5230100\u5e27\u3002<\/p>\n

\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe4\"<\/div>\n

lottie_progress \u8bbe\u5b9a\u52a8\u753b\u521d\u6b21\u663e\u793a\u65f6\u7684\u8fdb\u5ea6\uff0c\u7c7b\u578b\u4e3afloat\u3002\u53d6\u503c\u8303\u56f40.0 ~ 1.0 void setProgress(@FloatRange(from = 0f, to = 1f) float progress) float getProgress()<\/p>\n

lottie_speed \u8bbe\u5b9a\u64ad\u653e\u901f\u5ea6\uff0c\u53d6\u503c\u7c7b\u578b\u4e3afloat\u3002\u5f53\u901f\u5ea6<1\u65f6\uff0c\u52a8\u753b\u4f1a\u6162\u653e\uff0c\u5f53\u901f\u5ea6<0\u65f6\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5012\u5e8f\u64ad\u653e\u3002 void setSpeed(float speed) float getSpeed() void reverseAnimationSpeed()\uff1a\u53cd\u8f6c\u5f53\u524d\u52a8\u753b\u901f\u5ea6\u3002\u8fd9\u4e0d\u4f1a\u64ad\u653e\u52a8\u753b\u3002<\/p>\n

\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe5\"<\/div>\n

\u901f\u5ea6\u662f\u4e00\u4e2a\u6bd4\u8f83\u91cd\u8981\u7684\u5c5e\u6027\uff0c\u4e0eprogress\u3001frame\u7b49\u5c5e\u6027\u4e00\u8d77\u7075\u6d3b\u8fd0\u7528\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u8f7b\u677e\u5730\u5728HMI\u4e0a\u5b9e\u73b0\u70ab\u9177\u800c\u590d\u6742\u7684\u4eea\u8868\u76d8\u6548\u679c\uff0c\u8fd9\u5bf9\u8f66\u8f7dHMI\u5c24\u4e3a\u91cd\u8981\u3002<\/p>\n

lottie_enableMergePathsForKitKatAndAbove \u8bbe\u5b9a\u662f\u5426\u5f00\u542fMergePath\u5c5e\u6027\uff0c\u53d6\u503c\u4e3atrue | false\u3002\u9ed8\u8ba4\u4e3afalse void enableMergePathsForKitKatAndAbove(boolean enable) boolean isMergePathsEnabledForKitKatAndAbove()<\/p>\n

void playAnimation() \u4ece\u5934\u5f00\u59cb\u64ad\u653e\u52a8\u753b\u3002\u5982\u679c\u901f\u5ea6<0\uff0c\u5b83\u5c06\u4ece\u7ec8\u70b9\u5f00\u59cb\uff0c\u5e76\u5411\u8d77\u70b9\u64ad\u653e\u3002\u5fc5\u987b\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u8c03\u7528\u3002<\/p>\n

void cancelAnimation() \u53d6\u6d88\u52a8\u753b\uff0c\u5fc5\u987b\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u8c03\u7528\u3002<\/p>\n

void pauseAnimation() \u6682\u505c\u52a8\u753b\uff0c\u5fc5\u987b\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u8c03\u7528\u3002<\/p>\n

void resumeAnimation() \u4ece\u5f53\u524d\u4f4d\u7f6e\u7ee7\u7eed\u64ad\u653e\u52a8\u753b\u3002\u5982\u679c\u901f\u5ea6<0\uff0c\u5b83\u5c06\u4ece\u5f53\u524d\u4f4d\u7f6e\u5411\u540e\u64ad\u653e\u3002\u5fc5\u987b\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u8c03\u7528\u3002<\/p>\n

long getDuration() \u83b7\u53d6\u52a8\u753b\u7684\u64ad\u653e\u65f6\u957f\u3002<\/p>\n

void setTextDelegate(TextDelegate textDelegate) \u8bbe\u7f6e\u6b64\u9009\u9879\u53ef\u5728\u8fd0\u884c\u65f6\u7528\u81ea\u5b9a\u4e49\u6587\u672c\u66ff\u6362\u52a8\u753b\u6587\u672c<\/p>\n

lottie_cacheComposition \u8bbe\u5b9a\u662f\u5426\u5f00\u542f\u7f13\u5b58\uff0c\u53d6\u503c true | false\uff0c\u9ed8\u8ba4\u5f00\u542f\u3002\u5f00\u542f\u7f13\u5b58\u53ef\u4ee5\u63d0\u5347\u52a8\u753b\u7684\u52a0\u8f7d\u6548\u7387\u3002<\/p>\n

void setCacheComposition(boolean cacheComposition)<\/div>lottie_ignoreDisabledSystemAnimations \u5141\u8bb8\u5ffd\u7565\u7cfb\u7edf\u52a8\u753b\u8bbe\u7f6e\uff0c\u56e0\u6b64\u5373\u4f7f\u7981\u7528\u52a8\u753b\uff0c\u4e5f\u5141\u8bb8\u8fd0\u884c\u52a8\u753b\u3002\u53d6\u503c true | false\uff0c\u9ed8\u8ba4\u4e3afalse\u3002 void setIgnoreDisabledSystemAnimations(boolean ignore)lottie_clipToCompositionBounds \u8bbe\u7f6elottie\u662f\u5426\u5e94\u526a\u8f91\u5230\u539f\u59cb\u52a8\u753b\u5408\u6210\u8fb9\u754c\u3002\u8bbe\u7f6e\u4e3atrue\u65f6\uff0c\u7236\u89c6\u56fe\u53ef\u80fd\u9700\u8981\u7981\u7528clipChildren\uff0c\u4ee5\u4fbfLottie\u53ef\u4ee5\u5728LottieAnimationView\u8fb9\u754c\u4e4b\u5916\u8fdb\u884c\u6e32\u67d3\u3002\u9ed8\u8ba4\u4e3atrue\u3002 void setClipToCompositionBounds(boolean clipToCompositionBounds)lottie_renderMode \u8bbe\u5b9a\u6e32\u67d3\u6a21\u5f0f\uff0c\u53d6\u503c\u4e3a automatic | hardware | software\u3002\u8bbe\u5b9a\u6e32\u67d3\u6a21\u5f0f\u4e3ahardware\u65f6\uff0c\u53ef\u4ee5\u663e\u8457\u63d0\u5347\u52a8\u753b\u7684\u6e32\u67d3\u6548\u7387\uff0c\u4f46\u662f\u6709\u4e9b\u7cfb\u7edf\u51fd\u6570\u53ef\u80fd\u5e76\u4e0d\u652f\u6301\u786c\u4ef6\u52a0\u901f\uff0c\u5b9e\u9645\u4f7f\u7528\u65f6\u9700\u8981\u7ed3\u5408\u8c03\u8bd5\u65f6\u7684\u6548\u679c\u9009\u62e9\u662f\u5426\u5f00\u542f\u3002 void setRenderMode(RenderMode renderMode) RenderMode getRenderMode()void addAnimatorListener(Animator.AnimatorListener listener) \u6dfb\u52a0\u52a8\u753b\u7684\u5c5e\u6027\u76d1\u542c\u3002 \u5bf9\u5e94\u4e5f\u63d0\u4f9b\u4e86removeUpdateListener(ValueAnimator.AnimatorUpdateListener updateListener)\u7528\u6765\u79fb\u9664\u6307\u5b9a\u7684\u76d1\u542c\u3002\u6216\u8005\u4e5f\u53ef\u4ee5\u4f7f\u7528removeAllAnimatorListeners()\u79fb\u9664\u6240\u6709\u76d1\u542c\u3002
binding<\/span>.<\/span>animationView<\/span>.<\/span>addAnimatorUpdateListener<\/span>(<\/span>object<\/span> : <\/span>ValueAnimator<\/span>.<\/span>AnimatorUpdateListener<\/span> {<\/span>\n override<\/span> fun<\/span> onAnimationUpdate<\/span>(<\/span>animation<\/span>:<\/span> ValueAnimator<\/span>?)<\/span> {<\/span>\n\n }<\/span>\n })<\/span>\n <\/div>void addAnimatorPauseListener(Animator.AnimatorPauseListener listener) \u6dfb\u52a0\u52a8\u753b\u6682\u505c\/\u6062\u590d\u76d1\u542c\u3002 \u5bf9\u5e94\u4e5f\u63d0\u4f9b\u4e86removeAnimatorPauseListener(Animator.AnimatorPauseListener listener)\u7528\u6765\u79fb\u9664\u6307\u5b9a\u7684\u76d1\u542c\u3002
binding<\/span>.<\/span>animationView<\/span>.<\/span>addAnimatorPauseListener<\/span>(<\/span>object<\/span> : <\/span>Animator<\/span>.<\/span>AnimatorPauseListener<\/span>{<\/span>\n override<\/span> fun<\/span> onAnimationPause<\/span>(<\/span>animation<\/span>:<\/span> Animator<\/span>?)<\/span> {<\/span>\n\n }<\/span>\n\n override<\/span> fun<\/span> onAnimationResume<\/span>(<\/span>animation<\/span>:<\/span> Animator<\/span>?)<\/span> {<\/span>\n\n }<\/span>\n\n })<\/span>\n <\/div>void addAnimatorUpdateListener(ValueAnimator.AnimatorUpdateListener updateListener) \u6dfb\u52a0\u52a8\u753b\u53d1\u751f\u66f4\u65b0\u65f6\u7684\u76d1\u542c \u5bf9\u5e94\u4e5f\u63d0\u4f9b\u4e86removeUpdateListener(ValueAnimator.AnimatorUpdateListener updateListener)\u7528\u6765\u79fb\u9664\u6307\u5b9a\u7684\u76d1\u542c\u3002\u6216\u8005\u4e5f\u53ef\u4ee5\u4f7f\u7528removeAllUpdateListeners()\u79fb\u9664\u6240\u6709\u76d1\u542c\u3002
binding<\/span>.<\/span>animationView<\/span>.<\/span>addAnimatorUpdateListener<\/span>(<\/span>object<\/span> : <\/span>ValueAnimator<\/span>.<\/span>AnimatorUpdateListener<\/span>{<\/span>\n override<\/span> fun<\/span> onAnimationUpdate<\/span>(<\/span>animation<\/span>:<\/span> ValueAnimator<\/span>?)<\/span> {<\/span>\n\n }<\/span>\n })<\/span>\n <\/div>void addValueCallback(KeyPath keyPath, T property, LottieValueCallback callback)

\u76d1\u542clottie\u52a8\u753bjson\u4e2d\u67d0\u4e2a\u7247\u6bb5\u7684\u5c5e\u6027\u3002<\/p>\n

\u6b64<\/p>\n

keypath<\/p>\n

\u53ef\u4ee5\u89e3\u6790\u4e3a\u591a\u4e2a\u5185\u5bb9\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u56de\u8c03\u7684\u503c\u5c06\u5e94\u7528\u4e8e\u6240\u6709\u56de\u8c03\u3002\u5728\u5185\u90e8\u4f1a\u9996\u5148\u68c0\u67e5\u662f\u5426\u5df2\u4f7f\u7528resolveKeyPath\uff08KeyPath\uff09\u89e3\u6790keypath\uff0c\u5982\u679c\u5c1a\u672a\u89e3\u6790\uff0c\u5219\u5c06\u5bf9\u5176\u8fdb\u884c\u89e3\u6790\u3002<\/p>\n

\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe6\"<\/div>img

Lottie\u52a8\u753b\u7684Json\u4e2d\u5c5e\u6027\u90fd\u662f\u82f1\u6587\u7b80\u5199\uff0c\u6211\u4eec\u5f88\u96be\u628ajson\u4e2dkey\u4e0e\u5b9e\u9645\u7684\u5c5e\u6027\u5bf9\u5e94\u8d77\u6765\uff0c\u6240\u4ee5\u6709\u4e86\u7b2c\u4e8c\u4e2a\u53c2\u6570<\/p>\n

LottieProperty<\/p>\n

\uff0c\u5b83\u7684\u5185\u90e8\u5b9a\u4e49\u4e86\u5927\u91cf\u7684\u5c5e\u6027\uff0c\u5f53\u6211\u4eec\u9700\u8981\u4fee\u6539json\u65f6\uff0c\u53ea\u9700\u8981\u4f20\u5165<\/p>\n

LottieProperty<\/p>\n

\u4e2d\u5c5e\u6027\u5373\u53ef\u3002<\/p>\n

\u4f8b\u5982\uff0c\u9700\u8981\u76d1\u542cjson\u4e2d<\/p>\n

LeftArmWave<\/p>\n

\u7684\u6301\u7eed\u65f6\u95f4\uff0c\u5c31\u53ef\u4ee5\u8fd9\u4e48\u5199<\/p>\n

animationView<\/span>.<\/span>addValueCallback<\/span>(<\/span>KeyPath<\/span>(<\/span>“LeftArmWave”<\/span>),<\/span>LottieProperty<\/span>.<\/span>TIME_REMAP<\/span>)<\/span>{<\/span>frameInfo<\/span>->\n\n }<\/span>\n <\/div>\n

4.Lottie\u7684\u5e38\u89c1\u7528\u6cd5<\/h3>\n

Lottie\u7684Demo\u4e2d\u5185\u7f6e\u4e86\u5f88\u591a\u5b98\u65b9\u81ea\u5df1\u5f00\u53d1\u7684\u52a8\u753b\u6548\u679c\uff0c\u76ee\u7684\u662f\u4e3a\u6211\u4eec\u5c55\u793aLottie\u7684\u5e38\u89c1\u7528\u6cd5\uff0c\u4f5c\u4e3a\u5f00\u53d1\u8005\u6211\u4eec\u5fc5\u987b\u638c\u63e1\uff0c\u5e76\u5728\u9002\u5f53\u7684\u65f6\u5019\u8fd0\u7528\u5230\u6211\u4eec\u7684\u5e94\u7528\u4e2d\u3002<\/p>\n

\u52a8\u6001\u5c5e\u6027\u6548\u679c<\/h3>\n

\u8be5\u6548\u679c\u5c55\u793a\u4e86lottie\u652f\u6301\u52a8\u6001\u4fee\u6539json\uff0c\u8ba9\u52a8\u753b\u4e2d\u7684\u4e00\u5c0f\u90e8\u5206\u5c5e\u6027\u53d1\u751f\u6539\u53d8\u3002<\/p>\u4fee\u6539\u5c40\u90e8\u52a8\u753b\u7684\u901f\u5ea6

binding<\/span>.<\/span>animationView<\/span>.<\/span>addValueCallback<\/span>(<\/span>KeyPath<\/span>(<\/span>“LeftArmWave”<\/span>),<\/span>LottieProperty<\/span>.<\/span>TIME_REMAP<\/span>)<\/span>{<\/span>frameInfo<\/span>->\n 2<\/span>*<\/span>speed<\/span>.<\/span>toFloat<\/span>()<\/span>*<\/span>frameInfo<\/span>.<\/span>overallProgress<\/span>}<\/span>\n <\/div>\n

KeyPath\u4e2d\u7684LeftArmWave\u662fJson\u4e2d\u7684\u4e00\u4e2a\u5c5e\u6027<\/p>\n

\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe7\"<\/div>img

\u4fee\u6539\u7684\u6548\u679c\u5982\u4e0b\u3002\u6ce8\u610f\u770b\u53f3\u624b\u7684\u6446\u52a8\u9891\u7387X3\u540e\u6bd4X1\u9ad8\uff0c\u4ee5\u81f3\u4e8e\u5f55\u5236\u7684GIF\u76f4\u63a5\u4e22\u5e27\u4e86\u3002<\/p>\n

\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe8\"<\/div>\u4fee\u6539\u5c40\u90e8\u52a8\u753b\u7684\u989c\u8272
val<\/span> shirt<\/span> =<\/span> KeyPath<\/span>(<\/span>“Shirt”<\/span>,<\/span> “Group 5”<\/span>,<\/span> “Fill 1”<\/span>)<\/span>\n val<\/span> leftArm<\/span> =<\/span> KeyPath<\/span>(<\/span>“LeftArmWave”<\/span>,<\/span> “LeftArm”<\/span>,<\/span> “Group 6”<\/span>,<\/span> “Fill 1”<\/span>)<\/span>\n val<\/span> rightArm<\/span> =<\/span> KeyPath<\/span>(<\/span>“RightArm”<\/span>,<\/span> “Group 6”<\/span>,<\/span> “Fill 1”<\/span>)<\/span>\n\n binding<\/span>.<\/span>animationView<\/span>.<\/span>addValueCallback<\/span>(<\/span>shirt<\/span>,<\/span> LottieProperty<\/span>.<\/span>COLOR<\/span>)<\/span> {<\/span> COLORS<\/span>[<\/span>colorIndex<\/span>]<\/span> }<\/span>\n binding<\/span>.<\/span>animationView<\/span>.<\/span>addValueCallback<\/span>(<\/span>leftArm<\/span>,<\/span> LottieProperty<\/span>.<\/span>COLOR<\/span>)<\/span> {<\/span> COLORS<\/span>[<\/span>colorIndex<\/span>]<\/span> }<\/span>\n binding<\/span>.<\/span>animationView<\/span>.<\/span>addValueCallback<\/span>(<\/span>rightArm<\/span>,<\/span> LottieProperty<\/span>.<\/span>COLOR<\/span>)<\/span> {<\/span> COLORS<\/span>[<\/span>colorIndex<\/span>]<\/span> }<\/span>\n <\/div>\n

\u4fee\u6539\u540e\u7684\u6548\u679c\u5982\u4e0b<\/p>\n

\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe9\"<\/div>\u4fee\u6539\u5c40\u90e8\u52a8\u753b\u7684\u8fd0\u52a8\u8303\u56f4
val<\/span> point<\/span> =<\/span> PointF<\/span>()<\/span>\n binding<\/span>.<\/span>animationView<\/span>.<\/span>addValueCallback<\/span>(<\/span>\n KeyPath<\/span>(<\/span>“Body”<\/span>),<\/span>\n LottieProperty<\/span>.<\/span>TRANSFORM_POSITION<\/span>\n )<\/span> {<\/span> frameInfo<\/span> -><\/span>\n val<\/span> startX<\/span> =<\/span> frameInfo<\/span>.<\/span>startValue<\/span>.<\/span>x<\/span>\n var<\/span> startY<\/span> =<\/span> frameInfo<\/span>.<\/span>startValue<\/span>.<\/span>y<\/span>\n var<\/span> endY<\/span> =<\/span> frameInfo<\/span>.<\/span>endValue<\/span>.<\/span>y<\/span>\n\n if<\/span> (<\/span>startY<\/span> ><\/span> endY<\/span>)<\/span> {<\/span>\n startY<\/span> +=<\/span> EXTRA_JUMP<\/span>[<\/span>extraJumpIndex<\/span>]<\/span>\n }<\/span> else<\/span> if<\/span> (<\/span>endY<\/span> ><\/span> startY<\/span>)<\/span> {<\/span>\n endY<\/span> +=<\/span> EXTRA_JUMP<\/span>[<\/span>extraJumpIndex<\/span>]<\/span>\n }<\/span>\n point<\/span>.<\/span>set<\/span>(<\/span>startX<\/span>,<\/span> lerp<\/span>(<\/span>startY<\/span>,<\/span> endY<\/span>,<\/span> frameInfo<\/span>.<\/span>interpolatedKeyframeProgress<\/span>))<\/span>\n point<\/span>\n }<\/span>\n <\/div>\n

\u4fee\u6539\u540e\u7684\u6548\u679c\u5982\u4e0b<\/p>\n

\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe10\"<\/div>\n

\u52a8\u753b\u6587\u5b57\u6548\u679c<\/h3>\n
\n
\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe11\"<\/div>\n <\/div>img

\u8be5\u6548\u679c\u5c55\u793a\u4e86\u52a8\u753b\u6587\u5b57\u6548\u679c\u3002\u8fd9\u4e2a\u6548\u679c\u5b9e\u73b0\u8d77\u6765\u5176\u5b9e\u4e0d\u96be\uff0c\u4ece\u7a0b\u5e8f\u4e2d\u6355\u83b7\u8f93\u5165\u7684\u5b57\u6bcd\uff0c\u518d\u66ff\u6362\u6210lottie\u7684\u8d44\u6e90\u6587\u4ef6\u5373\u53ef\u3002<\/p>\n

val<\/span> letter<\/span> =<\/span> “”<\/span> +<\/span> Character<\/span>.<\/span>toUpperCase<\/span>(<\/span>event<\/span>.<\/span>unicodeChar<\/span>.<\/span>toChar<\/span>())<\/span>\n val<\/span> fileName<\/span> =<\/span> “Mobilo\/$letter.json”<\/span>\n LottieCompositionFactory<\/span>.<\/span>fromAsset<\/span>(<\/span>context<\/span>,<\/span> fileName<\/span>)<\/span>\n .<\/span>addListener<\/span> {<\/span> addComposition<\/span>(<\/span>it<\/span>)<\/span> }<\/span>\n <\/div>\n

\u52a8\u6001\u6587\u5b57\u6548\u679c<\/h3>\n
\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe12\"<\/div>\n

\u8be5\u6548\u679c\u5c55\u793a\u52a8\u6001\u66ff\u6362\u52a8\u753b\u4e2d\u7684\u6587\u5b57\u3002\u4f7f\u7528\u5c31\u53ef\u4ee5\u5728\u52a8\u753b\u8fd0\u884c\u4e2d\u4fee\u6539lottie\u52a8\u753b\u4e2d\u7684\u6587\u5b57<\/p>\n

val<\/span> textDelegate<\/span> =<\/span> TextDelegate<\/span>(<\/span>binding<\/span>.<\/span>dynamicTextView<\/span>)<\/span>\n binding<\/span>.<\/span>nameEditText<\/span>.<\/span>addTextChangedListener<\/span>(<\/span>object<\/span> : <\/span>TextWatcher<\/span> {<\/span>\n override<\/span> fun<\/span> afterTextChanged<\/span>(<\/span>s<\/span>:<\/span> Editable<\/span>?)<\/span> {<\/span>\n textDelegate<\/span>.<\/span>setText<\/span>(<\/span>“NAME”<\/span>,<\/span> s<\/span>.<\/span>toString<\/span>())<\/span>\n }<\/span>\n\n override<\/span> fun<\/span> beforeTextChanged<\/span>(<\/span>s<\/span>:<\/span> CharSequence<\/span>?,<\/span> start<\/span>:<\/span> Int<\/span>,<\/span> count<\/span>:<\/span> Int<\/span>,<\/span> after<\/span>:<\/span> Int<\/span>)<\/span> {}<\/span>\n\n override<\/span> fun<\/span> onTextChanged<\/span>(<\/span>s<\/span>:<\/span> CharSequence<\/span>?,<\/span> start<\/span>:<\/span> Int<\/span>,<\/span> before<\/span>:<\/span> Int<\/span>,<\/span> count<\/span>:<\/span> Int<\/span>)<\/span> {}<\/span>\n })<\/span>\n binding<\/span>.<\/span>dynamicTextView<\/span>.<\/span>setTextDelegate<\/span>(<\/span>textDelegate<\/span>)<\/span>\n <\/div>\n

\u6ce8\u610f\uff0c\u8fd9\u91cc\u5176\u5b9e\u7528\u4e86\u4e24\u4e2alottieView\uff0c\u5206\u522b\u8bbe\u5b9a\u4e86\u4e0d\u540c\u7684\u6587\u5b57\u3002<\/p>\n

<LinearLayout<\/span>\n android:layout_width=<\/span>“match_parent”<\/span>\n android:layout_height=<\/span>“wrap_content”<\/span>\n android:layout_gravity=<\/span>“center_horizontal”<\/span>\n android:orientation=<\/span>“horizontal”<\/span>><\/span>\n\n <com.airbnb.lottie.LottieAnimationView<\/span>\n android:id=<\/span>“@+id\/originalTextView”<\/span>\n android:layout_width=<\/span>“wrap_content”<\/span>\n android:layout_height=<\/span>“wrap_content”<\/span>\n android:layout_marginRight=<\/span>“16dp”<\/span>\n app:lottie_rawRes=<\/span>“@raw\/name”<\/span>\n app:lottie_autoPlay=<\/span>“true”<\/span>\n app:lottie_loop=<\/span>“true”<\/span>\/><\/span>\n\n <com.airbnb.lottie.LottieAnimationView<\/span>\n android:id=<\/span>“@+id\/dynamicTextView”<\/span>\n android:layout_width=<\/span>“wrap_content”<\/span>\n android:layout_height=<\/span>“wrap_content”<\/span>\n app:lottie_rawRes=<\/span>“@raw\/name”<\/span>\n app:lottie_autoPlay=<\/span>“true”<\/span>\n app:lottie_loop=<\/span>“true”<\/span>\/><\/span>\n <\/LinearLayout><\/span>\n <\/div>\n

\u624b\u52bf\u4ea4\u4e92\u6548\u679c<\/h3>\n
\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe13\"<\/div>\n

\u8be5\u6548\u679c\u5c55\u793a\u4e86Lottie\u7684\u624b\u52bf\u4ea4\u4e92\u3002\u5176\u5b9e\u548c\u7b2c\u4e00\u4e2a\u6548\u679c\u5b9e\u73b0\u601d\u8def\u76f8\u540c\uff0c\u90fd\u662f\u901a\u8fc7\u4fee\u6539json\u4e2d\u7684\u5c5e\u6027\u6765\u5b9e\u73b0\u7684\u3002<\/p>\n

override<\/span> fun<\/span> onCreate<\/span>(<\/span>savedInstanceState<\/span>:<\/span> Bundle<\/span>?)<\/span> {<\/span>\n super<\/span>.<\/span>onCreate<\/span>(<\/span>savedInstanceState<\/span>)<\/span>\n\n val<\/span> largeValueCallback<\/span> =<\/span> LottieRelativePointValueCallback<\/span>(<\/span>PointF<\/span>(<\/span>0f<\/span>,<\/span> 0f<\/span>))<\/span>\n binding<\/span>.<\/span>animationView<\/span>.<\/span>addValueCallback<\/span>(<\/span>KeyPath<\/span>(<\/span>“First”<\/span>),<\/span> LottieProperty<\/span>.<\/span>TRANSFORM_POSITION<\/span>,<\/span> largeValueCallback<\/span>)<\/span>\n\n val<\/span> mediumValueCallback<\/span> =<\/span> LottieRelativePointValueCallback<\/span>(<\/span>PointF<\/span>(<\/span>0f<\/span>,<\/span> 0f<\/span>))<\/span>\n binding<\/span>.<\/span>animationView<\/span>.<\/span>addValueCallback<\/span>(<\/span>KeyPath<\/span>(<\/span>“Fourth”<\/span>),<\/span> LottieProperty<\/span>.<\/span>TRANSFORM_POSITION<\/span>,<\/span> mediumValueCallback<\/span>)<\/span>\n\n val<\/span> smallValueCallback<\/span> =<\/span> LottieRelativePointValueCallback<\/span>(<\/span>PointF<\/span>(<\/span>0f<\/span>,<\/span> 0f<\/span>))<\/span>\n binding<\/span>.<\/span>animationView<\/span>.<\/span>addValueCallback<\/span>(<\/span>KeyPath<\/span>(<\/span>“Seventh”<\/span>),<\/span> LottieProperty<\/span>.<\/span>TRANSFORM_POSITION<\/span>,<\/span> smallValueCallback<\/span>)<\/span>\n\n var<\/span> totalDx<\/span> =<\/span> 0f<\/span>\n var<\/span> totalDy<\/span> =<\/span> 0f<\/span>\n\n val<\/span> viewDragHelper<\/span> =<\/span> ViewDragHelper<\/span>.<\/span>create<\/span>(<\/span>binding<\/span>.<\/span>containerView<\/span>,<\/span> object<\/span> : <\/span>ViewDragHelper<\/span>.<\/span>Callback<\/span>()<\/span> {<\/span>\n override<\/span> fun<\/span> tryCaptureView<\/span>(<\/span>child<\/span>:<\/span> View<\/span>,<\/span> pointerId<\/span>:<\/span> Int<\/span>)<\/span> =<\/span> child<\/span> ==<\/span> binding<\/span>.<\/span>targetView<\/span>\n\n override<\/span> fun<\/span> clampViewPositionVertical<\/span>(<\/span>child<\/span>:<\/span> View<\/span>,<\/span> top<\/span>:<\/span> Int<\/span>,<\/span> dy<\/span>:<\/span> Int<\/span>):<\/span> Int<\/span> {<\/span>\n return<\/span> top<\/span>\n }<\/span>\n\n override<\/span> fun<\/span> clampViewPositionHorizontal<\/span>(<\/span>child<\/span>:<\/span> View<\/span>,<\/span> left<\/span>:<\/span> Int<\/span>,<\/span> dx<\/span>:<\/span> Int<\/span>):<\/span> Int<\/span> {<\/span>\n return<\/span> left<\/span>\n }<\/span>\n\n override<\/span> fun<\/span> onViewPositionChanged<\/span>(<\/span>changedView<\/span>:<\/span> View<\/span>,<\/span> left<\/span>:<\/span> Int<\/span>,<\/span> top<\/span>:<\/span> Int<\/span>,<\/span> dx<\/span>:<\/span> Int<\/span>,<\/span> dy<\/span>:<\/span> Int<\/span>)<\/span> {<\/span>\n totalDx<\/span> +=<\/span> dx<\/span>\n totalDy<\/span> +=<\/span> dy<\/span>\n smallValueCallback<\/span>.<\/span>setValue<\/span>(<\/span>getPoint<\/span>(<\/span>totalDx<\/span>,<\/span> totalDy<\/span>,<\/span> 1.2f<\/span>))<\/span>\n mediumValueCallback<\/span>.<\/span>setValue<\/span>(<\/span>getPoint<\/span>(<\/span>totalDx<\/span>,<\/span> totalDy<\/span>,<\/span> 1f<\/span>))<\/span>\n largeValueCallback<\/span>.<\/span>setValue<\/span>(<\/span>getPoint<\/span>(<\/span>totalDx<\/span>,<\/span> totalDy<\/span>,<\/span> 0.75f<\/span>))<\/span>\n }<\/span>\n })<\/span>\n\n binding<\/span>.<\/span>containerView<\/span>.<\/span>viewDragHelper<\/span> =<\/span> viewDragHelper<\/span>\n }<\/span>\n <\/div>\n

\u5728RecyclerView\u4e2d\u4f7f\u7528<\/h3>\n
\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe14\"<\/div>\n

\u8be5\u6548\u679c\u5c55\u793a\u901a\u8fc7\u76d1\u542c\u70b9\u51fb\u4e8b\u4ef6\u6765\u64ad\u653e\u4e0d\u540c\u7684lottie\u52a8\u753b\u3002\u8fd9\u4e2a\u6548\u679c\u6700\u5e38\u89c1\uff0cAPP\u4e2d\u7684\u70b9\u8d5e\u6548\u679c\u5927\u591a\u90fd\u662f\u8fd9\u6837\u7684\u5b9e\u73b0\u601d\u8def\u3002<\/p>\n

\u4ee5\u4e0a\u5c31\u662f\u8f66\u8f7dHMI\u2014Lottie\u7684\u4e00\u4e9b\u8bb2\u89e3\u3002\u66f4\u591a\u6709\u5173\u8f66\u8f7d\u53ef\u4ee5\u53c2\u8003BYD\u9ad8\u5de5\u6574\u7406\u51fa\u7684\u300a\u8f66\u8f7d\u6280\u672f\u5f00\u53d1\u624b\u518c\u300b\uff0c\u5e02\u9762\u4e0a\u8f66\u8f7d\u6280\u672f\u8d44\u6599\u5c11\u4e4b\u53c8\u5c11\uff1b\u5e0c\u671b\u8fd9\u672c\u7535\u5b50\u624b\u518c\u80fd\u591f\u5e2e\u52a9\u5230\u4f60\u3002<\/p>\n

5.\u603b\u7ed3<\/h3>\n

\u5728\u8f66\u8f7dHMI\u5f00\u53d1\u4e2d\u5f80\u5f80\u6211\u4eec\u4f1a\u5728\u5b9e\u73b0\u3001\u8c03\u8bd5UI\u4e0a\u82b1\u8d39\u5927\u91cf\u7684\u65f6\u95f4\uff0c\u5982\u679c\u80fd\u591f\u7075\u6d3b\u7684\u8fd0\u7528Lottie\uff0c\u5c31\u53ef\u4ee5\u663e\u8457\u8282\u7701\u7a0b\u5e8f\u7684\u5f00\u53d1\u65f6\u95f4\u3002\u4f8b\u5982\uff0c\u5149\u5f71\u3001\u7c92\u5b50\u7b49\u7279\u6548\u867d\u7136\u53ef\u4ee5\u4e5f\u8003\u8651\u7528Kanzi\u7b493D\u5f15\u64ce\u5b9e\u73b0\uff0c\u4f46\u662f3D\u5f15\u64ce\u4f1a\u6d88\u8017\u6210\u500d\u7684SOC\u6027\u80fd\uff0c\u5b9e\u9645\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u7b80\u5355\u7684\u7279\u6548\u4f7f\u7528Lottie\u5b9e\u73b0\uff0c\u53ef\u4ee5\u6781\u5927\u7684\u4f18\u5316\u5e94\u7528\u7684\u6027\u80fd\uff0c\u7ed9\u7528\u6237\u4e00\u4e2a\u66f4\u4f18\u79c0\u7684\u4f53\u9a8c\u3002<\/p>\n

\u8be5\u6548\u679c\u5c55\u793a\u901a\u8fc7\u76d1\u542c\u70b9\u51fb\u4e8b\u4ef6\u6765\u64ad\u653e\u4e0d\u540c\u7684lottie\u52a8\u753b\u3002\u8fd9\u4e2a\u6548\u679c\u6700\u5e38\u89c1\uff0cAPP\u4e2d\u7684\u70b9\u8d5e\u6548\u679c\u5927\u591a\u90fd\u662f\u8fd9\u6837\u7684\u5b9e\u73b0\u601d\u8def\u3002<\/p>\n

\u8f6c\u8f7d\uff1ahttps:\/\/www.<\/span>jianshu.com\/p\/2388c72d5<\/span>aff<\/span><\/a><\/p>\n

\u4ee5\u4e0a\u5c31\u662f\u8f66\u8f7dHMI\u2014Lottie\u7684\u4e00\u4e9b\u8bb2\u89e3\u3002\u66f4\u591a\u6709\u5173\u8f66\u8f7d\u53ef\u4ee5\u53c2\u8003BYD\u9ad8\u5de5\u6574\u7406\u51fa\u7684\u300a\u8f66\u8f7d\u6280\u672f\u5f00\u53d1\u624b\u518c\u300b<\/a>\uff0c\u5e02\u9762\u4e0a\u8f66\u8f7d\u6280\u672f\u8d44\u6599\u5c11\u4e4b\u53c8\u5c11\uff1b\u5e0c\u671b\u8fd9\u672c\u7535\u5b50\u624b\u518c\u80fd\u591f\u5e2e\u52a9\u5230\u4f60\u3002<\/p>\n

\"Android\u8f66\u8f7dHMI\u2014Lottie\u8bb2\u89e3\u63d2\u56fe15\"<\/div>\n\n\n<\/p>\n","protected":false},"excerpt":{"rendered":"

1.\u524d\u8a00 \u591a\u5e74\u4ee5\u524d\u6c7d\u8f66\u8fd8\u662f\u4ee5\u673a\u68b0\u4eea\u8868\u4e3b\u4f53\u7684\u5e74\u4ee3\uff0c\u5404\u5927\u6c7d\u8f66\u4e3b\u673a\u5382\u5546\u5e76\u4e0d\u5341\u5206\u5173\u6ce8\u64cd\u4f5c\u7cfb\u7edfUI\u7684\u4ea4\u4e92\u529f\u80fd\uff0c\u4f46\u662f\u968f\u7740\u8f66\u8f7dSOC\u7b97\u529b\u7684\u4e0d\u65ad\u63d0\u9ad8\u4ee5\u53ca\u4e3b\u673a… <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[19],"tags":[],"class_list":["post-1652","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/posts\/1652"}],"collection":[{"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/comments?post=1652"}],"version-history":[{"count":1,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/posts\/1652\/revisions"}],"predecessor-version":[{"id":1653,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/posts\/1652\/revisions\/1653"}],"wp:attachment":[{"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/media?parent=1652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/categories?post=1652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/tags?post=1652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}