I had a view with multiple scroll view so my question is how to detect which scroll view is scrolled?
For example if I had 3 vertical scroll view, how to know which scroll is scrolled by the user?
this is my code:
public void fillFormules(List<Category> objectsTextToShow)
{
LinearLayout layoutItemDetail = (LinearLayout) view.findViewById(R.id.middle);
LinearLayout relativeLayout = (LinearLayout) view.findViewById(R.id.titles);
LinearLayout layout = new LinearLayout(getActivity());
layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
layout.setOrientation(LinearLayout.HORIZONTAL);
ScrollView scrollView = null;
for (int j = 0; j <objectsTextToShow.size() ; j++){
TextView textCat = new TextView(getActivity());
textCat.setText(Check.Languages(objectsTextToShow.get(j).getName(), LANGUAGE_ID));
textCat.setTextSize(24);
textCat.setLayoutParams(new TableLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 1f));
textCat.setTextColor(colorUtils.TITLE);
textCat.setGravity(Gravity.CENTER);
relativeLayout.addView(textCat);
textCat.setBackgroundColor(colorUtils.backgroundColor);
LinearLayout parentLayout = new LinearLayout(getActivity());
parentLayout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, (float) 1.0));
parentLayout.setOrientation(LinearLayout.VERTICAL);
scrollView = new ScrollView(getActivity());
scrollView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, (float) 1.0));
for (int i = 0; i <objectsTextToShow.get(j).getItems().size() ; i++)
{
TextView textView = new TextView(getActivity());
textView.setTextSize(24);
textView.setText(Check.Languages(objectsTextToShow.get(j).getItems().get(i).getName(), LANGUAGE_ID));
textView.setTextColor(colorUtils.TITLE);
LinearLayout separator = new LinearLayout(getActivity());
separator.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, 100));
parentLayout.addView(separator);
parentLayout.addView(textView);
}
scrollView.setVisibility(View.VISIBLE);
scrollView.addView(parentLayout);
layout.addView(scrollView);
}
layoutItemDetail.addView(layout);
}