{"id":13641773,"url":"https://github.com/chaossss/PianoView","last_synced_at":"2025-04-20T11:32:13.947Z","repository":{"id":92645002,"uuid":"49946208","full_name":"chaossss/PianoView","owner":"chaossss","description":"PianoView provides a ViewPager Indicator looks like piano's keyboard","archived":false,"fork":false,"pushed_at":"2017-04-17T09:12:02.000Z","size":128,"stargazers_count":238,"open_issues_count":1,"forks_count":39,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-03T01:24:44.175Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaossss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-01-19T10:48:50.000Z","updated_at":"2023-06-15T01:19:16.000Z","dependencies_parsed_at":"2023-03-02T08:45:33.011Z","dependency_job_id":null,"html_url":"https://github.com/chaossss/PianoView","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaossss%2FPianoView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaossss%2FPianoView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaossss%2FPianoView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaossss%2FPianoView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaossss","download_url":"https://codeload.github.com/chaossss/PianoView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223827684,"owners_count":17209827,"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:24.253Z","updated_at":"2025-04-20T11:32:13.935Z","avatar_url":"https://github.com/chaossss.png","language":"Java","readme":"# PianoView\n\n[English Version](README_ENGLISH.md)\n\nPianoView 能提供一个有趣的类似钢琴键盘的 ViewPager Indicator，即目前最美应用使用的控件。\n\n效果图：\n\n![](http://img.my.csdn.net/uploads/201601/22/1453434722_3349.gif)\n\n#Usage\n\n##Dependency\n\n###Min SDK：2.3.3\n\n###Add Dependency\n\n在项目的 build.gradle 里添加：\n\n```\ndependencies {\n    ...\n    compile 'com.github.chaossss:PianoView:1.0.1'\n}\n```\n\n##Customize PianoView\n\n目前还没有提供自定义的特性\n\n##Activity\n\n```java\npublic class MainActivity extends FragmentActivity implements PianoItemListener {\n    private PianoView pianoView;\n    private List\u003cString\u003e iconUrlList;\n    private PianoAdapter pianoAdapter;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        iconUrlList = new ArrayList\u003c\u003e();\n        pianoView = (PianoView) findViewById(R.id.piano_view);\n        pianoView.setScrollPianoStartDelayTime(400);\n        pianoView.setPianoItemListenerListener(this);\n\n        fetchData();\n        pianoView.showPianoAtPosition(0);\n    }\n\n    private void fetchData() {\n        for (int i = 0; i \u003c 10; i++) {\n            iconUrlList.add(\"http://img5.duitang.com/uploads/item/201409/07/20140907080946_d4QiL.jpeg\");\n        }\n        pianoAdapter = new PianoAdapter(this, pianoView);\n        pianoView.setAdapter(pianoAdapter);\n        pianoAdapter.addIconUrlList(iconUrlList);\n    }\n\n    @Override\n    public void onPianoItemSelected(int itemIndex) {\n        Toast.makeText(this, \"item \" + itemIndex + \" selected\", Toast.LENGTH_SHORT).show();\n        pianoView.showPianoAtPosition(itemIndex);\n    }\n\n    @Override\n    public void onStartSwipe() {\n    }\n}\n```\n\n##XML\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cRelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:background=\"#000000\"\u003e\n    \u003ccom.github.chaossss.pianoview.PianoView\n        android:id=\"@+id/piano_view\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentBottom=\"true\"/\u003e\n\u003c/RelativeLayout\u003e\n```\n\n##License\nCopyright (C) 2016 Cheelok\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","funding_links":[],"categories":["ViewPager"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaossss%2FPianoView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaossss%2FPianoView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaossss%2FPianoView/lists"}