{"id":1091,"date":"2021-01-20T09:59:23","date_gmt":"2021-01-20T01:59:23","guid":{"rendered":"https:\/\/badgameshow.com\/fly\/?p=1091"},"modified":"2021-03-19T10:40:54","modified_gmt":"2021-03-19T02:40:54","slug":"android-view-animation%e8%a3%9c%e9%96%93%e5%8b%95%e7%95%ab%e6%95%99%e5%ad%b8","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/fly\/android-view-animation%e8%a3%9c%e9%96%93%e5%8b%95%e7%95%ab%e6%95%99%e5%ad%b8\/","title":{"rendered":"Android View Animation(\u88dc\u9593\u52d5\u756b)\u6559\u5b78"},"content":{"rendered":"<h1>Android View Animation(\u88dc\u9593\u52d5\u756b)\u6559\u5b78<\/h1>\n<ol>\n<li><a href=\"https:\/\/badgameshow.com\/fly\/android-view-animation\u88dc\u9593\u52d5\u756b\u6559\u5b78\/fly\/android\/#a\">\u5275\u5efaamin\u8cc7\u6599\u593e<\/a><\/li>\n<li><a href=\"https:\/\/badgameshow.com\/fly\/android-view-animation\u88dc\u9593\u52d5\u756b\u6559\u5b78\/fly\/android\/#b\">\u900f\u660e\u52d5\u756b<\/a><\/li>\n<li><a href=\"https:\/\/badgameshow.com\/fly\/android-view-animation\u88dc\u9593\u52d5\u756b\u6559\u5b78\/fly\/android\/#c\">\u5e73\u79fb\u52d5\u756b<\/a><\/li>\n<li><a href=\"https:\/\/badgameshow.com\/fly\/android-view-animation\u88dc\u9593\u52d5\u756b\u6559\u5b78\/fly\/android\/#d\">\u7e2e\u653e\u52d5\u756b<\/a><\/li>\n<li><a href=\"https:\/\/badgameshow.com\/fly\/android-view-animation\u88dc\u9593\u52d5\u756b\u6559\u5b78\/fly\/android\/#e\">\u65cb\u8f49\u52d5\u756b<\/a><\/li>\n<li><a href=\"https:\/\/badgameshow.com\/fly\/android-view-animation\u88dc\u9593\u52d5\u756b\u6559\u5b78\/fly\/android\/#f\">\u6df7\u5408\u52d5\u756b+\u63d2\u503c\u5668<\/a><\/li>\n<\/ol>\n<hr \/>\n<p><a id=\"a\"><\/a><\/p>\n<h4>1.\u5275\u5efaamin\u8cc7\u6599\u593e<\/h4>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/01\/wp_editor_md_275d3d5bf0df8fb2cb1859b713c5d473.jpg\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/01\/wp_editor_md_275d3d5bf0df8fb2cb1859b713c5d473.jpg\" alt=\"\" \/><\/a><\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/01\/wp_editor_md_fb56ccebb3d819e271e0926fb32eccfa.jpg\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/01\/wp_editor_md_fb56ccebb3d819e271e0926fb32eccfa.jpg\" alt=\"\" \/><\/a><\/p>\n<p><a id=\"b\"><\/a><\/p>\n<h4>2.\u900f\u660e\u52d5\u756b(anim_alpha)<\/h4>\n<h5>XML<\/h5>\n<pre><code class=\"language-XML line-numbers\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;set xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"&gt;\n    &lt;alpha\n        android:duration=\"1000\"\n        android:fromAlpha=\"1\"\n        android:repeatCount=\"-1\"\n        android:repeatMode=\"reverse\"\n        android:toAlpha=\"0\" \/&gt;\n&lt;\/set&gt;\n<\/code><\/pre>\n<pre><code class=\"language-Kotlin line-numbers\">val animation = AnimationUtils.loadAnimation(this, R.anim.anim_alpha)\nicon.startAnimation(animation)\n<\/code><\/pre>\n<hr \/>\n<h5>\u7a0b\u5f0f\u78bc<\/h5>\n<pre><code class=\"language-Kotlin line-numbers\">val alphaAnimation = AlphaAnimation(0f, 1f)\nalphaAnimation.duration = 1000\nalphaAnimation.repeatCount = INFINITE\nalphaAnimation.repeatMode = REVERSE\nicon.startAnimation(alphaAnimation)\n<\/code><\/pre>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/03\/alpha.gif\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/03\/alpha-138x300.gif\" alt=\"\" \/><\/a><\/p>\n<p><a id=\"c\"><\/a><\/p>\n<h4>3.\u5e73\u79fb\u52d5\u756b(anim_translate)<\/h4>\n<h5>XML<\/h5>\n<pre><code class=\"language-XML line-numbers\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;set xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"&gt;\n    &lt;translate\n        android:duration=\"1000\"\n        android:fromXDelta=\"0\"\n        android:fromYDelta=\"0\"\n        android:repeatCount=\"-1\"\n        android:repeatMode=\"reverse\"\n        android:toXDelta=\"400\"\n        android:toYDelta=\"400\" \/&gt;\n&lt;\/set&gt;\n<\/code><\/pre>\n<pre><code class=\"language-Kotlin line-numbers\">val animation = AnimationUtils.loadAnimation(this, R.anim.anim_translate)\nicon.startAnimation(animation)\n<\/code><\/pre>\n<hr \/>\n<h5>\u7a0b\u5f0f\u78bc<\/h5>\n<pre><code class=\"language-Kotlin line-numbers\">val translateAnimation = TranslateAnimation(0f, 400f,0f,400f)\ntranslateAnimation.duration = 1000\ntranslateAnimation.repeatCount = INFINITE\ntranslateAnimation.repeatMode = REVERSE\nicon.startAnimation(translateAnimation)\n<\/code><\/pre>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/03\/translate.gif\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/03\/translate-138x300.gif\" alt=\"\" \/><\/a><\/p>\n<p><a id=\"d\"><\/a><\/p>\n<h4>4.\u7e2e\u653e\u52d5\u756bXML(anim_scale)<\/h4>\n<h5>XML<\/h5>\n<pre><code class=\"language-XML line-numbers\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;set xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"&gt;\n    &lt;scale\n        android:duration=\"1000\"\n        android:fromXScale=\"1\"\n        android:fromYScale=\"1\"\n        android:pivotX=\"50%\"\n        android:pivotY=\"50%\"\n        android:repeatCount=\"-1\"\n        android:repeatMode=\"reverse\"\n        android:toXScale=\"3\"\n        android:toYScale=\"3\" \/&gt;\n&lt;\/set&gt;\n<\/code><\/pre>\n<pre><code class=\"language-Kotlin line-numbers\">val animation = AnimationUtils.loadAnimation(this, R.anim.anim_scale)\nicon.startAnimation(animation)\n<\/code><\/pre>\n<hr \/>\n<h5>\u7a0b\u5f0f\u78bc<\/h5>\n<pre><code class=\"language-Kotlin line-numbers\">val scaleAnimation = ScaleAnimation(\n    1f, 3f, 1f, 3f,\n    RELATIVE_TO_SELF, 0.5f,\n    RELATIVE_TO_SELF, 0.5f\n)\nscaleAnimation.duration = 1000\nscaleAnimation.repeatCount = INFINITE\nscaleAnimation.repeatMode = REVERSE\nicon.startAnimation(scaleAnimation)\n<\/code><\/pre>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/03\/scale.gif\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/03\/scale-138x300.gif\" alt=\"\" \/><\/a><\/p>\n<p><a id=\"e\"><\/a><\/p>\n<h4>5.\u65cb\u8f49\u52d5\u756bXML(anim_rotate)<\/h4>\n<h5>XML<\/h5>\n<pre><code class=\"language-XML line-numbers\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;set xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"&gt;\n    &lt;rotate\n        android:duration=\"1000\"\n        android:fromDegrees=\"0\"\n        android:pivotX=\"50%\"\n        android:pivotY=\"50%\"\n        android:repeatCount=\"-1\"\n        android:repeatMode=\"reverse\"\n        android:toDegrees=\"360\" \/&gt;\n&lt;\/set&gt;\n<\/code><\/pre>\n<pre><code class=\"language-Kotlin line-numbers\">val animation = AnimationUtils.loadAnimation(this, R.anim.anim_rotate)\nicon.startAnimation(animation)\n<\/code><\/pre>\n<hr \/>\n<h5>\u7a0b\u5f0f\u78bc<\/h5>\n<pre><code class=\"language-Kotlin line-numbers\">val rotateAnimation = RotateAnimation(0f, 360f,\n    RELATIVE_TO_SELF, 0.5f,\n    RELATIVE_TO_SELF, 0.5f)\nrotateAnimation.duration = 1000\nrotateAnimation.repeatCount = INFINITE\nrotateAnimation.repeatMode = REVERSE\nicon.startAnimation(rotateAnimation)\n<\/code><\/pre>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/03\/rotate.gif\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/03\/rotate-138x300.gif\" alt=\"\" \/><\/a><\/p>\n<p><a id=\"f\"><\/a><\/p>\n<h4>6.\u6df7\u5408\u52d5\u756b+\u63d2\u503c\u5668XML(anim_mix)<\/h4>\n<h5>XML<\/h5>\n<pre><code class=\"language-XML line-numbers\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;set xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    android:interpolator=\"@android:anim\/accelerate_interpolator\"&gt;\n    &lt;scale\n        android:duration=\"2000\"\n        android:fromXScale=\"1\"\n        android:fromYScale=\"1\"\n        android:pivotX=\"50%\"\n        android:pivotY=\"50%\"\n        android:repeatCount=\"-1\"\n        android:repeatMode=\"reverse\"\n        android:toXScale=\"2\"\n        android:toYScale=\"2\" \/&gt;\n    &lt;rotate\n        android:duration=\"2000\"\n        android:fromDegrees=\"0\"\n        android:pivotX=\"50%\"\n        android:pivotY=\"50%\"\n        android:repeatCount=\"-1\"\n        android:repeatMode=\"reverse\"\n        android:toDegrees=\"360\" \/&gt;\n&lt;\/set&gt;\n<\/code><\/pre>\n<pre><code class=\"language-Kotlin line-numbers\">val animation = AnimationUtils.loadAnimation(this, R.anim.anim_mix)\nicon.startAnimation(animation)\n<\/code><\/pre>\n<hr \/>\n<h5>\u7a0b\u5f0f\u78bc<\/h5>\n<pre><code class=\"language-Kotlin line-numbers\">val rotateAnimation = RotateAnimation(0f, 360f,\n    RELATIVE_TO_SELF, 0.5f,\n    RELATIVE_TO_SELF, 0.5f)\nrotateAnimation.duration = 2000\nrotateAnimation.repeatCount = INFINITE\nrotateAnimation.repeatMode = REVERSE\n\nval scaleAnimation = ScaleAnimation(1f, 2f,1f, 2f,\n    RELATIVE_TO_SELF, 0.5f,\n    RELATIVE_TO_SELF, 0.5f)\nscaleAnimation.duration = 2000\nscaleAnimation.repeatCount = INFINITE\nscaleAnimation.repeatMode = REVERSE\n\nval set = AnimationSet(true)\nset.interpolator = AccelerateInterpolator()\nset.addAnimation(scaleAnimation)\nset.addAnimation(rotateAnimation)\nicon.startAnimation(set)\n<\/code><\/pre>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/03\/mix.gif\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2021\/03\/mix-138x300.gif\" alt=\"\" \/><\/a><\/p>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Android View Animation(\u88dc\u9593\u52d5\u756b)\u6559\u5b78 \u5275\u5efaamin\u8cc7\u6599\u593e \u900f\u660e\u52d5\u756b \u5e73\u79fb\u52d5\u756b \u7e2e\u653e\u52d5\u756b &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[5],"tags":[13,29,15],"class_list":["post-1091","post","type-post","status-publish","format-standard","hentry","category-android","tag-android","tag-animation","tag-kotlin"],"_links":{"self":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts\/1091","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/comments?post=1091"}],"version-history":[{"count":13,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts\/1091\/revisions"}],"predecessor-version":[{"id":1283,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts\/1091\/revisions\/1283"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/media?parent=1091"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/categories?post=1091"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/tags?post=1091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}