Skip to content

Commit

Permalink
latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunalapk committed Dec 4, 2020
1 parent e2e0c03 commit 4e9569a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class CustomAdapter<T>(private val activity:AppCompatActivity?,private val isPag
private var onClickListener: Any? = null
private var anyObject: Any? = null
private var _layout: Int? = null
private var loaderLayout: Int = R.layout.item_loader

lateinit var smartRecyclerViewListener: SmartRecyclerViewListener<T>
internal lateinit var viewAttachListener: ViewAttachListener<T>
Expand All @@ -30,7 +31,7 @@ class CustomAdapter<T>(private val activity:AppCompatActivity?,private val isPag
layout = smartRecyclerViewListener.getViewLayout(viewType)
}
if(viewType==-67){
layout = R.layout.item_loader
layout = loaderLayout
}

val binding: ViewDataBinding = DataBindingUtil.inflate(layoutInflater,layout, parent, false)
Expand All @@ -51,6 +52,10 @@ class CustomAdapter<T>(private val activity:AppCompatActivity?,private val isPag
super.onViewAttachedToWindow(holder)
}

fun setLoaderLayout(loaderLayout:Int){
this.loaderLayout = loaderLayout
}

fun setOnClickListener(onClickListener:Any?){
this.onClickListener = onClickListener
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class SmartRecyclerView<T> : SwipeRefreshLayout {
}
}

fun setLoaderLayout(loaderLayout:Int){
customAdapter.setLoaderLayout(loaderLayout)
}

fun setCustomPadding(paddingLeft:Int,paddingTop:Int,paddingRight:Int,paddingBottom:Int){
shimmerView?.setPadding(paddingLeft,paddingTop+5,paddingRight,0)
recyclerView?.setPadding(paddingLeft,paddingTop,paddingRight,paddingBottom)
Expand Down

0 comments on commit 4e9569a

Please sign in to comment.