explain the seekbar listener in android -
in below please explain parameters passed listeners.that in sbar1.setonseekbarchangelistener(new seekbar.onseekbarchangelistener())
. thank you
package com.example.centum.seekbar; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.widget.edittext; import android.widget.seekbar; public class mainactivity extends appcompatactivity { edittext etext1; seekbar sbar1; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); etext1=(edittext)findviewbyid(r.id.et2); sbar1=(seekbar)findviewbyid(r.id.sb2); sbar1.setonseekbarchangelistener(new seekbar.onseekbarchangelistener() { @override public void onprogresschanged(seekbar seekbar, int i, boolean b) { etext1.settextsize(i*5); } @override public void onstarttrackingtouch(seekbar seekbar) { } @override public void onstoptrackingtouch(seekbar seekbar) { } }); } }
the javadoc onseekbarchangelistener might understand
/** * notification progress level has changed. clients can use fromuser parameter * distinguish user-initiated changes occurred programmatically. * * @param seekbar seekbar progress has changed * @param progress current progress level. in range 0..max max * set {@link progressbar#setmax(int)}. (the default value max 100.) * @param fromuser true if progress change initiated user. */ void onprogresschanged(seekbar seekbar, int progress, boolean fromuser); /** * notification user has started touch gesture. clients may want use * disable advancing seekbar. * @param seekbar seekbar in touch gesture began */ void onstarttrackingtouch(seekbar seekbar); /** * notification user has finished touch gesture. clients may want use * re-enable advancing seekbar. * @param seekbar seekbar in touch gesture began */ void onstoptrackingtouch(seekbar seekbar);
Comments
Post a Comment