{"id":23897940,"url":"https://github.com/byteszero/tvoffanimation","last_synced_at":"2025-07-15T12:05:00.669Z","repository":{"id":29431128,"uuid":"32967060","full_name":"BytesZero/TVOffAnimation","owner":"BytesZero","description":"仿电视关闭的一个动画效果","archived":false,"fork":false,"pushed_at":"2015-04-15T05:04:56.000Z","size":2682,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-23T00:38:28.307Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"quantopian/pyfolio","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BytesZero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-27T04:08:27.000Z","updated_at":"2019-03-10T21:54:41.000Z","dependencies_parsed_at":"2022-09-05T23:51:29.575Z","dependency_job_id":null,"html_url":"https://github.com/BytesZero/TVOffAnimation","commit_stats":null,"previous_names":["byteszero/tvoffanimation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BytesZero/TVOffAnimation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FTVOffAnimation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FTVOffAnimation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FTVOffAnimation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FTVOffAnimation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BytesZero","download_url":"https://codeload.github.com/BytesZero/TVOffAnimation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2FTVOffAnimation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265434673,"owners_count":23764568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-04T17:19:14.654Z","updated_at":"2025-07-15T12:05:00.615Z","avatar_url":"https://github.com/BytesZero.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TVOffAnimation\n仿电视关闭的一个动画效果\n#仿电视关机效果的动画\n- **效果图**\n\n![这里写图片描述](https://github.com/yy1300326388/TVOffAnimation/blob/master/image/tvoffanimation.gif)\n\n- **主要代码**\n``` java\npackage com.zhengsonglan.tvanimation;\n\nimport android.graphics.Matrix;\nimport android.view.animation.AccelerateDecelerateInterpolator;\nimport android.view.animation.Animation;\nimport android.view.animation.Transformation;\n\n/**\n * Created by zsl on 2015/3/27.\n */\npublic class TVOffAnimation extends Animation {\n    int halfWidth;\n    int halfHeight;\n\n    @Override\n    public void initialize(int width, int height, int parentWidth, int parentHeight) {\n        super.initialize(width, height, parentWidth, parentHeight);\n        //设置动画时间为700毫秒\n        setDuration(700);\n        //设置动画结束后就结束在动画结束的时刻\n        setFillAfter(true);\n        //保存View的中心点\n        halfWidth=width/2;\n        halfHeight=height/2;\n        //设置动画先加速后减速\n        setInterpolator(new AccelerateDecelerateInterpolator());\n    }\n\n    @Override\n    protected void applyTransformation(float interpolatedTime, Transformation t) {\n\n       \n        final Matrix matrix=t.getMatrix();\n        //interpolatedTime是从0~1的一个变化，所以我们前80%让动画缩小成一个线，后20%保持线的高度缩小线的宽度\n        if (interpolatedTime\u003c0.8){\n            matrix.preScale(1+0.625f*interpolatedTime,1-interpolatedTime/0.8f+0.01f,halfWidth,halfHeight);\n        }else{\n            matrix.setScale(7.5f*(1-interpolatedTime),0.01f,halfWidth,halfHeight);\n        }\n\n    }\n}\n\n```\n- **bolg地址**\n\n\u003e[点击这里，欢迎指正](http://blog.csdn.net/yy1300326388/article/details/44674219)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteszero%2Ftvoffanimation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyteszero%2Ftvoffanimation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteszero%2Ftvoffanimation/lists"}