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

smoothSlide very slow in service #5

Open
ngThu opened this issue Jan 19, 2017 · 7 comments
Open

smoothSlide very slow in service #5

ngThu opened this issue Jan 19, 2017 · 7 comments

Comments

@ngThu
Copy link

ngThu commented Jan 19, 2017

I'm trying attach ToolbarPanel to service. but it slide very very slow. (or not slide)
Are you have a solution this issue?
If you know, please tell me. Thank so much!

@NikoYuwono
Copy link
Owner

@ngThu are you sure you are calling it from the main thread?

@ngThu
Copy link
Author

ngThu commented Jan 19, 2017

@NikoYuwono: Thank so much for reply.
"calling it from the main thread" ?? that it means? I do like your demo!! @@

@ngThu
Copy link
Author

ngThu commented Jan 19, 2017

My code:

view = (RelativeLayout) inflater.inflate(R.layout.activity_main, null);
manager = (WindowManager) getSystemService(WINDOW_SERVICE);
params = new WindowManager.LayoutParams();
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.height = WindowManager.LayoutParams.MATCH_PARENT;
params.type = WindowManager.LayoutParams.TYPE_SYSTEM_ERROR;
params.flags = WindowManager.LayoutParams.FIRST_SUB_WINDOW;
params.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST;
params.gravity = Gravity.TOP;
params.format = PixelFormat.TRANSLUCENT;
manager.addView(view, params);

with activity_main like you.

@NikoYuwono
Copy link
Owner

Can you show me the code where do you call openPanel() or closePanel() ?

@ngThu
Copy link
Author

ngThu commented Jan 20, 2017

I know your code where no good.
some device it not call to
@OverRide
public void computeScroll() {
if (dragHelper.continueSettling(true)) {
ViewCompat.postInvalidateOnAnimation(this);
}
}

in service
so, some device this lib not run. (but in activity it run very good (Y) )
I debug and i realize, if computeScroll called then onTouchEvent not call. And vice versa.
I'm editing in onTouchView, It is not done yet.
can you help me? T__T

@ngThu
Copy link
Author

ngThu commented Jan 20, 2017

My issue is done. i very stupid.. T__T
My skype is D.ng.Thu
Can you give me your skype?

@NikoYuwono
Copy link
Owner

Contact me via twitter @niko_yuwono
If you are calling from service you need to call it from main thread, because usually service is running on different thread

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