{"id":13396093,"url":"https://github.com/TheFinestArtist/MovingButton","last_synced_at":"2025-03-13T22:31:44.004Z","repository":{"id":27300682,"uuid":"30774637","full_name":"TheFinestArtist/MovingButton","owner":"TheFinestArtist","description":"Android button which moves in eight direction.","archived":false,"fork":false,"pushed_at":"2018-05-03T21:00:25.000Z","size":24800,"stargazers_count":132,"open_issues_count":3,"forks_count":23,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-05T23:32:09.330Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheFinestArtist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-13T20:27:43.000Z","updated_at":"2024-09-01T09:24:41.000Z","dependencies_parsed_at":"2022-08-26T22:41:16.575Z","dependency_job_id":null,"html_url":"https://github.com/TheFinestArtist/MovingButton","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/TheFinestArtist%2FMovingButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFinestArtist%2FMovingButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFinestArtist%2FMovingButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFinestArtist%2FMovingButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheFinestArtist","download_url":"https://codeload.github.com/TheFinestArtist/MovingButton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243493863,"owners_count":20299729,"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-07-30T18:00:39.859Z","updated_at":"2025-03-13T22:31:43.007Z","avatar_url":"https://github.com/TheFinestArtist.png","language":"Java","readme":"# Moving Button\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-MovingButton-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1537)\n[![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html)\n[![API](https://img.shields.io/badge/API-3%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=3)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](http://opensource.org/licenses/MIT)\n[![Join the chat at https://gitter.im/TheFinestArtist/MovingButton](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/TheFinestArtist/MovingButton?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nAndroid button which moves in eight direction.\n\n## Preview\n\n![Preview](https://github.com/thefinestartist/movingbutton/blob/master/art/preview.gif)\n\n## Sample Demo\n\nYou can download demo movie file here : [demo.mov](https://github.com/thefinestartist/movingbutton/raw/master/art/demo.mov)\n\nIt's also on Youtube:\n\n\u003ca href=\"http://www.youtube.com/watch?v=myheMkavjzk\"\u003e\n  \u003cimg alt=\"Youtube\"\n       src=\"https://github.com/thefinestartist/movingbutton/blob/master/art/youtube.png\" /\u003e\n\u003c/a\u003e\n\n## Sample Project\n\nYou can download the latest sample APK from this repo here: [sample-release.apk](https://github.com/thefinestartist/movingbutton/raw/master/sample/sample-release.apk)\n\nIt's also on Google Play:\n\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.thefinestartist.movingbutton.sample\"\u003e\n  \u003cimg alt=\"Get it on Google Play\"\n       src=\"https://developer.android.com/images/brand/en_generic_rgb_wo_60.png\" /\u003e\n\u003c/a\u003e\n\nHaving the sample project installed is a good way to be notified of new releases.\n\n## Gradle Dependency (jcenter)\n\nEasily reference the library in your Android projects using this dependency in your module's `build.gradle` file:\n\n```Gradle\ndependencies {\n    compile 'com.thefinestartist:movingbutton:1.0.0'\n}\n```\n\n## Requirements\n\nIt supports Android API 3+.\n\nIt uses [nineoldandroid](http://nineoldandroids.com/) for view animation.\n\n## Attrubutes\n\n```xml\n\u003c!--Button Move Direction (Default : all)--\u003e\n\u003cattr name=\"mb_move_direction\"\u003e\n    \u003cenum name=\"all\" value=\"0\" /\u003e\n    \u003cenum name=\"horizontal_vertical\" value=\"1\" /\u003e\n    \u003cenum name=\"horizontal\" value=\"2\" /\u003e\n    \u003cenum name=\"vertical\" value=\"3\" /\u003e\n    \u003cenum name=\"still\" value=\"4\" /\u003e\n\u003c/attr\u003e\n\n\u003c!--Button Movement (Default : 0dp)--\u003e\n\u003c!--Since DEFAULT value is ZERO, set up your button movement larger than zero.--\u003e\n\u003c!--You can set up the movement as minus value--\u003e\n\u003cattr name=\"mb_movement\" format=\"dimension\" /\u003e\n\u003cattr name=\"mb_movement_left\" format=\"dimension\" /\u003e\n\u003cattr name=\"mb_movement_right\" format=\"dimension\" /\u003e\n\u003cattr name=\"mb_movement_top\" format=\"dimension\" /\u003e\n\u003cattr name=\"mb_movement_bottom\" format=\"dimension\" /\u003e\n\n\u003c!--Button Event Offset (Default : 16dp for inner \u0026 23dp for outer)--\u003e\n\u003c!--Helps to calculate touch event from button--\u003e\n\u003cattr name=\"mb_offset_inner\" format=\"dimension\" /\u003e\n\u003cattr name=\"mb_offset_outer\" format=\"dimension\" /\u003e\n\n\u003c!--Vibrate on button movement (Default : 0)--\u003e\n\u003c!--android.permission.VIBRATE Permission required--\u003e\n\u003c!--if you set the duration as 0, no Permission required!--\u003e\n\u003cattr name=\"mb_event_volume\" format=\"integer\" /\u003e\n\n\u003c!--Play sound on button movement (Default : 0)--\u003e\n\u003cattr name=\"mb_event_volume\" format=\"integer\" /\u003e\n```\n\n## Layout Examples\n\n```xml\n\u003ccom.thefinestartist.movingbutton.MovingButton\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:id=\"@+id/moving_button\"\n    android:layout_width=\"100dp\"\n    android:layout_height=\"40dp\"\n    app:mb_move_direction=\"vertical\"\n    app:mb_event_volume=\"0\"\n    app:mb_vibration_duration=\"20\"\n    app:mb_movement=\"10dp\" /\u003e\n\n\u003ccom.thefinestartist.movingbutton.MovingButton\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:id=\"@+id/moving_button\"\n    android:layout_width=\"100dp\"\n    android:layout_height=\"40dp\"\n    app:mb_move_direction=\"all\"\n    app:mb_event_volume=\"50\"\n    app:mb_vibration_duration=\"20\"\n    app:mb_movementLeft=\"10dp\"\n    app:mb_movementRight=\"15dp\"\n    app:mb_movementTop=\"5dp\"\n    app:mb_movementBottom=\"20dp\"\n    app:mb_offset_inner=\"16dp\"\n    app:mb_offset_outer=\"23dp\" /\u003e\n```\n\n## Setter \u0026 Getter\n\n```java\n// Move Direction\nmovingButton.getMoveDirection();\nmovingButton.setMoveDirection(MoveDirection.ALL);\n\n// Movement (in Pixel dimension)\nmovingButton.getMovement();\nmovingButton.setMovement(10);\nmovingButton.getMovementLeft();\nmovingButton.setMovementLeft(10);\nmovingButton.getMovementRight();\nmovingButton.setMovementRight(10);\nmovingButton.getMovementTop();\nmovingButton.setMovementTop(10);\nmovingButton.getMovementBottom();\nmovingButton.setMovementBottom(10);\n\n// Offset (in Pixel dimension)\nmovingButton.getOffSetInner();\nmovingButton.setOffSetInner(10);\nmovingButton.getOffSetOuter();\nmovingButton.setOffSetOuter(10);\n\n// Vibration\nmovingButton.getVibrationDuration();\nmovingButton.setVibrationDuration(20);\n\n// Volume\nmovingButton.getEventVolume();\nmovingButton.setEventVolume(50);\n\n// Current Position\nmovingButton.getCurrentPosition();\n```\n\n## Listener\n\n```java\npublic interface OnPositionChangedListener {\n    // returns MotionEvent action and changed button position\n    void onPositionChanged(int action, ButtonPosition position);\n}\n\nmovingButton.setOnPositionChangedListener(new MovingButton.OnPositionChangedListener() {\n    @Override\n    public void onPositionChanged(int action, ButtonPosition position) {\n        //your code here\n    }\n});\n```\n\n## License\n\n```\nThe MIT License (MIT)\n\nCopyright (c) 2015 TheFinestArtist\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\nall copies 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\nTHE SOFTWARE.\n```\n","funding_links":[],"categories":["Index `(light-weight pages)`","Index"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheFinestArtist%2FMovingButton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTheFinestArtist%2FMovingButton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheFinestArtist%2FMovingButton/lists"}