Skip to content

CommonUtils

Shanti Ranjan Das edited this page Jan 25, 2020 · 4 revisions
  • 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 calling Andy.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 as list.toTypedArray() or something like that.

Clone this wiki locally