Skip to content

Commit

Permalink
updating the sample with reflectionContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrow007 committed Apr 14, 2021
1 parent 9bcbc99 commit b251398
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.jackandphantom.carousellayout.adapter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.example.customviewimple.model.DataModel
Expand All @@ -12,7 +13,7 @@ import com.jackandphantom.carouselrecyclerview.view.ReflectionImageView
class DataAdapter (private var list : List<DataModel>): RecyclerView.Adapter<DataAdapter.ViewHolder>() {

class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val image : ReflectionImageView = itemView.findViewById(R.id.image)
val image : ImageView = itemView.findViewById(R.id.image)
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
Expand Down
18 changes: 13 additions & 5 deletions app/src/main/res/layout/item_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">

<com.jackandphantom.carouselrecyclerview.view.ReflectionImageView
<com.jackandphantom.carouselrecyclerview.view.ReflectionViewContainer
android:layout_width="120dp"
android:layout_height="240dp"
android:scaleType="fitXY"
android:src="@drawable/hacker"
android:id="@+id/image"/>
android:orientation="vertical"
app:reflect_gap="5dp"
android:layout_height="240dp">

<ImageView
android:layout_width="120dp"
android:layout_height="120dp"
android:scaleType="fitXY"
android:src="@drawable/hacker"
android:id="@+id/image"/>

</com.jackandphantom.carouselrecyclerview.view.ReflectionViewContainer>

</FrameLayout>

0 comments on commit b251398

Please sign in to comment.