Hello! It seems like I found the answer here , but I do not understand which layout to substitute instead of parentLayouttId. Substituted the root LinearLayout, ScrollView, directly the parent LinearLayout to my CalendarView. ̶N̶i̶ ̶u̶ ̶k̶o̶g̶o̶ ̶i̶h̶ ̶n̶i̶h̶ ̶n̶e̶t̶ ̶m̶e̶t̶o̶d̶a̶ ̶r̶e̶q̶u̶e̶s̶t̶D̶i̶s̶a̶l̶l̶o̶w̶I̶n̶t̶e̶r̶c̶e̶p̶t̶T̶o̶u̶c̶h̶E̶v̶e̶n̶t̶ (̶) ̶

For the time piker did this (I tried all three elements, as here, and separately):

final LinearLayout linearLayout1 = (LinearLayout)findViewById(R.id.firstParentLinear); final ScrollView scrollView = (ScrollView)findViewById(R.id.secondParentScroll); final LinearLayout linearLayout2 = (LinearLayout)findViewById(R.id.thirdParentLinear); timePicker.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { linearLayout1.requestDisallowInterceptTouchEvent(true); scrollView.requestDisallowInterceptTouchEvent(true); linearLayout2.requestDisallowInterceptTouchEvent(true); return false; } }); 

final asked to add a studio, without him there was an error. Still not working. I check on a real device with Android version 4.0.4. On the emulator version 4.4 such a crutch is not required, it works without it.

The structure of my layout is:

 <LinearLayout ... <ScrollView ... <LinearLayout ... <CalendarView </CalendarView> <TimePicker </TimePicker> </LinearLayout> </ScrollView> </LinearLayout> 

In 5-6 Android, the calendar and the clock have a convenient view, where you do not need to scroll anything, but under 4, the Android and the calendar and clock need to be scrolled up and down in order to set the desired date / time. When I try to scroll the calendar for another month, it twitches slightly, but the entire layout scrolls, because it is in scrollview.

How while scrolling child element does not scroll parent? How to make horizontal scrolling in calendarView? (in 4 android; in 5-6 it is already there)

  • how they have no such method? Everything is there, look better - Android Android
  • @ Android Android updated question - badadin

1 answer 1

As an option, you can hang up the pikers on some buttons so that they can open on click. You can even use custom with github -a, so that on all versions they look the same. In any case, to have a scrolling offspring and a parent is no rub.

  • They already hang on my checkboxes, but only the visibility parameter (GONE, VISIBLE) changes, and as I understand, you mean that when I click on the button, my activation switches to the onPause () state and opens on top, a new activation with inside the calendar? Hmm, I think this is the way out. And thanks for the link to the githab, a very nice piker, but I want to use the standard one. - badadin
  • one
    You do not need to open a new activation, in the example that I dropped you, it is called using the show () method - Android Android