microsoftarchive / android-sliding-layer-lib

Highly customizable SlidingLayer as you have seen in Wunderlist
http://wunderlist.com
Apache License 2.0
932 stars 277 forks source link

using stickTo="right" correctly #5

Open dpreussler opened 11 years ago

dpreussler commented 11 years ago

Another question: I am trying to get a slide in from the right side of the screen as you have it in wunderlist. So I am setting slidingLayer:stickTo="right" and it flys correctly in from the right side but goes all the way to left. So the visible area below is on the right again.

What am I doing wrong? :)

Nothing fancy in the layout:

android:layout_width="300dp"
android:layout_height="fill_parent"
slidingLayer:stickTo="right"
chrisjenx commented 11 years ago

Hi @dpreussler try adding the following to the slidinglayer xml:

android:layout_alignParentRight="true"

So your settings should look something like:

android:layout_width="300dp"
android:layout_alignParentRight="true"
android:layout_height="fill_parent"
slidingLayer:stickTo="right"

What is not made clear in the demo is that the settings modify the layout on creation.

JlUgia commented 11 years ago

Well there are two ways to get the layer sticking to the right. First one is by doing it as you'd do it with any other container (alignParentRight, gravity, etc), or by forcing it as you did. The problem is that and as chrisjenx mentions you'll need your container already bound to the right side to make it work. It might be a point of improvement for the future to correct gravity or alignment based on the deliberate choice on where to stick the layer to.

pbespechnyi commented 10 years ago

Please, update ReadMe with this information. I wasted 1 hour to get this issue resolved...

chrisjenx commented 10 years ago

Send a PR with the changes. If you think something should be better submit it. :) that is the beauty of GitHub. On 29 Dec 2013 02:33, "Petr Bespechnyi" notifications@github.com wrote:

Please, update ReadMe with this information. I wasted 1 hour to get this issue resolved...

— Reply to this email directly or view it on GitHubhttps://github.com/6wunderkinder/android-sliding-layer-lib/issues/5#issuecomment-31308982 .