-
Notifications
You must be signed in to change notification settings - Fork 0
CommonUtils
-
canClickAgain(): Boolean
Check time interval(Which is set to 1000L i.e., 1 Sec by default). It returns false if you call it again before 1 sec. Else returns true. You can specify custom time by callingAndy.doubleClickDuration(duration:Long)
. For ex. you can call it for double click prevention. -
initRecyclerViewAdapter(recyclerView: RecyclerView,yourAdapter: T,layoutOrientation: Int = RecyclerView.VERTICAL, fixedSize: Boolean = true)
Set adapter of recyclerView. Pass your recyclerView and your adapter(must extend RecyclerView.Adapter) and LinearLayoutManager orientation of adapter( default is RecyclerView.VERTICAL) and fixed or vary size of recyclerView(default is true). -
initRecyclerViewAdapter(recyclerView: RecyclerView, yourAdapter: T, yourLayoutManager:RecyclerView.LayoutManager, fixedSize: Boolean = true)
Set adapter of recyclerView. Pass your recyclerView and your adapter(must extend RecyclerView.Adapter) and layout manager for Recyclerview and fixed or vary size of recyclerView(default is true). -
removeDuplicateFromArray(duplicates: Array<T>): Array<T>
Remove duplicates from array. Pass your duplicate array. Or you can pass your list aslist.toTypedArray()
or something like that.