Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8474343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:36:03+00:00 2026-06-10T17:36:03+00:00

I have a custom Scrollview, HorizontalScrollview, and inside is a dynamic table. Each row

  • 0

I have a custom Scrollview, HorizontalScrollview, and inside is a dynamic table. Each row in table has multiple TextViews with onclicklisteners.

The problem occurs if I swipe in Y direction, then tap on the screen once. Vertical Scrolling(ScrollView) will stop working, but horizontal Scrolling still works. Please enlighten me.

ScrollView:

public class ParentScrollView extends ScrollView {
private GestureDetector mGestureDetector;
View.OnTouchListener mGestureListener;

@SuppressWarnings("deprecation")
public ParentScrollView(Context context, AttributeSet attrs) {
    super(context, attrs);
    mGestureDetector = new GestureDetector(new YScrollDetector());
    setFadingEdgeLength(0);
}

@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
    return super.onInterceptTouchEvent(ev) && mGestureDetector.onTouchEvent(ev);
}

// Return false if we're scrolling in the x direction  
class YScrollDetector extends SimpleOnGestureListener {
    @Override
    public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
        if(Math.abs(distanceY) > Math.abs(distanceX)) {
            return true;
        }
        return false;
    }
}

}

TableRowView and textview:

public void addRow(String[] data, int[] rowId) {
    for (int i = 0; i < data.length; i++) {
        TextView tv = parseTextView(data[i]);
        tv.setId(rowId[i]);
        tv.setFocusable(false);//try solving with this, no luck.
        tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(ChooseTableActivity.class == (v.getContext().getClass())){
                    ((ChooseTableActivity) v.getContext())
                            .onClickRowCell(v);
                    //passes view to activiy class that does nothing yet.
                }
            }
        });
        this.addView(tv);
    }
}

Thanks for any advice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:36:05+00:00Added an answer on June 10, 2026 at 5:36 pm

    Maybe the problem in your onInterceptTouchEvent. If it rerurns false, all other events ( move, cancel and up ) will not be triggered for you. Try to replace
    super.onInterceptTouchEvent(ev) && mGestureDetector.onTouchEvent(ev)
    with
    super.onInterceptTouchEvent(ev) || mGestureDetector.onTouchEvent(ev)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom View that is nested inside ScrollView and HorizontalScrollView like this:
I have a layout that has a ViewPager inside of a custom ScrollView and
I have created a UIScrollView (canvas.scrollview) and have a custom UIView (canvas) inside it.
Background: I have a custom scrollview (subclassed) that has uiimageviews on it that are
I have custom view in a HorizontalScrollView wrapped in a ScrollView and I want
I have custom validation rule: public function customRule($check) { } Inside this rule I
I have custom event that has several different subscribers who will all use the
I have custom UITableViewCell s as well as headers and footers. Each of them
I got stuck in here, I have a custom scrollview in a view this
I have a TableLayout within ScrollView with a background image. The problem I face

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.