it can be achieved in you activity class.

1)  get the reference of CustomHorizontalView
2)  then it's child view.
3) in onWindowFoucs get width of CustomHorizotalView and child view.
4) and calculate the proportion of result value of above width and
horizontal length of scroll.
5) pass the resultant value to seek bar.

Regards
Vinay Kumar


On Wed, Nov 20, 2013 at 12:35 PM, Amit Mangal
<forum.amit.man...@gmail.com>wrote:

> i need to implement onscrollchanged method in my class so that when scroll
> is changing i will update seek bar position as per scroll value.
>
> i implemented a customhorizontalview class with extends
> HorizontalScrollView.
>
> also created customhorizontalview in xml . but my problem is that how to
> override onscrollchange method in my class so that as scroll is changing i
> could update seek bar corresponding to horizontal scroll.
>
> here is my customhorizontalview class
>
> import android.content.Context;
>
> import android.util.AttributeSet;
>
> import android.util.Log;
>
> import android.widget.HorizontalScrollView;
>
>
>
>
> public class CustomHorizontalScroll extends HorizontalScrollView  {
>
>
>
>
>     public interface onScrollChangedListener{
>
>         public abstract void onScrollChanged(int l, int t, int oldl, intoldt);
>
>     }
>
>
>
>     onScrollChangedListener mMyScrollViewListener;
>
>
>      public void setMyScrollViewListener(onScrollChangedListener listener
> ){
>
>         mMyScrollViewListener = listener;
>
>     }
>
>
>
>     @Override
>
>     protected void onScrollChanged(int l, int t, int oldl, int oldt) {
>
>         super.onScrollChanged(l, t, oldl, oldt);
>
>         Log.v("Positions",l+","+t) ;
>
>     }
>
>
>      public CustomHorizontalScroll(Context context, AttributeSet attrs) {
>
>         super(context, attrs);
>
>         // TODO Auto-generated constructor stub
>
>
>
>     }
>
>
> }
>
>
> i am using this in my java file
>
> hs_scroll_view = (CustomHorizontalScroll) findViewById(R.id.
> id_hs_scroll_view) ;
>
>
> i want to override onscrollchanged in my java file so that i could update
> seek bar as per scroll but i don't know how to do that .
>
>
> please suggest me any idea ?
>
>
> thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to