{"id":13396048,"url":"https://github.com/ppamorim/Dragger","last_synced_at":"2025-03-13T22:31:40.840Z","repository":{"id":28563073,"uuid":"32080604","full_name":"ppamorim/Dragger","owner":"ppamorim","description":"Animate your activity!","archived":false,"fork":false,"pushed_at":"2020-06-09T07:49:02.000Z","size":10375,"stargazers_count":1299,"open_issues_count":18,"forks_count":166,"subscribers_count":45,"default_branch":"master","last_synced_at":"2024-10-29T20:50:59.555Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppamorim.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}},"created_at":"2015-03-12T14:13:34.000Z","updated_at":"2024-08-05T10:11:54.000Z","dependencies_parsed_at":"2022-08-02T12:18:44.996Z","dependency_job_id":null,"html_url":"https://github.com/ppamorim/Dragger","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppamorim%2FDragger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppamorim%2FDragger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppamorim%2FDragger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppamorim%2FDragger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppamorim","download_url":"https://codeload.github.com/ppamorim/Dragger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243196656,"owners_count":20251861,"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:38.356Z","updated_at":"2025-03-13T22:31:40.814Z","avatar_url":"https://github.com/ppamorim.png","language":"Java","funding_links":[],"categories":["Index `(light-weight pages)`","Index","Activity, Fragment","Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"readme":"![Logo 1][10]\n\n[![Build Status](https://api.travis-ci.org/ppamorim/Dragger.svg?branch=master)](https://travis-ci.org/ppamorim/Dragger)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Dragger-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1673)\n[![JitPack](https://img.shields.io/github/release/ppamorim/Dragger.svg?label=JitPack%20Maven)](https://jitpack.io/#ppamorim/Dragger)\n[![Join the chat at https://gitter.im/ppamorim/Dragger](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ppamorim/Dragger?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nWarning\n-------\n\nThis library is not in development anymore, but we are accepting PRs or successors if anyone is interested.\n\n---\n\nIf you want to use these transitions with fragments, take a look at [PrismView][123456789] library!\n\nThe library was created in order to provide new animations for activities on Android.\nUsing the ViewDragHelper class, it is possible to create smooth animations that allow full control of the view by the user.\n\nThis new component has been created using some concepts described on [Flavien Laurent Blog][1] and [Denevell Blog][2].\n\nDragger now uses [Rebound][14](tiny, 41.7kb) from Facebook to provide more realistic animations and improve performance for old devices.\n\nThis library should work on API 10 (but not tested [yet][1337]).\n\n![Demo 1][11]\n\nUsage\n-----\n\nYou can use this library like a view, you just need to do the following:\n\n* 1. Add ''DraggerView'' view to your root layout and add two layouts inside it.\nYou can add a shadow view if you want (the first one) and it needs to be invisible.\n\n```xml\n\u003ccom.github.ppamorim.library.DraggerView\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    dragger_layout:drag_view_id=\"@+id/drag_view\"\n    dragger_layout:shadow_view_id=\"@+id/shadow_view\"\n    dragger_layout:drag_position=\"top\"\u003e\n\n    \u003cFrameLayout\n          android:id=\"@+id/shadow_view\"\n          android:layout_width=\"match_parent\"\n          android:layout_height=\"match_parent\"\n          android:background=\"@color/transparent\"\n          android:visibility=\"invisible\"/\u003e\n\n    \u003cLinearLayout\n          android:id=\"@+id/drag_view\"\n          android:layout_width=\"match_parent\"\n          android:layout_height=\"match_parent\"/\u003e\n\n\u003c/com.github.ppamorim.library.DraggerView\u003e\n```\n\nIn your ''styles'' file, you need a config like this:\n\n```xml\n\u003cstyle name=\"YourTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\"\u003e\n    \u003citem name=\"android:windowIsTranslucent\"\u003etrue\u003c/item\u003e\n    \u003citem name=\"android:windowBackground\"\u003e@android:color/transparent\u003c/item\u003e\n    \u003citem name=\"android:windowNoTitle\"\u003etrue\u003c/item\u003e\n    \u003citem name=\"windowActionBar\"\u003efalse\u003c/item\u003e\n    \u003citem name=\"android:windowAnimationStyle\"\u003e@null\u003c/item\u003e\n\u003c/style\u003e\n```\n\nAnd your ''manifest'':\n\n```xml\n\u003cactivity\n    android:name=\"com.github.dragger.BaseActivity\"\n    android:theme=\"@style/YourTheme\"/\u003e\n```\n\nOr, if you need it to be fast:\n\n```java\npublic class YourActivity extends DraggerActivity {\n  @Override public void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    setShadowView(R.layout.custom_shadow); // It is not necessary, use if you want.\n    setContentView(R.layout.layout_content);\n  }\n}\n```\n\nNow you can control the slide of the view, just use the method expand() when you want.\n\nSome methods that you can use:\n\n```java\n\nsetDraggerCallback(DraggerCallback) //Interface that's provides some infos of the animation.\nsetSlideEnabled(boolean) //Enable or disable the drag, useful to use with ScrollViews.\nsetHorizontalDragRange(float) //Draggable distance that the draggableView can use, horizontally.\nsetVerticalDragRange(float) //Draggable distance that the draggableView can use, vertically.\nsetRunAnimationOnFinishInflate(boolean) //Run the initial animation, useful if you only want the drag function.\nsetDraggerLimit(float) //Set the max limit drag, default is 0.5 (center of the screen).\nsetDraggerPosition(DraggerPosition) //Set the position of archor.\nsetTension(float) //Tension of the animation. This represent with the friction, how much time the animation will be executed.\nsetFriction(float) //Friction of the animation. This represent with the tension, how much friction is applied at the tension animation.\nshow() //Show the drag view with Rebound animation.\ncloseActivity() //Simply close the activity with Rebound animation, based of the DraggerPosition choosen.\n\n```\n\nSample\n------\n\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.github.dragger\"\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\nImport dependency\n--------------------------------\n\nThis library use `appcompat-v7:23.1.0`.\n\nBut why not to add in MavenCentral?\nBecause it is so much bureaucratic.\n\nJitPack is there and is the future!\n\nInto your build.gradle:\n\n```groovy\n\nrepositories {\n  maven {\n    url \"https://jitpack.io\"\n  }\n}\n\ndependencies {\n  implementation 'com.github.ppamorim:dragger:1.2'\n}\n```\n\n\nWill you use with lists(RecyclerView, List/GridView, ScrollView)?\n--------------------------------------------------------------------\n\nI decided that need to be Out-Of-Box, then...\nYou must use the [Android-ObservableScrollView][13], like this:\n\n```groovy\ndependencies {\n  implementation 'com.github.ksoichiro:android-observablescrollview:VERSION'\n}\n```\n\n```java\n\npublic void configRecyclerView() {\n  ...\n  recyclerView.setScrollViewCallbacks(onObservableScrollViewCallbacks);\n}\n\nprivate ObservableScrollViewCallbacks onObservableScrollViewCallbacks =\n    new ObservableScrollViewCallbacks() {\n  @Override public void onScrollChanged(int scrollY, boolean firstScroll,\n      boolean dragging) {\n    draggerView.setSlideEnabled(scrollY != 0);\n  }\n  @Override public void onDownMotionEvent() { }\n  @Override public void onUpOrCancelMotionEvent(ScrollState scrollState) { }\n};\n```\n\nContributors\n------------\n\n* [Pedro Paulo de Amorim][3]\n* [Falkirks][12]\n\nThis was only possible because [Pedro Vicente Gómez Sánchez][4] helped me and I am very grateful for that! Thank you. :)\nAnd thank you Facebook for provide [Rebound][14] library!\n\nDeveloped By\n------------\n\n* Pedro Paulo de Amorim - \u003cpp.amorim@hotmail.com\u003e\n\n\u003ca href=\"https://www.linkedin.com/profile/view?id=185411359\"\u003e\n  \u003cimg alt=\"Add me to Linkedin\" src=\"http://imageshack.us/a/img41/7877/smallld.png\" /\u003e\n\u003c/a\u003e\n\nLibraries used on the sample project\n------------------------------------\n\n* [Butterknife][5]\n\nLicense\n-------\n\n    Copyright 2015 Pedro Paulo de Amorim\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n[1]: http://flavienlaurent.com/blog/2013/08/28/each-navigation-drawer-hides-a-viewdraghelper/\n[2]: http://blog.denevell.org/android-viewdraghelper-example-tutorial.html\n[3]: https://github.com/ppamorim/\n[4]: https://github.com/pedrovgs/\n[5]: https://github.com/JakeWharton/butterknife\n[6]: https://github.com/JakeWharton/NineOldAndroids/\n[7]: https://github.com/square/picasso\n[10]: ./art/dragger_new.png\n[11]: https://github.com/ppamorim/Dragger/blob/master/art/app_sample_uncompressed.gif?raw=true\n[12]: https://github.com/Falkirks\n[13]: https://github.com/ksoichiro/Android-ObservableScrollView\n[14]: https://github.com/facebook/rebound\n[1337]: https://www.youtube.com/watch?v=eQyjP2O1S40\n[123456789]: https://github.com/ppamorim/PrismView\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppamorim%2FDragger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppamorim%2FDragger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppamorim%2FDragger/lists"}