NikoYuwono/ToolbarPanel

smoothSlide very slow in service

ngThu opened this issue · 7 comments

ngThu commented

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!

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

ngThu commented

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

ngThu commented

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.

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

ngThu commented

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 commented

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

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