[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7562":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":15,"starSnapshotCount":15,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},7562,"LoadingButtonAndroid","leandroBorgesFerreira\u002FLoadingButtonAndroid","leandroBorgesFerreira","A button to substitute the ProgressDialog",null,"Kotlin",1958,210,30,58,0,1,19.97,"MIT License",false,"master",true,[],"2026-06-12 02:01:41","\u003Cp align=\"center\" width=\"100%\">\n  \u003Ca href=\"https:\u002F\u002Fsearch.maven.org\u002Fartifact\u002Fio.writeopia\u002Floading-button\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fmaven-central\u002Fv\u002Fio.writeopia\u002Floading-button\" alt=\"Maven Central\"\u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n# Progress Button Android\n\n![enter image description here](https:\u002F\u002Fi.stack.imgur.com\u002F8SHR1.gif)\n\nAndroid Button that morphs into a loading progress bar.\n\n  - Fully customizable in the XML\n  - Really simple to use.\n  - Makes your app looks cooler =D\n\nYou can check how this library was implemented here (Old version): https:\u002F\u002Fmedium.com\u002Fp\u002F9efee6e39711\u002F\n\n## Contents\n\n - [Installation](#installation)\n - [How to use \u002F Sample](#how-to-use)\n\t - [Animate and revert animation](#animate-and-revert-animation)\n\t -  [Show done animation](#show-done-animation)\n\t - [Revert the loading animation with different text or image](#revert-the-loading-animation-with-different-text-or-image)\n - [Configure XML](#configure-xml)\n - [Avoid Memory Leaks](#avoid-memory-leaks)\n - [Be Creative](#be-creative)\n - [Bugs and feedback](#bugs-and-feedback)\n - [Credits](#credits)\n\n## Installation \n\n```\nimplementation(\"io.writeopia:loading-button:3.0.0\")\n```\n\n## How to use\n\n### Animate and revert animation\n\nAdd the button in your layout file and customize it the way you like it.\n\n```xml\n\u003Ccom.github.leandroborgesferreira.loadingbutton.customViews.CircularProgressButton\n\tandroid:id=\"@+id\u002Fbtn_id\"\n\tandroid:layout_width=\"match_parent\"\n\tandroid:layout_height=\"wrap_content\"\n\tandroid:background=\"@drawable\u002Fcircular_border_shape\"\n\tapp:spinning_bar_width=\"4dp\" \u003C!-- Optional -->\n\tapp:spinning_bar_color=\"#FFF\" \u003C!-- Optional -->\n\tapp:spinning_bar_padding=\"6dp\" \u002F> \u003C!-- Optional -->\n```\n\nThen, instanciate the button\n\n```java\nCircularProgressButton btn = (CircularProgressButton) findViewById(R.id.btn_id)\nbtn.startAnimation();\n\n\u002F\u002F[do some async task. When it finishes]\n\u002F\u002FYou can choose the color and the image after the loading is finished\nbtn.doneLoadingAnimation(fillColor, bitmap);\n\n\u002F\u002F[or just revert de animation]\nbtn.revertAnimation();\n```\n\nYou can also add a callback to trigger an action after the startAnimation has finished resizing the button :\n\n```kotlin\nbtn.startAnimation {\n\t\u003Cstart async task>\n}\n```\n\n### Switch to determinant progress\nYou can switch between indeterminant and determinant progress:\n\n```java\ncircularProgressButton.setProgress(10)\n...\ncircularProgressButton.setProgress(50)\n...\ncircularProgressButton.setProgress(100)\n```\n\n### - Show 'done' animation\n\nWhen the loading animation is running, call:\n\n```java\n\u002F\u002FChoose the color and the image that will be show\ncircularProgressButton.doneLoadingAnimation(fillColor, bitmap);\n```\n\n### - Revert the loading animation with different text or image\n\n```kotlin\nprogressButton.revertAnimation {\n\tprogressButton.text = \"Some new text\"\n}\n```\n\nor\n\n```kotlin\nprogressImageButton.revertAnimation {\n\tprogressImageButton.setImageResource(R.drawable.image)\n}\n```\n\n### - Button State\n\nThis button is a state machine and it changes its state during the animation process. The states are:\n\n#### Before Draw\nThis state is the initial one, the button is in this state before the View is draw on the screen. This is the state when the button is accesed in the `onCreate()` of an Activity. \n\n#### Idle\nAfter the button is drawn in the screen, it gets in the `Idle` state. It is basically waiting for an animation. Call `startAnimation()` to start animations with this button.\n\n#### WAITING_PROGRESS\nIf the `startAnimation()` is called before the `Idle` state, the button goes to this state. The button waits for the button to be drawn in the screen before start the morph animation.\n\n#### MORPHING\nThe button stays in this state during the morphing animation.\n\n#### PROGRESS\nAfter the morph animation, the button start the progress animation. From this state the `done` and `revert` animations can happen.\n\n#### MORPHING_REVERT\nThe button stays in this state during the morphing animation reversal. \n\n#### WAITING_DONE\nIf the `doneLoadingAnimation(fillColor: Int, bitmap: Bitmap)` is called when the button is still morphing, it enter in this state. The button waits for the morph animation to complete and then start the done animation.\n\n#### DONE\nThe button enters this state when the `doneLoadingAnimation` finishes.\n\n#### WAITING\\_TO\\_STOP\nThe button enters this state when the `stopAnimation()` is called before the morph state is completed. The button waits for the morph animation to complete and the stops further animations. \n\n#### STOPPED\nThe button enters this state after `stopAnimation()` when the button is not morphing. \n\n## Configure XML\n\n - `app:spinning_bar_width` : Changes the width of the spinning bar inside the button\n - `app:spinning_bar_color`: Changes the color of the spinning bar inside the button\n - `app:spinning_bar_padding`: Changes the padding of the spinning bar in relation of the button bounds.\n - `app:initialCornerAngle`: The initial corner angle of the animation. Insert 0 if you have a square button.\n - `app:finalCornerAngle`: The final corner angle of the animation.\n\n## Problems and troubleshooting\n\n### Animation\nThis library only works with selector as the background, but not with shape as the root tag. Please put your shape inside a selector, like this:\n\n```\n\u003C?xml version=\"1.0\" encoding=\"utf-8\"?>\n\u003Cselector xmlns:android=\"http:\u002F\u002Fschemas.android.com\u002Fapk\u002Fres\u002Fandroid\">\n\u003Citem android:state_pressed=\"false\" android:state_selected=\"false\">\n    \u003Cshape android:shape=\"rectangle\">\n        \u003Ccorners android:radius=\"10dp\" \u002F>\n        \u003Csolid android:color=\"@android:color\u002Ftransparent\" \u002F>\n        \u003Cstroke android:width=\"3dp\"\n            android:color=\"@color\u002Fblack\"\u002F>\n    \u003C\u002Fshape>\n\u003C\u002Fitem>\n\u003C\u002Fselector>\n```\n*I still need to debug this problem.*\n  \n\n### Manifest merge\n\nThis library only supports androidx since prior the version 2.0.0. So don't try to use it with the old Support Library. Use androidx instead.\n\n### Avoid Memory Leaks\nPrior to version 2.1.0, to avoid memory leaks is your code, you must dispose the buttons in the onDestroy method. Example:\n\n```java\noverride fun onDestroy() {\n        super.onDestroy()\n\tprogressButton.dispose()\n}\n```\n\nIn version 2.1.0, `ProgressButton` was updated to be a `LifecycleObserver` and will automatically\ncall `dispose()` when an `onDestroy()` event is observed by the lifecycle owner.\n\n## Contributing\n###Setup Git Pre-commit hook script (Optional)\n\nThe purpose of setting up this optional pre-commit hook is so that the `lintKotlin` Gradle task runs each time you as a developer create a commit. Although the Travis build will run `lintKotlin` in the cloud, running this locally will allow you to catch Kotlin Lint violations early in the development cycle without having to wait for Travis's build report.\n\nTo enable the script, execute the following commands starting from the project's root directory:\n\n\tcd .git\u002Fhooks\n\tln -s ..\u002F..\u002Fscripts\u002Fpre-commit.sh pre-commit     \n\n## Bugs and Feedback\n\nFor bugs, feature requests, and discussion please use [GitHub Issues](https:\u002F\u002Fgithub.com\u002FleandroBorgesFerreira\u002FLoadingButtonAndroid\u002Fissues).\n\n## Credits\n\nThis library was inspired in this repo: https:\u002F\u002Fgithub.com\u002Fdmytrodanylyk\u002Fandroid-morphing-button\n\n### And that's it! Enjoy!\n****\n","LoadingButtonAndroid 是一个用于替代 ProgressDialog 的 Android 按钮库。其核心功能是在按钮点击后将其转换为加载进度条，支持自定义 XML 配置，并且非常易于使用。该库允许开发者通过简单的代码实现按钮与加载动画之间的平滑过渡，包括显示完成动画、切换确定性与不确定性进度以及在动画结束后改变按钮文本或图标等功能。适用于需要在执行异步任务时向用户提供视觉反馈的各种 Android 应用场景，如数据提交、文件上传等。",2,"2026-06-11 03:13:03","top_language"]