[Android- Appium]Scroll an element(android.widget.HorizontalScrollView) left , I just want to scroll the element not the screen

I am trying to scroll an element to left
the element is scrollable it has five filter m 4 are visible and the fifth one is hidden until i scroll to it I have attached a photo

I have tried this ways but none worked:
way 1:
String scrollElement = “new UiSelector().resourceIdMatches(“id”)”;
String elementHidden = “new UiSelector().descriptionContains(“contentDes”)”;

	MobileElement filter = driver.findElement(MobileBy.AndroidUIAutomator("new UiScrollable(" + scrollElement + ")" +
	                ".scrollIntoView(" + elementHidden + ")"));

	filter.click();

way 2:

driver.findElement(MobileBy. AndroidUIAutomator (“new UiScrollable(new UiSelector().”

  • “resourceId(‘id’)).setAsHorizontalList().scrollIntoView(new UiSelector().text(‘text’))”)).click();

thanks

it can scroll ONLY whole scrollable list. not item. with item you need to use TOUCH actions like: start press down at point X and move to point Y. → http://appium.io/docs/en/writing-running-appium/touch-actions/

Also try to add “scrollable(true)” and use “resourceIdMatches” better:

“new UiScrollable(new UiSelector().resourceIdMatches(\"*.my_id\").scrollable(true)).setAsHorizontalList().scrollIntoView(new UiSelector().text(\"text\"))”

Thanks alot @Aleksei , I have added as you mentioned and it works perfectly
Also try to add “scrollable(true)” and use “resourceIdMatches”
and now it works fine , and that was exactly my request to “it can scroll ONLY whole scrollable list. not item.”