Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minimum API supported? #694

Closed
ghost opened this issue Mar 26, 2016 · 5 comments
Closed

minimum API supported? #694

ghost opened this issue Mar 26, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Mar 26, 2016

Is the library still supporting API 8? Because it works fine on API 16+ devices, but I can not get it to work properly on an android 2.2 device.
The sliding is very jittery when dragging (not so when just tapping dragview) and after several drags my bottom slidingPanel shoots up and vanishes..

I'm asking because the main page mentions android 2.2+ (API 8+) while the demo requires API 11, and both my app and the unaltered (except for min-API) demo show the same behavior.

@charlesdurham
Copy link

Not an answer to your question but, you really shouldn't bother supporting API 8 unless you have a very very good reason. Probably shouldn't even bother supporting anything before 16.

@ghost
Copy link
Author

ghost commented Mar 26, 2016

Well the reason is I know too many ppl who belong to that 2% :) (still being sold and some people prefer not to carry around widescreen TV's)
And with support and design libraries you can get a long way towards material'ish UI.

I can imagine it was deprecated somewhere along new features, but main page still mentions 2.2, and the demo required API 11, even though it works for the emulator on API 8, the real device (HTC desire) shows the same strange behavior for my implementation and the bare demo.

Strange jitter during drag and every now and then the layout gets mangled (bottom panel disappears, sometimes up, sometimes down)

I'm waiting for feedback on those other devices, will post results when I get them.

@ghost
Copy link
Author

ghost commented Mar 31, 2016

slight update, this seems to be related to issue #525

if(!keepGoing && dy != 0) { //fix #525
                //Invalid drag state
                mCapturedView.setTop(0); <-- this is an API 11 call, circumventing it fixes the crashes on API 8 (obviously) but the logic leading to the values in this function/area seem related to #525 and the jittery behavior for the scrolling
                return true;
            }

my guess is the offset value which seems to jump all over the place , whenever it works the values for offset are nice between 0 and 1, when strange behavior happens the offset is occasionally > 1 or 2 (both positive and negative)

an example, at this point the panel is stuck on top, and sliding gestures show it but never at the correct (top or bottom) positions
03-31 17:01:35.447 1435-1435/? I/DemoActivity: onPanelStateChanged COLLAPSED
03-31 17:01:35.857 1435-1435/? I/DemoActivity: onPanelStateChanged DRAGGING
03-31 17:01:35.857 1435-1435/? I/DemoActivity: onPanelSlide, offset -1.980303
03-31 17:01:35.877 1435-1435/? I/DemoActivity: onPanelSlide, offset -1.7863636
03-31 17:01:35.897 1435-1435/? I/DemoActivity: onPanelSlide, offset -1.6590909
03-31 17:01:35.907 1435-1435/? I/DemoActivity: onPanelSlide, offset -1.5848485
03-31 17:01:35.927 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.5151515
03-31 17:01:35.947 1435-1435/? I/DemoActivity: onPanelSlide, offset -1.3984848
03-31 17:01:35.957 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.67424244
03-31 17:01:35.977 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.7409091
03-31 17:01:35.997 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.79242426
03-31 17:01:36.007 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.83484846
03-31 17:01:36.027 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.8712121
03-31 17:01:36.047 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.9
03-31 17:01:36.057 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.92424244
03-31 17:01:36.077 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.94242424
03-31 17:01:36.097 1435-1435/? I/DemoActivity: onPanelSlide, offset -1.040909
03-31 17:01:36.117 1435-1435/? I/DemoActivity: onPanelSlide, offset -1.030303
03-31 17:01:36.127 1435-1435/? I/DemoActivity: onPanelSlide, offset -1.0212121
03-31 17:01:36.147 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.9848485
03-31 17:01:36.167 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.9909091
03-31 17:01:36.187 1435-1435/? I/DemoActivity: onPanelSlide, offset -1.0060606
03-31 17:01:36.197 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.99545455
03-31 17:01:36.217 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.99848485
03-31 17:01:36.247 1435-1435/? I/DemoActivity: onPanelSlide, offset -1.0

@tokudu
Copy link
Contributor

tokudu commented Mar 31, 2016

It was originally supported to work on 8 - so it probably should. I just
never bothered to keep supporting it because most people don't care. If you
manage to get it to work again, feel free to send me a PR.

On Thu, Mar 31, 2016 at 8:03 AM, harrierjack notifications@github.com
wrote:

slight update, this seems to be related to issue #525
#525

if(!keepGoing && dy != 0) { //fix #525
#525
//Invalid drag state
mCapturedView.setTop(0); <-- this is an API 11 call, circumventing it
fixes the crashes on API 8 (obviously) but the logic leading to the values
in this function/area seem related to #525
#525 and the
jittery behavior for the scrolling
return true;
}

my guess is the offset value which seems to jump all over the place ,
whenever it works the values for offset are nice between 0 and 1, when
strange behavior happens the offset is occasionally > 1 or 2 (both positive
and negative)

an example, at this point the panel is stuck on top, and sliding gestures
show it but never at the correct (top or bottom) positions
03-31 17:01:35.447 1435-1435/? I/DemoActivity: onPanelStateChanged
COLLAPSED
03-31 17:01:35.857 1435-1435/? I/DemoActivity: onPanelStateChanged DRAGGING
03-31 17:01:35.857 1435-1435/? I/DemoActivity: onPanelSlide, offset
-1.980303
03-31 17:01:35.877 1435-1435/? I/DemoActivity: onPanelSlide, offset
-1.7863636
03-31 17:01:35.897 1435-1435/? I/DemoActivity: onPanelSlide, offset
-1.6590909
03-31 17:01:35.907 1435-1435/? I/DemoActivity: onPanelSlide, offset
-1.5848485
03-31 17:01:35.927 1435-1435/? I/DemoActivity: onPanelSlide, offset
0.5151515
03-31 17:01:35.947 1435-1435/? I/DemoActivity: onPanelSlide, offset
-1.3984848
03-31 17:01:35.957 1435-1435/? I/DemoActivity: onPanelSlide, offset
0.67424244
03-31 17:01:35.977 1435-1435/? I/DemoActivity: onPanelSlide, offset
0.7409091
03-31 17:01:35.997 1435-1435/? I/DemoActivity: onPanelSlide, offset
0.79242426
03-31 17:01:36.007 1435-1435/? I/DemoActivity: onPanelSlide, offset
0.83484846
03-31 17:01:36.027 1435-1435/? I/DemoActivity: onPanelSlide, offset
0.8712121
03-31 17:01:36.047 1435-1435/? I/DemoActivity: onPanelSlide, offset 0.9
03-31 17:01:36.057 1435-1435/? I/DemoActivity: onPanelSlide, offset
0.92424244
03-31 17:01:36.077 1435-1435/? I/DemoActivity: onPanelSlide, offset
0.94242424
03-31 17:01:36.097 1435-1435/? I/DemoActivity: onPanelSlide, offset
-1.040909
03-31 17:01:36.117 1435-1435/? I/DemoActivity: onPanelSlide, offset
-1.030303
03-31 17:01:36.127 1435-1435/? I/DemoActivity: onPanelSlide, offset
-1.0212121
03-31 17:01:36.147 1435-1435/? I/DemoActivity: onPanelSlide, offset
0.9848485
03-31 17:01:36.167 1435-1435/? I/DemoActivity: onPanelSlide, offset
0.9909091
03-31 17:01:36.187 1435-1435/? I/DemoActivity: onPanelSlide, offset
-1.0060606
03-31 17:01:36.197 1435-1435/? I/DemoActivity: onPanelSlide, offset
0.99545455
03-31 17:01:36.217 1435-1435/? I/DemoActivity: onPanelSlide, offset
0.99848485
03-31 17:01:36.247 1435-1435/? I/DemoActivity: onPanelSlide, offset -1.0


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#694 (comment)

@ghost
Copy link
Author

ghost commented Apr 1, 2016

In the process of cleaning and some last testing, will PR when I'm certain everything works.

I did trace it down to topBoundCollapsed which became negative for no reason, which brought me to computePanelTopPosition(0) where the problem immediately (and at this point consistently) disappeared when I created a debug line calculating the values before they were calculated in the return statement.

My guess is some sort of race condition, the sliding of the panel is buttery smooth now anyways :)

private int computePanelTopPosition(float slideOffset) {
.......
// adding this line already solved the problem
Log.d("jack", "values= " + getMeasuredHeight() + " " + getPaddingBottom() + " " + mPanelHeight + " " + slidePixelOffset );

return mIsSlidingUp ? getMeasuredHeight() - getPaddingBottom() - mPanelHeight - slidePixelOffset
                            : getPaddingTop() - slidingViewHeight + mPanelHeight + slidePixelOffset;
}

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants