{"id":13643398,"url":"https://github.com/czy1121/noticeview","last_synced_at":"2025-04-21T01:32:26.553Z","repository":{"id":199057618,"uuid":"72279841","full_name":"czy1121/noticeview","owner":"czy1121","description":"滚动播放的公告控件","archived":true,"fork":false,"pushed_at":"2017-01-26T10:10:37.000Z","size":124,"stargazers_count":299,"open_issues_count":1,"forks_count":43,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-09T15:42:31.499Z","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":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/czy1121.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,"governance":null}},"created_at":"2016-10-29T11:03:30.000Z","updated_at":"2023-08-03T07:28:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"9659d689-addd-43db-9a14-c64ea7fa7eb9","html_url":"https://github.com/czy1121/noticeview","commit_stats":null,"previous_names":["czy1121/noticeview"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czy1121%2Fnoticeview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czy1121%2Fnoticeview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czy1121%2Fnoticeview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czy1121%2Fnoticeview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/czy1121","download_url":"https://codeload.github.com/czy1121/noticeview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982623,"owners_count":21355735,"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":"2024-08-02T01:01:46.858Z","updated_at":"2025-04-21T01:32:26.050Z","avatar_url":"https://github.com/czy1121.png","language":"Java","funding_links":[],"categories":["跑马灯"],"sub_categories":[],"readme":"# NoticeView [![](https://jitpack.io/v/czy1121/noticeview.svg)](https://jitpack.io/#czy1121/noticeview)\n \n滚动播放的公告控件  \n\n![noticeview](screenshot.png)\n\n## Gradle\n\n``` groovy\nrepositories { \n    maven { url \"https://jitpack.io\" }\n} \ndependencies {\n    compile 'com.github.czy1121:noticeview:1.1.0'\n}\n```\n    \n## Usage\n    \n**XML**\n\n``` xml \n\u003cezy.ui.view.NoticeView\n    android:id=\"@+id/notice\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"30dp\"\n    android:layout_margin=\"20dp\"\n    android:background=\"@drawable/bg_round\"\n    android:paddingLeft=\"10dp\"\n    android:paddingRight=\"10dp\" \n\n    app:nvIcon=\"@mipmap/notice\"\n    app:nvIconPadding=\"5dp\"\n    app:nvIconTint=\"@android:color/white\"\n    app:nvTextColor=\"#FFFFFFFF\"\n    app:nvTextGravity=\"left\"\n    app:nvTextSize=\"14sp\"\n    /\u003e\n\n\u003cezy.ui.view.NoticeView\n    android:id=\"@+id/notice2\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"30dp\"\n    android:layout_margin=\"20dp\"\n    android:background=\"@drawable/bg_round\"\n    android:paddingLeft=\"10dp\"\n    android:paddingRight=\"10dp\" \n\n    app:nvInterval=\"2000\"\n    app:nvTextColor=\"#FFFFFFFF\"\n    app:nvTextGravity=\"center\"\n    /\u003e\n``` \n\n**Java**\n\n``` \nvNotice = (NoticeView) findViewById(R.id.notice);\nvNotice.start(Arrays.asList(notices));\nvNotice.setOnClickListener(new View.OnClickListener() {\n    @Override\n    public void onClick(View v) {\n        Toast.makeText(MainActivity.this, notices[vNotice.getIndex()], Toast.LENGTH_SHORT).show();\n    }\n});\n```\n\n**属性**\n\n``` xml  \n\u003cdeclare-styleable name=\"NoticeView\"\u003e\n    \u003c!-- 图标 --\u003e\n    \u003cattr name=\"nvIcon\" format=\"reference\"/\u003e\n    \u003c!-- 图标与内容的间隙 --\u003e\n    \u003cattr name=\"nvIconPadding\" format=\"dimension\"/\u003e\n    \u003c!-- 图标颜色 --\u003e\n    \u003cattr name=\"nvIconTint\" format=\"color\"/\u003e\n\n    \u003c!-- 文本尺寸 --\u003e\n    \u003cattr name=\"nvTextSize\" format=\"dimension\"/\u003e\n    \u003c!-- 文本颜色 --\u003e\n    \u003cattr name=\"nvTextColor\" format=\"color\"/\u003e\n    \u003c!-- 文本最大行数 --\u003e\n    \u003cattr name=\"nvTextMaxLines\" format=\"integer\"/\u003e\n    \u003c!-- 文本对齐方式 --\u003e\n    \u003cattr name=\"nvTextGravity\" format=\"integer\"\u003e\n        \u003cenum name=\"left\" value=\"3\"/\u003e\n        \u003cenum name=\"center\" value=\"17\"/\u003e\n        \u003cenum name=\"right\" value=\"5\"/\u003e\n    \u003c/attr\u003e\n\n    \u003c!-- 切换动画间隔时间，毫秒 --\u003e\n    \u003cattr name=\"nvInterval\" format=\"integer\"/\u003e\n    \u003c!-- 切换动画持续时间，毫秒 --\u003e\n    \u003cattr name=\"nvDuration\" format=\"integer\"/\u003e\n\u003c/declare-styleable\u003e\n```\n \n\n## License\n\n```\nCopyright 2016 czy1121\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fczy1121%2Fnoticeview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fczy1121%2Fnoticeview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fczy1121%2Fnoticeview/lists"}