{"id":19773949,"url":"https://github.com/badoo/starbar","last_synced_at":"2025-04-30T18:32:37.417Z","repository":{"id":8622662,"uuid":"10266155","full_name":"badoo/StarBar","owner":"badoo","description":null,"archived":false,"fork":false,"pushed_at":"2013-05-24T12:48:19.000Z","size":3193,"stargazers_count":35,"open_issues_count":4,"forks_count":14,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-04-20T17:45:52.896Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/badoo.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}},"created_at":"2013-05-24T12:43:43.000Z","updated_at":"2023-04-27T21:05:38.000Z","dependencies_parsed_at":"2022-09-20T12:52:13.153Z","dependency_job_id":null,"html_url":"https://github.com/badoo/StarBar","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/badoo%2FStarBar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badoo%2FStarBar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badoo%2FStarBar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badoo%2FStarBar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badoo","download_url":"https://codeload.github.com/badoo/StarBar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224219555,"owners_count":17275477,"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-11-12T05:11:34.900Z","updated_at":"2024-11-12T05:11:35.672Z","avatar_url":"https://github.com/badoo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"StarBar\n========\n\nA custom View class implementing a rating bar with 10 stars. The user can touch or swipe to select a rating between 1 and 10.\nThe StarBar supports three rating ranges (red, yellow and green) that are indicated by different colored stars.\n\n![Screenshot](starbar-screenshot.png)\n\nUsage\n-----\n_For a working example of how to use StarBar see the Android project in the **sample** folder_.\n\n**1. Including the StarBar library project**\n\nStarBar is provided as an Android library project. See the Android developer website for information on how include and use library projects.\n\n[Referencing a Library Project](http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject)\n\n\u003cp\u003e\n**2. Add StarBar to your layout**\n    \u003cRelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:tools=\"http://schemas.android.com/tools\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\" \u003e\n    \n        \u003ccom.badoo.starbar.StarBar\n            android:id=\"@+id/starBar\"\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentBottom=\"true\" /\u003e\n    \n    \u003c/RelativeLayout\u003e\nThere are some restrictions on what you can specify for **layout_width** and **layout_height**.\n\n* **layout_width** must either be **match_parent** / **fill_parent** or fixed width.\n* **layout_height** must be **wrap_content**.\n\n\u003cp\u003e\n**3. Configuring rating ranges**\n\nStarBar has three rating ranges. These ranges control what colour should be used when\nthe rating stars are drawn. By default the following ranges are used:\n\n* 1-3: Red\n* 4-6: Yellow\n* 7-10: Green\n\nIf you want to override these are use different ranges it can be done by calling the following method in RatingBar.\n\n    public void setRanges(int yellow, int green)\n\n**Example:** To set the ranges to the defaults listed above use:\n\n    starBar.setRanges(4, 7);\n\n\u003cp\u003e\n**4. Setting a listener to handle rating callbacks**\n\nAfter adding the StarBar to your layout it should already work but it will not do anything when the user picks a rating.\n\n    StarBar starBar = (StarBar) findViewById(R.id.starBar);\n    starBar.setOnRatingSliderChangeListener(new OnRatingSliderChangeListener() {\n\n        @Override\n        public boolean onStartRating() {\n            // The user has initiated a rating by touching the StarBar. This call will\n            // immediately followed by a call to onPendingRating with the initial rating\n            // value.   \n        }\n    \n        @Override\n        public void onPendingRating(int rating) {\n            // This method will first be called when the user initiates a rating and then\n            // subsequently as the rating is updated (by the user swiping his finger along \n            // the bar).\n        }\n    \n        @Override\n        public void onFinalRating(int rating, boolean swipe) {\n            // If the rating is completed successfully onFinalRating is called with the\n            // final result. The swipe parameter specifies if the rating was done using\n            // a tap (false) or a swipe (true).\n        }\n    \n        @Override\n        public void onCancelRating() {\n            // Called if the user cancels the rating by swiping away from the StarBar and releasing.\n        }\n    });\n\nCredits\n-------\n\nStarBar is is brought to you by [Badoo Trading Limited](http://corp.badoo.com) and it is released under the [MIT License](http://copyfree.org/licenses/mit/license.txt).\n\nCreated by [Erik Andre](http://www.linkedin.com/pub/erik-andr%C3%A9/7/252/484)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadoo%2Fstarbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadoo%2Fstarbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadoo%2Fstarbar/lists"}