Created
June 9, 2021 04:56
Revisions
-
ngima created this gist
Jun 9, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ //radapter class $adapter$ : androidx.recyclerview.widget.RecyclerView.Adapter<$adapter$.ViewHolder>() { var data: MutableList<$model$> = mutableListOf() set(value) { field = value notifyDataSetChanged() } override fun onCreateViewHolder(parent: android.view.ViewGroup, viewType: Int): ViewHolder = ViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.$item_layout_id$, parent, false)) override fun onBindViewHolder(holder: ViewHolder, position: Int) = holder.bind(data[position]) override fun getItemCount() = data.size inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { fun bind(item: $model$) = with(itemView) { // TODO: Bind the data with View } } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ //sback com.google.android.material.snackbar.Snackbar.make($parentlayout$, "$message$", Snackbar.LENGTH_LONG) .show() //snackaction com.google.android.material.snackbar.Snackbar.make($parentlayout$, "$message$", Snackbar.LENGTH_LONG) .setAction("$actionname$", {view-> } .show()