fix: disable viewpager2 scroll for multi device xblocks only
Added check for multi device only before disabling the
viewpager2 horizontal scroll for horizontal xblocks
@@ -100,12 +100,14 @@ public class CourseUnitNavigationActivity extends CourseBaseActivity implements
@Override
public void onPageSelected(int position) {
+ if (pagerAdapter.getUnit(position).isMultiDevice()) {
// Disable ViewPager2 scrolling to enable horizontal scrolling to for the WebView (Specific HTML Components).
List<BlockType> horizontalBlocks = Arrays.asList(
BlockType.DRAG_AND_DROP_V2, BlockType.LTI_CONSUMER, BlockType.WORD_CLOUD);
pager2.setUserInputEnabled(!horizontalBlocks
.contains(pagerAdapter.getUnit(position).getType()));
}
+ }
@Override
public void onPageScrollStateChanged(int state) {
