android / views-widgets-samples

Multiple samples showing the best practices in views-widgets on Android.
Apache License 2.0
5.05k stars 3.01k forks source link

not scroll scrollview in constraintlayout #36

Open mousavi007 opened 5 years ago

mousavi007 commented 5 years ago

this is my layout but my layout not scroll:

`<?xml version="1.0" encoding="utf-8"?>
<layout 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"
    xmlns:williamchart="http://schemas.android.com/apk/res-auto">

    <data>

    </data>

    <androidx.drawerlayout.widget.DrawerLayout
        android:id="@+id/mdrawer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:foregroundGravity="right"
        android:layoutDirection="rtl">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/back"
            android:orientation="vertical">

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/app_bar"
                android:layout_width="match_parent"
                android:layout_height="60dp"
                android:alpha="0.77"
                android:background="#12315C"
                android:elevation="12dp"
                android:gravity="right"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"

                    android:gravity="right"
                    android:orientation="vertical"
                    tools:layout_editor_absoluteX="16dp"
                    tools:layout_editor_absoluteY="14dp">

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content">

                        <ImageView
                            android:id="@+id/hammenu"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_alignParentStart="true"
                            android:layout_alignParentTop="true"
                            android:paddingTop="6dp"
                            android:src="@drawable/hammenu" />

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_alignParentTop="true"
                            android:layout_marginTop="0dp"
                            android:foregroundGravity="center_vertical|center|center_horizontal"
                            android:gravity="center|center_horizontal|center_vertical"
                            android:text="بازارها"
                            android:textColor="@android:color/background_light"
                            android:textSize="18dp"
                            android:textStyle="bold" />
                    </RelativeLayout>
                </LinearLayout>
            </androidx.appcompat.widget.Toolbar>

            <androidx.core.widget.NestedScrollView
                android:id="@+id/scroll"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:fillViewport="true"
                app:layout_constraintBottom_toTopOf="@+id/bottomnavigation"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/app_bar">

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <com.google.android.material.card.MaterialCardView
                        android:id="@+id/materialcardview8"
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:layout_marginStart="8dp"
                        android:layout_marginTop="16dp"
                        app:layout_constraintStart_toStartOf="parent"
                        williamchart:cardBackgroundColor="@android:color/transparent"
                        williamchart:cardCornerRadius="32dp"
                        williamchart:layout_constraintHeight_percent="0.25"
                        williamchart:layout_constraintTop_toBottomOf="@+id/materialcardview6"
                        williamchart:layout_constraintWidth_percent="0.4">

                        <io.alterac.blurkit.BlurLayout xmlns:blurkit="http://schemas.android.com/apk/res-auto"
                            android:id="@+id/blurLayout7"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            blurkit:blk_downscaleFactor="0.30"
                            blurkit:blk_fps="0" />

                        <androidx.constraintlayout.widget.ConstraintLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <ImageView
                                android:id="@+id/imageView7"
                                android:layout_width="0dp"
                                android:layout_height="0dp"
                                android:layout_marginStart="8dp"
                                android:layout_marginTop="8dp"
                                android:layout_marginEnd="8dp"
                                android:layout_marginBottom="8dp"
                                android:elevation="4dp"
                                williamchart:layout_constraintBottom_toBottomOf="parent"
                                williamchart:layout_constraintDimensionRatio="h,15:9"
                                williamchart:layout_constraintEnd_toEndOf="parent"
                                williamchart:layout_constraintStart_toStartOf="parent"
                                williamchart:layout_constraintTop_toTopOf="parent"
                                williamchart:srcCompat="@drawable/mypardis" />
                        </androidx.constraintlayout.widget.ConstraintLayout>

                    </com.google.android.material.card.MaterialCardView>

                    <com.google.android.material.card.MaterialCardView
                        android:id="@+id/materialcardview6"
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:layout_marginStart="8dp"
                        android:layout_marginTop="16dp"
                        app:layout_constraintStart_toStartOf="parent"
                        williamchart:cardBackgroundColor="@android:color/transparent"
                        williamchart:cardCornerRadius="32dp"
                        williamchart:layout_constraintHeight_percent="0.25"
                        williamchart:layout_constraintTop_toBottomOf="@+id/materialcardview4"
                        williamchart:layout_constraintWidth_percent="0.4">

                        <io.alterac.blurkit.BlurLayout xmlns:blurkit="http://schemas.android.com/apk/res-auto"
                            android:id="@+id/blurLayout5"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            blurkit:blk_downscaleFactor="0.30"
                            blurkit:blk_fps="0" />

                        <androidx.constraintlayout.widget.ConstraintLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <ImageView
                                android:id="@+id/imageView5"
                                android:layout_width="0dp"
                                android:layout_height="0dp"
                                android:layout_marginStart="8dp"
                                android:layout_marginTop="8dp"
                                android:layout_marginEnd="8dp"
                                android:layout_marginBottom="8dp"
                                android:elevation="4dp"
                                williamchart:layout_constraintBottom_toBottomOf="parent"
                                williamchart:layout_constraintDimensionRatio="h,15:9"
                                williamchart:layout_constraintEnd_toEndOf="parent"
                                williamchart:layout_constraintStart_toStartOf="parent"
                                williamchart:layout_constraintTop_toTopOf="parent"
                                williamchart:srcCompat="@drawable/mypardis" />
                        </androidx.constraintlayout.widget.ConstraintLayout>

                    </com.google.android.material.card.MaterialCardView>

                    <com.google.android.material.card.MaterialCardView
                        android:id="@+id/materialcardview4"
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:layout_marginStart="8dp"
                        android:layout_marginTop="16dp"
                        app:layout_constraintStart_toStartOf="parent"
                        williamchart:cardBackgroundColor="@android:color/transparent"
                        williamchart:cardCornerRadius="32dp"
                        williamchart:layout_constraintHeight_percent="0.25"
                        williamchart:layout_constraintTop_toBottomOf="@+id/materialcardview2"
                        williamchart:layout_constraintWidth_percent="0.4">

                        <io.alterac.blurkit.BlurLayout xmlns:blurkit="http://schemas.android.com/apk/res-auto"
                            android:id="@+id/blurLayout3"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            blurkit:blk_downscaleFactor="0.30"
                            blurkit:blk_fps="0" />

                        <androidx.constraintlayout.widget.ConstraintLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <ImageView
                                android:id="@+id/imageView3"
                                android:layout_width="0dp"
                                android:layout_height="0dp"
                                android:layout_marginStart="8dp"
                                android:layout_marginTop="8dp"
                                android:layout_marginEnd="8dp"
                                android:layout_marginBottom="8dp"
                                android:elevation="4dp"
                                williamchart:layout_constraintBottom_toBottomOf="parent"
                                williamchart:layout_constraintDimensionRatio="h,15:9"
                                williamchart:layout_constraintEnd_toEndOf="parent"
                                williamchart:layout_constraintStart_toStartOf="parent"
                                williamchart:layout_constraintTop_toTopOf="parent"
                                williamchart:srcCompat="@drawable/mypardis" />
                        </androidx.constraintlayout.widget.ConstraintLayout>

                    </com.google.android.material.card.MaterialCardView>

                    <com.google.android.material.card.MaterialCardView
                        android:id="@+id/materialcardview2"
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:layout_marginStart="8dp"
                        android:layout_marginTop="16dp"
                        app:layout_constraintStart_toStartOf="parent"
                        williamchart:cardBackgroundColor="@android:color/transparent"
                        williamchart:cardCornerRadius="32dp"
                        williamchart:layout_constraintHeight_percent="0.25"
                        williamchart:layout_constraintTop_toTopOf="parent"
                        williamchart:layout_constraintWidth_percent="0.4">

                        <io.alterac.blurkit.BlurLayout xmlns:blurkit="http://schemas.android.com/apk/res-auto"
                            android:id="@+id/blurLayout1"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            blurkit:blk_downscaleFactor="0.30"
                            blurkit:blk_fps="0" />

                        <androidx.constraintlayout.widget.ConstraintLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <ImageView
                                android:id="@+id/imageView1"
                                android:layout_width="0dp"
                                android:layout_height="0dp"
                                android:layout_marginStart="8dp"
                                android:layout_marginTop="8dp"
                                android:layout_marginEnd="8dp"
                                android:layout_marginBottom="8dp"
                                android:elevation="4dp"
                                williamchart:layout_constraintBottom_toBottomOf="parent"
                                williamchart:layout_constraintDimensionRatio="h,15:9"
                                williamchart:layout_constraintEnd_toEndOf="parent"
                                williamchart:layout_constraintStart_toStartOf="parent"
                                williamchart:layout_constraintTop_toTopOf="parent"
                                williamchart:srcCompat="@drawable/mypardis" />
                        </androidx.constraintlayout.widget.ConstraintLayout>

                    </com.google.android.material.card.MaterialCardView>

                    <com.google.android.material.card.MaterialCardView
                        android:id="@+id/materialCardView"
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:layout_marginTop="16dp"
                        android:layout_marginEnd="8dp"
                        app:cardBackgroundColor="@android:color/transparent"
                        app:cardCornerRadius="32dp"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintHeight_percent="0.25"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintWidth_percent="0.4">

                        <io.alterac.blurkit.BlurLayout xmlns:blurkit="http://schemas.android.com/apk/res-auto"
                            android:id="@+id/blurLayout2"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            blurkit:blk_downscaleFactor="0.30"
                            blurkit:blk_fps="0" />

                        <androidx.constraintlayout.widget.ConstraintLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <ImageView
                                android:id="@+id/imageView2"
                                android:layout_width="0dp"
                                android:layout_height="0dp"
                                android:layout_marginStart="8dp"
                                android:layout_marginTop="8dp"
                                android:layout_marginEnd="8dp"
                                android:layout_marginBottom="8dp"
                                android:elevation="4dp"
                                app:layout_constraintBottom_toBottomOf="parent"
                                app:layout_constraintDimensionRatio="h,15:9"
                                app:layout_constraintEnd_toEndOf="parent"
                                app:layout_constraintStart_toStartOf="parent"
                                app:layout_constraintTop_toTopOf="parent"
                                williamchart:srcCompat="@drawable/mypardis" />
                        </androidx.constraintlayout.widget.ConstraintLayout>

                    </com.google.android.material.card.MaterialCardView>

                </androidx.constraintlayout.widget.ConstraintLayout>
            </androidx.core.widget.NestedScrollView>

            <com.etebarian.meowbottomnavigation.MeowBottomNavigation
                android:id="@+id/bottomnavigation"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:mbn_backgroundBottomColor="#12315C"
                app:mbn_defaultIconColor="#7292C0"
                app:mbn_selectedIconColor="#F44275" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <com.google.android.material.navigation.NavigationView
            android:id="@+id/navigation"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="right" />

    </androidx.drawerlayout.widget.DrawerLayout>
</layout>`