Skip to content

Instantly share code, notes, and snippets.

@xloger
Last active April 19, 2018 02:39
Show Gist options
  • Save xloger/0b71085abcf43fb5c4817fa34c728990 to your computer and use it in GitHub Desktop.
Save xloger/0b71085abcf43fb5c4817fa34c728990 to your computer and use it in GitHub Desktop.
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_mine, container, false)
view.mine_recycler_view.adapter = SimpleAdapter<MineActionItem>(mineActionItem,R.layout.item_mine) { holder, item ->
holder.itemView.item_mine_icon.imageResource = item.icon
holder.itemView.item_mine_title.text = item.name
holder.itemView.item_mine_tip.text = item.info
holder.itemView.setOnClickListener {
toast("$item 被点击了")
}
}
view.mine_recycler_view.layoutManager = LinearLayoutManager(context)
return view
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment