Giter VIP home page Giter VIP logo

Comments (7)

Wrakor avatar Wrakor commented on July 19, 2024 6

I'm having the exact same issue. Have you found any solution? Currently using constraint layout 2.0 alpha 4

from views-widgets-samples.

mohhamednabil avatar mohhamednabil commented on July 19, 2024 4

Just Add android:descendantFocusability="blocksDescendants"
To the LinearLayout inside NestedScrollView

from views-widgets-samples.

ucingHitam avatar ucingHitam commented on July 19, 2024 3

Just Add android:descendantFocusability="blocksDescendants"
To the LinearLayout inside NestedScrollView

wow here !! if nested scrol to below view in motionlayout.

thanks work for me

from views-widgets-samples.

Wojtek1234 avatar Wojtek1234 commented on July 19, 2024 1

I have created something like this

`<!--

<androidx.constraintlayout.motion.widget.MotionLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/motionLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutDescription="@xml/scene_26"
>

<ImageView
        android:id="@+id/arrow_right"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_keyboard_arrow_right"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        />

<ImageView
        android:id="@+id/arrow_up"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="316dp"
        android:src="@drawable/ic_keyboard_arrow_up"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.552"
        app:layout_constraintStart_toStartOf="parent"
        />

<View
        android:id="@+id/dial_pad"
        android:layout_width="match_parent"
        android:layout_height="500dp"
        android:background="@color/cerulean_blue"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="parent"
        />


<androidx.core.widget.NestedScrollView
        android:background="@color/brown"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:id="@+id/linearLayout"
        app:layout_constraintTop_toBottomOf="@id/dial_pad"
        >
    <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/motionInside"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            >



            <Button

                    android:layout_width="64dp"
                    android:layout_height="64dp"
                    android:background="@color/azure"
                    android:text="1"
                    android:layout_gravity="top"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    android:id="@+id/b1"
                    />

            <Button
                    android:layout_width="64dp"
                    android:layout_height="64dp"
                    android:background="@color/azure"
                    android:text="2"
                    android:layout_gravity="top"
                    android:id="@+id/b2"
                    android:layout_marginTop="300dp"
                    app:layout_constraintTop_toBottomOf="@+id/b1"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    />



            <Button
                    android:layout_width="64dp"
                    android:layout_height="64dp"
                    android:background="@color/azure"
                    android:text="3"
                    android:layout_gravity="top"
                    android:id="@+id/b3"
                    android:layout_marginTop="300dp"
                    app:layout_constraintTop_toBottomOf="@+id/b2"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    />



            <Button
                    android:layout_width="64dp"
                    android:layout_height="64dp"
                    android:background="@color/azure"
                    android:text="4"
                    android:layout_gravity="top"
                    android:id="@+id/b4"
                    android:layout_marginTop="300dp"
                    app:layout_constraintTop_toBottomOf="@+id/b3"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    />



            <Button
                    android:layout_width="64dp"
                    android:layout_height="64dp"
                    android:background="@color/azure"
                    android:text="5"
                    android:layout_gravity="top"
                    android:id="@+id/b5"
                    android:layout_marginTop="300dp"
                    app:layout_constraintTop_toBottomOf="@+id/b4"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    />



            <Button
                    android:layout_width="64dp"
                    android:layout_height="64dp"
                    android:background="@color/azure"
                    android:text="6"
                    android:layout_gravity="top"
                    android:id="@+id/b6"
                    android:layout_marginTop="300dp"
                    app:layout_constraintTop_toBottomOf="@+id/b5"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    />




            <Button
                    android:layout_width="64dp"
                    android:layout_height="64dp"
                    android:background="@color/azure"
                    android:text="7"
                    android:layout_gravity="top"
                    android:id="@+id/b7"
                    android:layout_marginTop="300dp"
                    app:layout_constraintTop_toBottomOf="@+id/b6"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    />



            <Button
                    android:layout_width="64dp"
                    android:layout_height="64dp"
                    android:background="@color/azure"
                    android:text="8"
                    android:layout_gravity="top"
                    android:id="@+id/b8"
                    android:layout_marginTop="300dp"
                    app:layout_constraintTop_toBottomOf="@+id/b7"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    />


            <Button
                    android:layout_width="64dp"
                    android:layout_height="64dp"
                    android:background="@color/azure"
                    android:text="9"
                    android:layout_gravity="top"
                    android:id="@+id/b9"
                    android:layout_marginTop="300dp"
                    app:layout_constraintTop_toBottomOf="@+id/b8"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    />


            <Button
                    android:layout_width="64dp"
                    android:layout_height="64dp"
                    android:background="@color/azure"
                    android:text="10"
                    android:layout_gravity="top"
                    android:id="@+id/b10"
                    android:layout_marginTop="300dp"
                    app:layout_constraintTop_toBottomOf="@+id/b9"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    />
    </androidx.constraintlayout.widget.ConstraintLayout>



</androidx.core.widget.NestedScrollView>

</androidx.constraintlayout.motion.widget.MotionLayout>`

with scene animation like
`

<Transition
        motion:constraintSetEnd="@id/dial"
        motion:constraintSetStart="@id/base_state"
        motion:duration="3000">
    <OnSwipe
            motion:dragDirection="dragUp"
            motion:touchAnchorId="@id/dial_pad"
            motion:touchAnchorSide="top" />
</Transition>


<ConstraintSet android:id="@+id/base_state">
    <Constraint android:id="@id/dial_pad">
        <Layout
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_marginTop="-16dp"
                motion:layout_constraintEnd_toEndOf="parent"
                motion:layout_constraintStart_toStartOf="parent"
                motion:layout_constraintTop_toBottomOf="parent" />
    </Constraint>


    <Constraint android:id="@id/linearLayout">
        <Layout
                android:layout_marginTop="-16dp"
                android:layout_width="match_parent"
                android:layout_height="2000dp"
                android:orientation="vertical"
                motion:layout_constraintTop_toBottomOf="@id/dial_pad" />
    </Constraint>

</ConstraintSet>

<ConstraintSet android:id="@+id/dial">

    <Constraint android:id="@id/dial_pad">
        <Layout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_marginTop="120dp"
                motion:layout_constraintBottom_toBottomOf="parent"
                motion:layout_constraintEnd_toEndOf="parent"
                motion:layout_constraintStart_toStartOf="parent" />
    </Constraint>


    <Constraint android:id="@id/linearLayout">
        <Layout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:layout_marginTop="120dp"
                motion:layout_constraintBottom_toBottomOf="parent"  />
    </Constraint>

</ConstraintSet>

`

In such situation in end position nested scroll view does not scroll. If you change motionInside layout to ConstrainLayout it works as excepted

from views-widgets-samples.

abhimuktheeswarar avatar abhimuktheeswarar commented on July 19, 2024

Not working well - can be more specific?
For me, it is laggy, shuttering

from views-widgets-samples.

Obehi avatar Obehi commented on July 19, 2024

Is there any progress or known solutions on this issue?

from views-widgets-samples.

andor201995 avatar andor201995 commented on July 19, 2024

I tried Static data (long string in resource file ) in Motion Layout's ScrollVIew then it work's fine but if i use dynamic data inside the ScrollView (same length string then) Scrolling stop's working

Related SOF Question i posted:

https://stackoverflow.com/questions/60242215/how-to-let-nestedscrollview-scroll-in-motionlayout

from views-widgets-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.