android - ClickListener in ScrollView intercepts scrolling -
i have 2 rows of imageviews in scrollview. imageviews have onclicklistener , when want scroll in area doesn't work. guess click listeners intercept scrolling of scrollview. what's best way change behaviour ? view hierarchy this:
<scrollview> <relativelayout> <framelayout> </framelayout> <relativelayout> </scrollview>
in framelayout put fragment has linearlayout in inflate other linearlayouts this:
productholder.productlayout.setonclicklistener(new view.onclicklistener() { @override public void onclick(final view v) { } });
maybe use ontouchlistener instead of onclicklistener.
in ontouchlistener can check if action of motion event click , consume event (return true). otherwise can leave event other listeners (return false) consume.
note, might need add additional implementation figuring out image view clicked, without seeing layout, it's hard give hint how it.
Comments
Post a Comment