{"id":13610445,"url":"https://github.com/kojofosu/Quantitizer","last_synced_at":"2025-04-12T22:33:52.409Z","repository":{"id":38783052,"uuid":"386936449","full_name":"kojofosu/Quantitizer","owner":"kojofosu","description":":sparkles: A quantity stepper for android projects","archived":false,"fork":false,"pushed_at":"2024-10-12T09:45:36.000Z","size":1358,"stargazers_count":188,"open_issues_count":5,"forks_count":18,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-28T14:46:13.243Z","etag":null,"topics":["android","ecommerce","kotlin","library","number","open-source","opensource","shop","stepper"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kojofosu.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,"roadmap":null,"authors":null}},"created_at":"2021-07-17T12:49:39.000Z","updated_at":"2024-10-12T09:45:40.000Z","dependencies_parsed_at":"2024-01-16T23:31:07.455Z","dependency_job_id":"2fbc40ad-4492-4a54-aa07-97632dbbf349","html_url":"https://github.com/kojofosu/Quantitizer","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojofosu%2FQuantitizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojofosu%2FQuantitizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojofosu%2FQuantitizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojofosu%2FQuantitizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kojofosu","download_url":"https://codeload.github.com/kojofosu/Quantitizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223549253,"owners_count":17163627,"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":["android","ecommerce","kotlin","library","number","open-source","opensource","shop","stepper"],"created_at":"2024-08-01T19:01:44.749Z","updated_at":"2024-11-07T16:31:16.555Z","avatar_url":"https://github.com/kojofosu.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# Quantitizer\n![Jit](https://img.shields.io/jitpack/v/github/kojofosu/Quantitizer?style=for-the-badge\u0026color=2F9319) \n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Quantitizer-green.svg?style=for-the-badge\u0026color=D35400)]( https://android-arsenal.com/details/1/8257 )\n\n[![Android Weekly](https://img.shields.io/badge/Featured%20in%20androidweekly.net%20-Issue%23479-blue?color=D35400\u0026style=for-the-badge)]( https://androidweekly.net/issues/issue-479)\n[![Kotlin Weekly](https://img.shields.io/badge/Featured%20in%20kotlinweekly.net.net%20-Issue%23265-blue?color=D35400\u0026style=for-the-badge)](https://mailchi.mp/kotlinweekly/kotlin-weekly-265)\n\n:sparkles: A highly customizable quantity stepper for android projects\n\n## Demo\n\u003cdiv align=\"left\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/20203694/132069805-e0ca2c3b-e1a9-469d-87b3-26104c7b9f8b.gif\" alt=\"demo\"  width=\"200\" height=\"350\"/\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/20203694/132068856-360e492e-95c0-4c66-be82-7895cab110c3.gif\" alt=\"demo\"  width=\"200\" height=\"350\"/\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/20203694/132069221-0b26598e-ef8c-4516-b008-18b08b3746f5.gif\" alt=\"demo\"  width=\"200\" height=\"350\"/\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/20203694/132069463-da915a19-007f-4c8e-a3ed-f8c6d443893e.gif\" alt=\"demo\"  width=\"200\" height=\"350\"/\u003e\n\u003c/div\u003e\n\n## Setup\n\nAdd it in your root `build.gradle` at the end of repositories:\n\n```groovy\nallprojects {\n    repositories {\n        //...omitted for brevity\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n\n\nAdd the dependency\n\n```groovy\ndependencies {\n   implementation \"com.github.kojofosu:Quantitizer:$latest_release\"\n}\n```\n\n## Usage\nSample implementation [here](app/)\n\n### Horizontal Quantitizer\n\n- Add `HorizontalQuantitizer` in your layout xml file\n\n\u003cdiv align=\"left\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/20203694/127779360-39fbcba6-ab72-4897-88ef-59573a005144.gif\" alt=\"demo\"  width=\"300\" /\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/20203694/127779355-c046c8fc-6b95-49f3-b018-5ba6ac38f568.gif\" alt=\"demo\"  width=\"300\" /\u003e\n\u003c/div\u003e\n\n```xml\n    \u003ccom.mcdev.quantitizerlibrary.HorizontalQuantitizer\n        android:id=\"@+id/h_q\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"/\u003e\n```\n\n### Vertical Quantitizer\n\n- Add `VerticalQuantitizer` in your layout xml file\n\u003cdiv align=\"left\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/20203694/127779363-fc5fa535-ceeb-44a7-982b-4630073893cf.gif\" alt=\"demo\"  width=\"300\" /\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/20203694/127779361-9850f052-1e06-46ba-b41d-65b96d099c33.gif\" alt=\"demo\"  width=\"300\" /\u003e\n\u003c/div\u003e\n\n```xml\n    \u003ccom.mcdev.quantitizerlibrary.VerticalQuantitizer\n        android:id=\"@+id/v_q\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"/\u003e\n```\n\n### No Value Quantitizer\n\n- Add `NoValueQuantitizer` in your layout xml file\n\u003cdiv align=\"left\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/20203694/131833618-b5165019-dfff-4100-9606-8a6a9c24b167.gif\" alt=\"demo\"  width=\"300\" /\u003e\n\u003c/div\u003e\n\n```xml\n    \u003ccom.mcdev.quantitizerlibrary.NoValueQuantitizer\n        android:id=\"@+id/n_q\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"/\u003e\n```\n\n#### Get quantity value\n```kotlin\n    var hQ: HorizontalQuantitizer = findViewById(R.id.h_q)\n    var selectedValue = hQ.value    //get current value\n```\n\n#### Listener\n```kotlin\n        hQ.setQuantitizerListener(object: QuantitizerListener{\n            override fun onIncrease() {\n                Toast.makeText(this@MainActivity, \"inc\", Toast.LENGTH_SHORT).show()\n            }\n\n            override fun onDecrease() {\n                Toast.makeText(this@MainActivity, \"dec\", Toast.LENGTH_SHORT).show()\n            }\n\n            override fun onValueChanged(value: Int) {\n                Toast.makeText(this@ButtonsOnlyActivity, \"value changed to : $value\", Toast.LENGTH_SHORT).show()\n            }\n        })\n```\n### Customize Quantitizer\n\n#### Change text/value animation style\n```kotlin\n    hQ.textAnimationStyle = AnimationStyle.SLIDE_IN\n```\n\n\n#### List of current animations\n\n| ANIMATION          | DEMO                                                         |\n| ------------------ | ------------------------------------------------------------ |\n| `FALL_IN`          | \u003cimg src=\"https://user-images.githubusercontent.com/20203694/132842523-4b5a6adb-dbe7-4626-9fd5-ae13b78790fb.gif\" alt=\"demo\"  width=\"300\"/\u003e |\n| `SLIDE_IN`         | \u003cimg src=\"https://user-images.githubusercontent.com/20203694/132842526-495e1db8-fe6f-4a42-8b4d-b466f57526d7.gif\" alt=\"demo\"  width=\"300\"/\u003e |\n| `SLIDE_IN_REVERSE` | \u003cimg src=\"https://user-images.githubusercontent.com/20203694/132842528-e2647e2b-35e6-439c-8cc9-c28358d29409.gif\" alt=\"demo\"  width=\"300\"/\u003e |\n| `SWING`            | \u003cimg src=\"https://user-images.githubusercontent.com/20203694/132842530-9fbc67c2-9379-4e2e-a13b-63bc7d4cbf89.gif\" alt=\"demo\"  width=\"300\"/\u003e |\n\n\n\n#### Disable button animations\n\n```kotlin\n    hQ.isReadOnly = false // Disable value input from keyboard. Default false\n```\n\n```kotlin\n    hQ.buttonAnimationEnabled = false //Default true\n```\n\u003cimg src=\"https://user-images.githubusercontent.com/20203694/132842534-9483a463-f7bb-4b6d-a622-03ac34172146.gif\" alt=\"demo\"  width=\"300\"/\u003e \u003cimg src=\"https://user-images.githubusercontent.com/20203694/132842537-964fcecf-5897-479a-9d3c-13e98cbaf01e.gif\" alt=\"demo\"  width=\"300\"/\u003e\n\n\n#### Change animation duration\n```kotlin\n    hQ.animationDuration = 400L //Default 300L\n```\n\n#### Change icons\n```kotlin\n    hQ.setPlusIcon(R.drawable.ic_angle_double_small_right)\n    hQ.setMinusIcon(R.drawable.ic_angle_double_small_left)\n```\n\n#### Change icon backgrounds\n```kotlin\n    hQ.setPlusIconBackgroundColor(android.R.color.holo_red_dark)\n    hQ.setMinusIconBackgroundColor(android.R.color.holo_red_dark)\n```\n\n#### Change value text and background color\n```kotlin\n    hQ.setValueBackgroundColor(android.R.color.holo_red_dark)\n    hQ.setValueTextColor(\"#FFFF00\")\n```\n\n#### Change icon colors\n```kotlin\n    hQ.setMinusIconColor(\"#FFFF00\")\n    hQ.setPlusIconColor(\"#FFFF00\")\n```\n\n#### Changing the Icon and it's color.\n```kotlin\n    changeShapeAndColorDecrease(Color.parseColor(\"#FF4500\"), R.drawable.heart_shape) \n    changeShapeAndColorIncrease(Color.parseColor(\"#1E90FF\"), R.drawable.shape_x)\n```\nusing these mthods inside the required component you will be able to change and customize the shape of the button according to you use \n```kotlin\n  hq.apply {}\n```\n\u003cimg width=\"301\" alt=\"image\" src=\"https://github.com/user-attachments/assets/78801b8e-0a9c-414e-bf52-813a950a65bf\"\u003e\n\n#### Use these below methods to change the font size of the Quantizer\nfor horizontal \n```\n changeTextSizeHorizontal(10f)\n```\nfor vertical\n```\n changeTextSizeVertical(50f)\n```\n\u003cimg width=\"184\" alt=\"image\" src=\"https://github.com/user-attachments/assets/5f83d778-9b65-451e-a457-26def8bb3667\"\u003e\n\n\n### Licensed under the [MIT License](LICENSE)\n\n```\nMIT License\n\nCopyright (c) 2021 Kojo Fosu Bempa Edue\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkojofosu%2FQuantitizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkojofosu%2FQuantitizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkojofosu%2FQuantitizer/lists"}