{"action":"created","issue":{"url":"https://api.github.com/repos/justasm/DragLinearLayout/issues/11","labels_url":"https://api.github.com/repos/justasm/DragLinearLayout/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/justasm/DragLinearLayout/issues/11/comments","events_url":"https://api.github.com/repos/justasm/DragLinearLayout/issues/11/events","html_url":"https://github.com/justasm/DragLinearLayout/issues/11","id":96175700,"number":11,"title":"Always Snapping to Top","user":{"login":"donniemceduns","id":2837287,"avatar_url":"https://avatars.githubusercontent.com/u/2837287?v=3","gravatar_id":"","url":"https://api.github.com/users/donniemceduns","html_url":"https://github.com/donniemceduns","followers_url":"https://api.github.com/users/donniemceduns/followers","following_url":"https://api.github.com/users/donniemceduns/following{/other_user}","gists_url":"https://api.github.com/users/donniemceduns/gists{/gist_id}","starred_url":"https://api.github.com/users/donniemceduns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donniemceduns/subscriptions","organizations_url":"https://api.github.com/users/donniemceduns/orgs","repos_url":"https://api.github.com/users/donniemceduns/repos","events_url":"https://api.github.com/users/donniemceduns/events{/privacy}","received_events_url":"https://api.github.com/users/donniemceduns/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-20T22:19:34Z","updated_at":"2015-07-22T05:55:10Z","closed_at":"2015-07-22T05:55:10Z","body":"Awesome library, \r\ni have a simple layout like this \r\n\r\n    <RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n        xmlns:tools=\"http://schemas.android.com/tools\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"match_parent\"\r\n        xmlns:app=\"http://schemas.android.com/apk/res-auto\"\r\n        tools:context=\".MainActivity\">\r\n\r\n        <com.jmedeisis.draglinearlayout.DragLinearLayout\r\n            android:id=\"@+id/container\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\" >\r\n\r\n            <LinearLayout\r\n                android:id=\"@+id/drag\"\r\n                android:layout_width=\"match_parent\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:background=\"#55000000\">\r\n\r\n                 <TextView\r\n                     android:id=\"@+id/display\"\r\n                     android:layout_width=\"wrap_content\"\r\n                     android:layout_height=\"wrap_content\"\r\n                     android:text=\"The Quick Brown Fox Jumped!!\"\r\n                     android:padding=\"15dp\"/>\r\n            </LinearLayout>\r\n\r\n        </com.jmedeisis.draglinearlayout.DragLinearLayout>\r\n\r\n    </RelativeLayout>\r\n\r\nThe LinearLayout with id=\"drag\" keeps snapping back to the top after i drag it. \r\n\r\nHow do i make it maintain its new position in the layout. \r\n\r\n\r\nalso it would be nice if there was a way to disable the snapping feature\r\n\r\nThanks "},"comment":{"url":"https://api.github.com/repos/justasm/DragLinearLayout/issues/comments/123571628","html_url":"https://github.com/justasm/DragLinearLayout/issues/11#issuecomment-123571628","issue_url":"https://api.github.com/repos/justasm/DragLinearLayout/issues/11","id":123571628,"user":{"login":"justasm","id":1081815,"avatar_url":"https://avatars.githubusercontent.com/u/1081815?v=3","gravatar_id":"","url":"https://api.github.com/users/justasm","html_url":"https://github.com/justasm","followers_url":"https://api.github.com/users/justasm/followers","following_url":"https://api.github.com/users/justasm/following{/other_user}","gists_url":"https://api.github.com/users/justasm/gists{/gist_id}","starred_url":"https://api.github.com/users/justasm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justasm/subscriptions","organizations_url":"https://api.github.com/users/justasm/orgs","repos_url":"https://api.github.com/users/justasm/repos","events_url":"https://api.github.com/users/justasm/events{/privacy}","received_events_url":"https://api.github.com/users/justasm/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T05:55:10Z","updated_at":"2015-07-22T05:55:10Z","body":"Hi, I'm sorry but DragLinearLayout was not designed for what you want to do.\r\n\r\nDepending on the complexity, desired robustness, and time budget of what you are ultimately trying to accomplish, you could try either one of:\r\n1. Fork this library and disable the \"settle animation\" in [``onDragStop``][ondragstop], which is what causes your LinearLayout to snap back to its original position. This could be tied to a configurable flag, giving you the ability to toggle the snapping feature as you wish.\r\n2. Implement permanent offset-via-drag using your own solution, probably either calling the view's [``offsetTopAndBottom``][offsettopbottom] / ``offsetLeftAndRight`` or [``setY``][sety] / ``setX`` in response to a drag motion.\r\n\r\nDragLinearLayout was originally intended to be used with selectively draggable items part of a linear heterogeneous list - i.e. it is designed for swapping order, not permanently offsetting its children.\r\n\r\nGood luck and please let me know if I misunderstood your intent or need to clarify anything else.\r\n\r\n[ondragstop]: https://github.com/justasm/DragLinearLayout/blob/91d6cc81c170e85d431b9d712db9662755a0b451/library/src/main/java/com/jmedeisis/draglinearlayout/DragLinearLayout.java#L381\r\n[offsettopbottom]: http://developer.android.com/reference/android/view/View.html#offsetTopAndBottom(int)\r\n[sety]: http://developer.android.com/reference/android/view/View.html#setY(float)"}}