Scroll Index method not firing consistently












0















In a Xamarin.Forms and Xamarin.Android project I create a Custom Render and Adapter for a ListView.
The adapter implements BaseAdapter and ISectionIndexer. The custom render of this control is using FastScroll feature, in Android when you tap this scroll a bubble with a index letter appears. This works fine, but my idea is to have a way to catch the selected index after releasing scroll and that scroll "bubble" disappears.
I thought with the following class (in the GetSectionForPosition method) could achieve that:



public class ListViewconIndexAdapter : BaseAdapter<string>, ISectionIndexer
{
string items;
Activity context;

string sections;
Java.Lang.Object sectionsObjects;
Dictionary<string, int> alphaIndex;

public ListViewconIndexAdapter(Activity context, string items) : base()
{
this.context = context;
this.items = items;

alphaIndex = new Dictionary<string, int>();
for (int i = 0; i < items.Length; i++)
{
var key = items[i][0].ToString();
if (!alphaIndex.ContainsKey(key))
alphaIndex.Add(key, i);
}
sections = new string[alphaIndex.Keys.Count];
alphaIndex.Keys.CopyTo(sections, 0);
sectionsObjects = new Java.Lang.Object[sections.Length];
for (int i = 0; i < sections.Length; i++)
{
sectionsObjects[i] = new Java.Lang.String(sections[i]);
}

}


public override Java.Lang.Object GetItem(int position)
{
return position;
}

public override long GetItemId(int position)
{
return position;
}

public override string this[int position]
{
get { return items[position]; }
}

public override View GetView(int position, View convertView, ViewGroup parent)
{
View view = convertView;
if (view == null)
view = context.LayoutInflater.Inflate(Android.Resource.Layout.SimpleListItem1, null);
view.FindViewById<TextView>(Android.Resource.Id.Text1).Text = items[position];
return view;
}

//Fill in cound here, currently 0
public override int Count
{
get { return items.Length; }
}

// -- ISectionIndexer --
public int GetPositionForSection(int section)
{
return alphaIndex[sections[section]];
}

public int GetSectionForPosition(int position)
{ // this method isn't called in this example, but code is provided for completeness
int prevSection = 0;

for (int i = 0; i < sections.Length; i++)
{
if (GetPositionForSection(i) > position)
{
break;
}

prevSection = i;
}

Console.WriteLine(prevSection);
Console.WriteLine(sections[prevSection]);

//Toast.MakeText(context, sections[prevSection], ToastLength.Short).Show();
Xamarin.Forms.MessagingCenter.Send<object,string>(this, "CambioSeccion", sections[prevSection]);
return prevSection;
}

}


I put those Console.writeline for checking the index letter and that Message send is a way to send it back to PCL/NET Standard code (to show an DisplayAlert or something).
But the problem is that method firing is not consistent, for example, sometimes you fast scroll down to 'C' but Console doesn't print anything after releasing it there, but after touching it again where you leave it, it fires up. But sometimes it works like i want, it prints after release the scroll at selected index.










share|improve this question



























    0















    In a Xamarin.Forms and Xamarin.Android project I create a Custom Render and Adapter for a ListView.
    The adapter implements BaseAdapter and ISectionIndexer. The custom render of this control is using FastScroll feature, in Android when you tap this scroll a bubble with a index letter appears. This works fine, but my idea is to have a way to catch the selected index after releasing scroll and that scroll "bubble" disappears.
    I thought with the following class (in the GetSectionForPosition method) could achieve that:



    public class ListViewconIndexAdapter : BaseAdapter<string>, ISectionIndexer
    {
    string items;
    Activity context;

    string sections;
    Java.Lang.Object sectionsObjects;
    Dictionary<string, int> alphaIndex;

    public ListViewconIndexAdapter(Activity context, string items) : base()
    {
    this.context = context;
    this.items = items;

    alphaIndex = new Dictionary<string, int>();
    for (int i = 0; i < items.Length; i++)
    {
    var key = items[i][0].ToString();
    if (!alphaIndex.ContainsKey(key))
    alphaIndex.Add(key, i);
    }
    sections = new string[alphaIndex.Keys.Count];
    alphaIndex.Keys.CopyTo(sections, 0);
    sectionsObjects = new Java.Lang.Object[sections.Length];
    for (int i = 0; i < sections.Length; i++)
    {
    sectionsObjects[i] = new Java.Lang.String(sections[i]);
    }

    }


    public override Java.Lang.Object GetItem(int position)
    {
    return position;
    }

    public override long GetItemId(int position)
    {
    return position;
    }

    public override string this[int position]
    {
    get { return items[position]; }
    }

    public override View GetView(int position, View convertView, ViewGroup parent)
    {
    View view = convertView;
    if (view == null)
    view = context.LayoutInflater.Inflate(Android.Resource.Layout.SimpleListItem1, null);
    view.FindViewById<TextView>(Android.Resource.Id.Text1).Text = items[position];
    return view;
    }

    //Fill in cound here, currently 0
    public override int Count
    {
    get { return items.Length; }
    }

    // -- ISectionIndexer --
    public int GetPositionForSection(int section)
    {
    return alphaIndex[sections[section]];
    }

    public int GetSectionForPosition(int position)
    { // this method isn't called in this example, but code is provided for completeness
    int prevSection = 0;

    for (int i = 0; i < sections.Length; i++)
    {
    if (GetPositionForSection(i) > position)
    {
    break;
    }

    prevSection = i;
    }

    Console.WriteLine(prevSection);
    Console.WriteLine(sections[prevSection]);

    //Toast.MakeText(context, sections[prevSection], ToastLength.Short).Show();
    Xamarin.Forms.MessagingCenter.Send<object,string>(this, "CambioSeccion", sections[prevSection]);
    return prevSection;
    }

    }


    I put those Console.writeline for checking the index letter and that Message send is a way to send it back to PCL/NET Standard code (to show an DisplayAlert or something).
    But the problem is that method firing is not consistent, for example, sometimes you fast scroll down to 'C' but Console doesn't print anything after releasing it there, but after touching it again where you leave it, it fires up. But sometimes it works like i want, it prints after release the scroll at selected index.










    share|improve this question

























      0












      0








      0








      In a Xamarin.Forms and Xamarin.Android project I create a Custom Render and Adapter for a ListView.
      The adapter implements BaseAdapter and ISectionIndexer. The custom render of this control is using FastScroll feature, in Android when you tap this scroll a bubble with a index letter appears. This works fine, but my idea is to have a way to catch the selected index after releasing scroll and that scroll "bubble" disappears.
      I thought with the following class (in the GetSectionForPosition method) could achieve that:



      public class ListViewconIndexAdapter : BaseAdapter<string>, ISectionIndexer
      {
      string items;
      Activity context;

      string sections;
      Java.Lang.Object sectionsObjects;
      Dictionary<string, int> alphaIndex;

      public ListViewconIndexAdapter(Activity context, string items) : base()
      {
      this.context = context;
      this.items = items;

      alphaIndex = new Dictionary<string, int>();
      for (int i = 0; i < items.Length; i++)
      {
      var key = items[i][0].ToString();
      if (!alphaIndex.ContainsKey(key))
      alphaIndex.Add(key, i);
      }
      sections = new string[alphaIndex.Keys.Count];
      alphaIndex.Keys.CopyTo(sections, 0);
      sectionsObjects = new Java.Lang.Object[sections.Length];
      for (int i = 0; i < sections.Length; i++)
      {
      sectionsObjects[i] = new Java.Lang.String(sections[i]);
      }

      }


      public override Java.Lang.Object GetItem(int position)
      {
      return position;
      }

      public override long GetItemId(int position)
      {
      return position;
      }

      public override string this[int position]
      {
      get { return items[position]; }
      }

      public override View GetView(int position, View convertView, ViewGroup parent)
      {
      View view = convertView;
      if (view == null)
      view = context.LayoutInflater.Inflate(Android.Resource.Layout.SimpleListItem1, null);
      view.FindViewById<TextView>(Android.Resource.Id.Text1).Text = items[position];
      return view;
      }

      //Fill in cound here, currently 0
      public override int Count
      {
      get { return items.Length; }
      }

      // -- ISectionIndexer --
      public int GetPositionForSection(int section)
      {
      return alphaIndex[sections[section]];
      }

      public int GetSectionForPosition(int position)
      { // this method isn't called in this example, but code is provided for completeness
      int prevSection = 0;

      for (int i = 0; i < sections.Length; i++)
      {
      if (GetPositionForSection(i) > position)
      {
      break;
      }

      prevSection = i;
      }

      Console.WriteLine(prevSection);
      Console.WriteLine(sections[prevSection]);

      //Toast.MakeText(context, sections[prevSection], ToastLength.Short).Show();
      Xamarin.Forms.MessagingCenter.Send<object,string>(this, "CambioSeccion", sections[prevSection]);
      return prevSection;
      }

      }


      I put those Console.writeline for checking the index letter and that Message send is a way to send it back to PCL/NET Standard code (to show an DisplayAlert or something).
      But the problem is that method firing is not consistent, for example, sometimes you fast scroll down to 'C' but Console doesn't print anything after releasing it there, but after touching it again where you leave it, it fires up. But sometimes it works like i want, it prints after release the scroll at selected index.










      share|improve this question














      In a Xamarin.Forms and Xamarin.Android project I create a Custom Render and Adapter for a ListView.
      The adapter implements BaseAdapter and ISectionIndexer. The custom render of this control is using FastScroll feature, in Android when you tap this scroll a bubble with a index letter appears. This works fine, but my idea is to have a way to catch the selected index after releasing scroll and that scroll "bubble" disappears.
      I thought with the following class (in the GetSectionForPosition method) could achieve that:



      public class ListViewconIndexAdapter : BaseAdapter<string>, ISectionIndexer
      {
      string items;
      Activity context;

      string sections;
      Java.Lang.Object sectionsObjects;
      Dictionary<string, int> alphaIndex;

      public ListViewconIndexAdapter(Activity context, string items) : base()
      {
      this.context = context;
      this.items = items;

      alphaIndex = new Dictionary<string, int>();
      for (int i = 0; i < items.Length; i++)
      {
      var key = items[i][0].ToString();
      if (!alphaIndex.ContainsKey(key))
      alphaIndex.Add(key, i);
      }
      sections = new string[alphaIndex.Keys.Count];
      alphaIndex.Keys.CopyTo(sections, 0);
      sectionsObjects = new Java.Lang.Object[sections.Length];
      for (int i = 0; i < sections.Length; i++)
      {
      sectionsObjects[i] = new Java.Lang.String(sections[i]);
      }

      }


      public override Java.Lang.Object GetItem(int position)
      {
      return position;
      }

      public override long GetItemId(int position)
      {
      return position;
      }

      public override string this[int position]
      {
      get { return items[position]; }
      }

      public override View GetView(int position, View convertView, ViewGroup parent)
      {
      View view = convertView;
      if (view == null)
      view = context.LayoutInflater.Inflate(Android.Resource.Layout.SimpleListItem1, null);
      view.FindViewById<TextView>(Android.Resource.Id.Text1).Text = items[position];
      return view;
      }

      //Fill in cound here, currently 0
      public override int Count
      {
      get { return items.Length; }
      }

      // -- ISectionIndexer --
      public int GetPositionForSection(int section)
      {
      return alphaIndex[sections[section]];
      }

      public int GetSectionForPosition(int position)
      { // this method isn't called in this example, but code is provided for completeness
      int prevSection = 0;

      for (int i = 0; i < sections.Length; i++)
      {
      if (GetPositionForSection(i) > position)
      {
      break;
      }

      prevSection = i;
      }

      Console.WriteLine(prevSection);
      Console.WriteLine(sections[prevSection]);

      //Toast.MakeText(context, sections[prevSection], ToastLength.Short).Show();
      Xamarin.Forms.MessagingCenter.Send<object,string>(this, "CambioSeccion", sections[prevSection]);
      return prevSection;
      }

      }


      I put those Console.writeline for checking the index letter and that Message send is a way to send it back to PCL/NET Standard code (to show an DisplayAlert or something).
      But the problem is that method firing is not consistent, for example, sometimes you fast scroll down to 'C' but Console doesn't print anything after releasing it there, but after touching it again where you leave it, it fires up. But sometimes it works like i want, it prints after release the scroll at selected index.







      xamarin xamarin.android






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 13 '18 at 18:59









      Mr_LinDowsMacMr_LinDowsMac

      82043260




      82043260
























          1 Answer
          1






          active

          oldest

          votes


















          0














          ListView has two different scroll listeners, AbsListView.IOnScrollListener and AbsListView.IOnScrollChangeListener (this one was added in API 23) and a touch listener (AbsListView.IOnTouchListener)



          I think based upon your use-case, you are looking for the OnScrollStateChanged and when it goes into idle state and you are not touching the listview, do something (or vice versa).



          Example (adjust to your needs of course):



              public class MyScrollListener : Java.Lang.Object, AbsListView.IOnTouchListener, AbsListView.IOnScrollListener, AbsListView.IOnScrollChangeListener //(API23)
          {
          bool touching;
          bool scrolling;

          public void OnScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)
          {
          }

          public void OnScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY)
          {
          }

          public void OnScrollStateChanged(AbsListView view, [GeneratedEnum] ScrollState scrollState)
          {
          switch(scrollState)
          {
          case ScrollState.Idle:
          if (!touching)
          {
          scrolling = false;
          GetSelection();
          }
          break;
          default:
          scrolling = true;
          break;
          }
          }

          public bool OnTouch(View v, MotionEvent e)
          {
          switch (e.Action)
          {
          case MotionEventActions.Up:
          touching = false;
          if (!scrolling)
          GetSelection();
          break;
          default:
          touching = true;
          break;
          }
          return true;
          }

          void GetSelection()
          {
          // touch and srolling is done, do something
          }
          }


          Usage:



          var scrollListener = new MyScrollListener();
          listView.SetOnTouchListener(scrollListener);
          listView.SetOnScrollListener(scrollListener);
          listView.SetOnScrollChangeListener(scrollListener); // API23





          share|improve this answer


























          • OnScrollChange seems to be a very viable option, because it fires after every scroll, however I still need to retrieve GetSectionForPosition somehow method value in my Adapter. I don't know what is calling GetSectionForPosition after scrolling and what is provided the int position parameter

            – Mr_LinDowsMac
            Nov 14 '18 at 0:47











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287828%2fscroll-index-method-not-firing-consistently%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          ListView has two different scroll listeners, AbsListView.IOnScrollListener and AbsListView.IOnScrollChangeListener (this one was added in API 23) and a touch listener (AbsListView.IOnTouchListener)



          I think based upon your use-case, you are looking for the OnScrollStateChanged and when it goes into idle state and you are not touching the listview, do something (or vice versa).



          Example (adjust to your needs of course):



              public class MyScrollListener : Java.Lang.Object, AbsListView.IOnTouchListener, AbsListView.IOnScrollListener, AbsListView.IOnScrollChangeListener //(API23)
          {
          bool touching;
          bool scrolling;

          public void OnScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)
          {
          }

          public void OnScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY)
          {
          }

          public void OnScrollStateChanged(AbsListView view, [GeneratedEnum] ScrollState scrollState)
          {
          switch(scrollState)
          {
          case ScrollState.Idle:
          if (!touching)
          {
          scrolling = false;
          GetSelection();
          }
          break;
          default:
          scrolling = true;
          break;
          }
          }

          public bool OnTouch(View v, MotionEvent e)
          {
          switch (e.Action)
          {
          case MotionEventActions.Up:
          touching = false;
          if (!scrolling)
          GetSelection();
          break;
          default:
          touching = true;
          break;
          }
          return true;
          }

          void GetSelection()
          {
          // touch and srolling is done, do something
          }
          }


          Usage:



          var scrollListener = new MyScrollListener();
          listView.SetOnTouchListener(scrollListener);
          listView.SetOnScrollListener(scrollListener);
          listView.SetOnScrollChangeListener(scrollListener); // API23





          share|improve this answer


























          • OnScrollChange seems to be a very viable option, because it fires after every scroll, however I still need to retrieve GetSectionForPosition somehow method value in my Adapter. I don't know what is calling GetSectionForPosition after scrolling and what is provided the int position parameter

            – Mr_LinDowsMac
            Nov 14 '18 at 0:47
















          0














          ListView has two different scroll listeners, AbsListView.IOnScrollListener and AbsListView.IOnScrollChangeListener (this one was added in API 23) and a touch listener (AbsListView.IOnTouchListener)



          I think based upon your use-case, you are looking for the OnScrollStateChanged and when it goes into idle state and you are not touching the listview, do something (or vice versa).



          Example (adjust to your needs of course):



              public class MyScrollListener : Java.Lang.Object, AbsListView.IOnTouchListener, AbsListView.IOnScrollListener, AbsListView.IOnScrollChangeListener //(API23)
          {
          bool touching;
          bool scrolling;

          public void OnScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)
          {
          }

          public void OnScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY)
          {
          }

          public void OnScrollStateChanged(AbsListView view, [GeneratedEnum] ScrollState scrollState)
          {
          switch(scrollState)
          {
          case ScrollState.Idle:
          if (!touching)
          {
          scrolling = false;
          GetSelection();
          }
          break;
          default:
          scrolling = true;
          break;
          }
          }

          public bool OnTouch(View v, MotionEvent e)
          {
          switch (e.Action)
          {
          case MotionEventActions.Up:
          touching = false;
          if (!scrolling)
          GetSelection();
          break;
          default:
          touching = true;
          break;
          }
          return true;
          }

          void GetSelection()
          {
          // touch and srolling is done, do something
          }
          }


          Usage:



          var scrollListener = new MyScrollListener();
          listView.SetOnTouchListener(scrollListener);
          listView.SetOnScrollListener(scrollListener);
          listView.SetOnScrollChangeListener(scrollListener); // API23





          share|improve this answer


























          • OnScrollChange seems to be a very viable option, because it fires after every scroll, however I still need to retrieve GetSectionForPosition somehow method value in my Adapter. I don't know what is calling GetSectionForPosition after scrolling and what is provided the int position parameter

            – Mr_LinDowsMac
            Nov 14 '18 at 0:47














          0












          0








          0







          ListView has two different scroll listeners, AbsListView.IOnScrollListener and AbsListView.IOnScrollChangeListener (this one was added in API 23) and a touch listener (AbsListView.IOnTouchListener)



          I think based upon your use-case, you are looking for the OnScrollStateChanged and when it goes into idle state and you are not touching the listview, do something (or vice versa).



          Example (adjust to your needs of course):



              public class MyScrollListener : Java.Lang.Object, AbsListView.IOnTouchListener, AbsListView.IOnScrollListener, AbsListView.IOnScrollChangeListener //(API23)
          {
          bool touching;
          bool scrolling;

          public void OnScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)
          {
          }

          public void OnScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY)
          {
          }

          public void OnScrollStateChanged(AbsListView view, [GeneratedEnum] ScrollState scrollState)
          {
          switch(scrollState)
          {
          case ScrollState.Idle:
          if (!touching)
          {
          scrolling = false;
          GetSelection();
          }
          break;
          default:
          scrolling = true;
          break;
          }
          }

          public bool OnTouch(View v, MotionEvent e)
          {
          switch (e.Action)
          {
          case MotionEventActions.Up:
          touching = false;
          if (!scrolling)
          GetSelection();
          break;
          default:
          touching = true;
          break;
          }
          return true;
          }

          void GetSelection()
          {
          // touch and srolling is done, do something
          }
          }


          Usage:



          var scrollListener = new MyScrollListener();
          listView.SetOnTouchListener(scrollListener);
          listView.SetOnScrollListener(scrollListener);
          listView.SetOnScrollChangeListener(scrollListener); // API23





          share|improve this answer















          ListView has two different scroll listeners, AbsListView.IOnScrollListener and AbsListView.IOnScrollChangeListener (this one was added in API 23) and a touch listener (AbsListView.IOnTouchListener)



          I think based upon your use-case, you are looking for the OnScrollStateChanged and when it goes into idle state and you are not touching the listview, do something (or vice versa).



          Example (adjust to your needs of course):



              public class MyScrollListener : Java.Lang.Object, AbsListView.IOnTouchListener, AbsListView.IOnScrollListener, AbsListView.IOnScrollChangeListener //(API23)
          {
          bool touching;
          bool scrolling;

          public void OnScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)
          {
          }

          public void OnScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY)
          {
          }

          public void OnScrollStateChanged(AbsListView view, [GeneratedEnum] ScrollState scrollState)
          {
          switch(scrollState)
          {
          case ScrollState.Idle:
          if (!touching)
          {
          scrolling = false;
          GetSelection();
          }
          break;
          default:
          scrolling = true;
          break;
          }
          }

          public bool OnTouch(View v, MotionEvent e)
          {
          switch (e.Action)
          {
          case MotionEventActions.Up:
          touching = false;
          if (!scrolling)
          GetSelection();
          break;
          default:
          touching = true;
          break;
          }
          return true;
          }

          void GetSelection()
          {
          // touch and srolling is done, do something
          }
          }


          Usage:



          var scrollListener = new MyScrollListener();
          listView.SetOnTouchListener(scrollListener);
          listView.SetOnScrollListener(scrollListener);
          listView.SetOnScrollChangeListener(scrollListener); // API23






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 14 '18 at 0:46









          jgoldberger - MSFT

          3,6831829




          3,6831829










          answered Nov 13 '18 at 19:47









          SushiHangoverSushiHangover

          51.2k53989




          51.2k53989













          • OnScrollChange seems to be a very viable option, because it fires after every scroll, however I still need to retrieve GetSectionForPosition somehow method value in my Adapter. I don't know what is calling GetSectionForPosition after scrolling and what is provided the int position parameter

            – Mr_LinDowsMac
            Nov 14 '18 at 0:47



















          • OnScrollChange seems to be a very viable option, because it fires after every scroll, however I still need to retrieve GetSectionForPosition somehow method value in my Adapter. I don't know what is calling GetSectionForPosition after scrolling and what is provided the int position parameter

            – Mr_LinDowsMac
            Nov 14 '18 at 0:47

















          OnScrollChange seems to be a very viable option, because it fires after every scroll, however I still need to retrieve GetSectionForPosition somehow method value in my Adapter. I don't know what is calling GetSectionForPosition after scrolling and what is provided the int position parameter

          – Mr_LinDowsMac
          Nov 14 '18 at 0:47





          OnScrollChange seems to be a very viable option, because it fires after every scroll, however I still need to retrieve GetSectionForPosition somehow method value in my Adapter. I don't know what is calling GetSectionForPosition after scrolling and what is provided the int position parameter

          – Mr_LinDowsMac
          Nov 14 '18 at 0:47


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287828%2fscroll-index-method-not-firing-consistently%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Xamarin.iOS Cant Deploy on Iphone

          Glorious Revolution

          Dulmage-Mendelsohn matrix decomposition in Python