JoshDSommer / nativescript-slides

A NativeScript plugin that is for Intro Tutorials, Image Carousels or any other slide functionality
Other
70 stars 32 forks source link

Scroll problem when I use the plugin Slides with a Tabview. #107

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi, I have found an issue when I use the Slides with a TabView. When I try to go at the next Slide with a gesture there is a strange behaviour (https://goo.gl/nHoUKX).

main-component.ts: [Disables the right/left scroll gesture of the TabView]

this.tabView = <TabView>page.getViewById("tabView");

        this.tabView.nativeView.viewPager.setOnTouchListener(new android.view.View.OnTouchListener({
            onTouch: (v: android.view.View, event: android.view.MotionEvent) => {
                return true;
            }
}));

main-component.xml:

<TabView id="tabView">
        <TabView.items>
            <TabViewItem title="Tab 1">
                <TabViewItem.view>
                    <GridLayout rows="* auto">
                        <Slides:SlideContainer id="slides">
                            <Slides:Slide class="slide-1">
                                <Label text="This is Panel 1" />    
                            </Slides:Slide>
                            <Slides:Slide class="slide-2">
                                <Label text="This is Panel 2" />
                            </Slides:Slide>
                            <Slides:Slide class="slide-3">
                                <Label text="This is Panel 3" />
                            </Slides:Slide>
                            <Slides:Slide class="slide-4">
                                <Label text="This is Panel 4" />
                            </Slides:Slide>
                            <Slides:Slide class="slide-5">
                                <Label text="This is Panel 5" />
                            </Slides:Slide>
                        </Slides:SlideContainer>
                    </GridLayout>
                </TabViewItem.view>
            </TabViewItem>
            <TabViewItem title="Tab 2">
                <TabViewItem.view>
                    <Label text="Label in Tab2" />
                </TabViewItem.view>
            </TabViewItem>
        </TabView.items>
</TabView>
JoshDSommer commented 7 years ago

Does disableing the tab view scroll work for you? I know there have been issues in the past with the sliders in a scroll view. it sounds like it would work because the way I've seen it in the past is the two components have similar behaviors and tend to conflict.

ghost commented 7 years ago

I could try with a SegmentedBar and verifies if the defect still occurs.

ghost commented 7 years ago

Works with the SegmentedBar !!

JoshDSommer commented 7 years ago

@Abdumama Awesome! Thank you for the feedback.