{"id":13645295,"url":"https://github.com/LukeDeighton/WheelView","last_synced_at":"2025-04-21T13:32:42.255Z","repository":{"id":19070318,"uuid":"22297310","full_name":"LukeDeighton/WheelView","owner":"LukeDeighton","description":"An Android Widget for selecting items that rotate on a wheel.","archived":false,"fork":false,"pushed_at":"2019-01-28T15:28:31.000Z","size":3716,"stargazers_count":897,"open_issues_count":47,"forks_count":264,"subscribers_count":54,"default_branch":"master","last_synced_at":"2024-08-02T01:25:17.282Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LukeDeighton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-26T21:58:26.000Z","updated_at":"2024-08-02T01:25:17.282Z","dependencies_parsed_at":"2022-09-26T22:10:17.862Z","dependency_job_id":null,"html_url":"https://github.com/LukeDeighton/WheelView","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/LukeDeighton%2FWheelView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeDeighton%2FWheelView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeDeighton%2FWheelView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeDeighton%2FWheelView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukeDeighton","download_url":"https://codeload.github.com/LukeDeighton/WheelView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223867989,"owners_count":17216993,"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:02:33.111Z","updated_at":"2024-11-09T18:30:48.909Z","avatar_url":"https://github.com/LukeDeighton.png","language":"Java","readme":"Looking for maintainers\n---\n\nI'm no longer active on this project but I'll still focus on fixing crashing issues and review any code changes etc. \n\nWheelView\n=========\n\nWheelView is an Android library that allows drawables to be placed on a rotatable wheel. It behaves like a Circular ListView where items rotate rather than scroll vertically. It isn't limited by the number of items that can fit on the wheel since it will cycle through each adapter position when the wheel is rotated. It can be rotated at any angle and from any position.\n\nThe WheelView can be used as a way to select one item from a list. The `SelectionAngle` determines what position on the wheel is selected. You can also receive a callback for when an item is clicked, and whether it is selected. Have a look at the sample for a working example!\n\n![1]\n![2]\n\nNote - Frame rate is much better than these poorly converted gifs!\n\nSetup\n-----\n\nInclude this in build.gradle project dependencies:\n```groovy\ndependencies {\n    compile 'com.github.lukedeighton:wheelview:0.4.2'\n}\n```\n\nUsage\n-----\n\n1) Add a custom view in xml\n```xml\n\u003cRelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\u003e\n\n    \u003ccom.lukedeighton.wheelview.WheelView\n        android:id=\"@+id/wheelview\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        app:wheelColor=\"@color/grey_400\"\n        app:rotatableWheelDrawable=\"false\"\n        app:selectionAngle=\"90.0\"\n        app:wheelPosition=\"bottom\"\n        app:wheelOffsetY=\"60dp\"\n        app:repeatItems=\"true\"\n        app:wheelRadius=\"276dp\"\n        app:wheelItemCount=\"14\"\n        app:wheelPadding=\"13dp\"\n        app:wheelItemRadius=\"43dp\"/\u003e\n\u003c/RelativeLayout\u003e\n```\n\n2) Set a `WheelAdapter` similar to how you would set an adapter with a ListView\n```java\nwheelView.setAdapter(new WheelAdapter() {\n    @Override\n    public Drawable getDrawable(int position) {\n        //return drawable here - the position can be seen in the gifs above\n    }\n\n    @Override\n    public int getCount() {\n        //return the count\n    }\n});\n```\n\nPlease note that the `WheelAdapter` doesn't behave exactly like a `ListAdapter` since Drawables don't need to be recycled in comparison to Views where inflation is expensive. If you need to refresh the Adapter / Items then call `setAdapter` again.\n\nListeners\n---------\n\n1) A listener for when the closest item to the `SelectionAngle` changes.\n```java\nwheelView.setOnWheelItemSelectedListener(new WheelView.OnWheelItemSelectListener() {\n    @Override\n    public void onWheelItemSelected(WheelView parent,  Drawable itemDrawable, int position) {\n        //the adapter position that is closest to the selection angle and it's drawable\n    }\n});\n```\n\n2) A listener for when an item is clicked.\n```java\nwheelView.setOnWheelItemClickListener(new WheelView.OnWheelItemClickListener() {\n    @Override\n    public void onWheelItemClick(WheelView parent, int position, boolean isSelected) {\n        //the position in the adapter and whether it is closest to the selection angle\n    }\n});\n```\n\n3) A listener for when the wheel's angle is changed.\n```java\nwheelView.setOnWheelAngleChangeListener(new WheelView.OnWheelAngleChangeListener() {\n    @Override\n    public void onWheelAngleChange(float angle) {\n        //the new angle of the wheel\n    }\n});\n```\n\nAttributes\n----------\n\nThe WheelView is highly customisable with many attributes that can be set via xml or programmatically (recommend using xml as programmatically set attributes is half implemented at the moment). Here are the custom attributes that can be declared in xml:\n\n  * wheelDrawable\n  * wheelColor\n  * emptyItemDrawable\n  * emptyItemColor\n  * selectionDrawable\n  * selectionColor\n  * selectionPadding\n  * selectionAngle\n  * repeatItems\n  * wheelRadius\n  * wheelItemRadius\n  * rotatableWheelDrawable\n  * wheelOffsetX\n  * wheelOffsetY\n  * wheelItemCount\n  * wheelItemAngle\n  * wheelToItemDistance\n  * wheelPosition\n  * wheelPadding\n  * wheelItemTransformer\n  * selectionTransformer\n\nWheelItemTransformer\n--------------------\n\nDetermines the draw bounds of the `WheelItem` in relation to the selection angle.\n\n  * `SimpleItemTransformer` - All items are the same size\n  * `ScalingItemTransformer` - Items grow in size near to the selection angle\n\nFuture Goals\n------------\n\nConvert this project to use `LayoutManager` to replace Drawables with Views\n\nLicense\n-------\n\nApache License Version 2.0\nhttp://apache.org/licenses/LICENSE-2.0.txt\n\n[1]: ./Graphics/bottom_wheel.gif\n[2]: ./Graphics/center_wheel.gif\n","funding_links":[],"categories":["WheelView","Java","Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLukeDeighton%2FWheelView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLukeDeighton%2FWheelView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLukeDeighton%2FWheelView/lists"}