-
Notifications
You must be signed in to change notification settings - Fork 82
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
onCompltion Listener added #58
base: master
Are you sure you want to change the base?
Conversation
@massoudss Issue resolved. |
@@ -0,0 +1,5 @@ | |||
package com.masoudss.lib | |||
|
|||
interface CompletionListener { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to rename this interface to DrawCompletionListener
@@ -248,6 +249,8 @@ open class WaveformSeekBar @JvmOverloads constructor( | |||
override fun onDraw(canvas: Canvas) { | |||
super.onDraw(canvas) | |||
sample?.let { waveSample -> | |||
onCompletionListener?.onComplete() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this call to end of onDraw
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
Hey @massoudss, I pushed the changes
|
Another point is the listener inside onDraw method will be called hundreds of times. Is it OK for your purpose? |
No! |
So we have to find another way. |
Let me test and finalize it. |
I test this but it neither gives the result we want. Now I add a flag to indicate whether onComplete is called or not. |
Hey, @massoudss is the code safe for you? |
Competition listener added.
I added this for some progress in UI, Developers will use this to show the progress.
Issue resolved: #54