{"id":23433910,"url":"https://github.com/ioki-mobility/progressbutton","last_synced_at":"2025-04-13T01:20:35.201Z","repository":{"id":49842487,"uuid":"518175373","full_name":"ioki-mobility/ProgressButton","owner":"ioki-mobility","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-06T09:36:51.000Z","size":5427,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T10:28:15.062Z","etag":null,"topics":["android","hacktoberfest","jetpack-compose","kotlin"],"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/ioki-mobility.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-26T18:30:20.000Z","updated_at":"2025-04-06T09:36:49.000Z","dependencies_parsed_at":"2023-10-15T05:44:38.876Z","dependency_job_id":"162dcc5a-f30c-4db0-a7c7-cd8457e487f2","html_url":"https://github.com/ioki-mobility/ProgressButton","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioki-mobility%2FProgressButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioki-mobility%2FProgressButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioki-mobility%2FProgressButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioki-mobility%2FProgressButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ioki-mobility","download_url":"https://codeload.github.com/ioki-mobility/ProgressButton/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248651057,"owners_count":21139735,"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","hacktoberfest","jetpack-compose","kotlin"],"created_at":"2024-12-23T11:35:28.310Z","updated_at":"2025-04-13T01:20:35.177Z","avatar_url":"https://github.com/ioki-mobility.png","language":"Kotlin","readme":"# ProgressButton\n\n[![Build](https://github.com/ioki-mobility/ProgressButton/actions/workflows/build.yml/badge.svg)](https://github.com/ioki-mobility/ProgressButton/actions/workflows/build.yml)\n[![Maven Central](https://img.shields.io/maven-central/v/com.ioki.progressbutton/progressbutton?labelColor=%2324292E\u0026color=%233246c8)](https://central.sonatype.com/namespace/com.ioki.progressbutton)\n[![Snapshot](https://img.shields.io/nexus/s/com.ioki.progressbutton/progressbutton?labelColor=%2324292E\u0026color=%234f78ff\u0026server=https://s01.oss.sonatype.org)](https://s01.oss.sonatype.org/content/repositories/snapshots/com/ioki/progressbutton/)\n[![javadoc](https://javadoc.io/badge2/com.ioki.progressbutton/progressbutton/javadoc.svg?labelColor=%2324292E\u0026color=%236eaaff)](https://javadoc.io/doc/com.ioki.progressbutton/progressbutton) \n[![MIT](https://img.shields.io/badge/license-MIT-blue.svg?labelColor=%2324292E\u0026color=%23d11064)](https://github.com/ioki-mobility/ProgressButton/blob/main/LICENSE.md)\n\n## What?\n\nWe needed an Button that uses a progress state as background.\nAs we didn't found something like that in Jetpack Compose \nwe decided to build it on our own and open source it.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"art/demo.gif\" width=180 /\u003e\n\u003c/p\u003e\n\n## How?\n\nThe following creates a `ProgressButton` which starts the progress after 1 seconds while the\nprogress will take 10 seconds.\n\n```kotlin\nProgressButton(\n    modifier = Modifier,\n    startDelay = 1.seconds,\n    duration = 10.seconds,\n    onClick = {\n        // Do something on click \n    },\n    onFinished = {\n        // Do something after progress finished\n    }\n) {\n    Box(\n        modifier = Modifier\n            .padding(start = 26.dp, end = 26.dp)\n            .fillMaxSize(),\n        contentAlignment = Alignment.Center\n    ) {\n        Text(\"Hello World\")\n    }\n}\n```\n\nYou can also checkout\nthe [`SampleActivity`](sample/src/main/java/com/ioki/progressbutton/sample/SampleActivity.kt) \nfor more code snippets.\n\n## Docs\n\n```kotlin\nfun ProgressButton(\n    modifier: Modifier,\n    backgroundColor: Color = Color.Transparent,\n    progressColor: Color = MaterialTheme.colors.primary,\n    contentColor: Color = contentColorFor(progressColor),\n    contentColorDisabled: Color = MaterialTheme.colors.primaryVariant,\n    enabled: Boolean = true,\n    startDelay: Duration = Duration.ZERO,\n    duration: Duration = 10L.seconds,\n    restDuration: Duration = duration,\n    onClick: () -\u003e Unit = {},\n    onFinished: () -\u003e Unit = {},\n    content: @Composable () -\u003e Unit\n)\n```\n\n| Parameter            | Description                                                                    | \n|----------------------|--------------------------------------------------------------------------------|\n| Modifier             | Modifier to be applied to the button                                           |\n| backgroundColor      | The color *behind* the progress                                                |\n| progressColor        | The progress color which which will animate away after `duration` reaches zero |\n| contentColor         | Color of the content of the button                                             |\n| contentColorDisabled | Color of the content of the button when its disabled                           |\n| enabled              | Enables or disable the button                                                  |\n| startDelay           | An delay before the progress actually starts                                   |\n| duration             | The duration of the progress                                                   |\n| restDuration         | The duration which is left of `duration` to reach zero                         | \n| onClick              | Will be called when the button got clicked and `enabled` is `true`             |\n| onFinished           | Will be called when the `duration` reaches zero                                |\n| content              | The content of the button                                                      |\n\n## Download\n\nProgressButton is hosted on Maven Central.\nHere's how you include it in your gradle project:\n\n**Step 1.** Add the Maven Central repository to your build file:\n\n```groovy\nrepositories {\n    // Other repositories\n    mavenCentral()\n}\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eSnapshot versions can be download over the sonatype snapshot repository:\u003c/summary\u003e\n    \n```kotlin\nrepositories {\n    // Other repositories\n    maven(url = \"https://s01.oss.sonatype.org/content/repositories/snapshots\")\n}\n```\n\n\u003c/details\u003e\n\n**Step 2.** Add the dependency:\n\n```groovy\ndependencies {\n    implementation 'com.ioki.progressbutton:progressbutton:\u003clatest-version\u003e'\n}\n```\n\n## Releasing\n\n### Continuous release\n\nBy default, each merge to the `main` branch will create a new SNAPSHOT release. \nIf you want to use the latest and greatest use the SNAPSHOT version of the library.\nBut please be aware that they might contain bugs or behaviour changes.\n\nTo use the SNAPSHOT version you have to include the sonatype snapshot repository which in the *Download* section above.\n\n### Proper release\n\n1. Checkout `main` branch and pull latest changes.\n2. Add the changes to the top of the [`CHANGELOG.md`](CHANGELOG.md) file.\n3. Update the version in the [`progressbutton/build.gradle.kts`](progressbutton/build.gradle.kts)\n   file.\n4. Commit.\n    * `git commit -m \"Prepare next relaese\" .`\n5. Create a git tag with the version of the [`CHANGELOG.md`](CHANGELOG.md) and push.\n    * `git tag [X.Y.Z]`\n    * `git push origin [X.Y.Z]`\n6. Update the version [`progressbutton/build.gradle.kts`](progressbutton/build.gradle.kts) to the **next patch version** +`-SNAPSHOT`\n7. Commit and push the changes\n   * `git push origin main .`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioki-mobility%2Fprogressbutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fioki-mobility%2Fprogressbutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioki-mobility%2Fprogressbutton/lists"}