alibaba / UltraViewPager

UltraViewPager is an extension for ViewPager to provide multiple features in a single ViewPager.
MIT License
5k stars 680 forks source link

Photo in state mode centerCrop #140

Closed behnamk closed 4 years ago

behnamk commented 4 years ago

Hi I'm going to put the photo in ultraviewpager as centerCrop. Thanks for the help

        <com.google.android.material.card.MaterialCardView
            android:id="@+id/post_pics_card"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginStart="10dp"
            android:layout_marginEnd="10dp"
            app:cardCornerRadius="15dp"
            app:layout_constraintDimensionRatio="h,4:3"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/linearLayout2">

            <com.tmall.ultraviewpager.UltraViewPager
                android:id="@+id/post_pics"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_centerInParent="true"
                android:adjustViewBounds="true"
                android:scaleType="centerCrop" />

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

new pic

And thus become this state

pic2