Synchronize scrollviews in fragment (same scroll speed)
<p>I decided to make control like tablelayout with fixed columns (on the left) .. so I made my own class based on RelativeLayout. That class contains two scrollViews: _scrollViewLeft and _scrollViewRight (each of them contains tableLayout). Everything works fine (data is present, columns and rows are aligned, tables are same height) but scrolling one scrollView doesn't scroll the other. I dont know if the problem lies in the fact that control is placed in the Fragment inside ViewPager.</p>

<p>This is scrollView class that should make possible synchronizing two </p>

<pre><code>private class MatrixScrollView : ScrollView
{
        public MatrixScrollView(Context context, IAttributeSet attrs) : base(context, attrs)
        {
        }

        protected override void OnScrollChanged(int l, int t, int oldl, int oldt)
        {
            if (Tag.ToString() == "scrollViewLeft")
                _scrollViewRight.ScrollTo(0, t);
            else
                _scrollViewLeft.ScrollTo(0, t);
        }
    }
</code></pre>

<p>Just to make it clear: if you scroll scrollViewLeft in some direction line
    _scrollViewRight.ScrollTo(0, t);
executes - but it does nothing _scrollViewRight is left standing where it was before. </p>

<p>My control is based on <a href="https://www.codeofaninja.com/2013/08/android-scroll-table-fixed-header-column.html" rel="nofollow">this</a> </p>