private void Init(Context context) { LayoutInflater inflater = ((Activity)context).LayoutInflater; inflater.Inflate(Resource.Layout.CreatePostToolsView, this, true); _holder = new Holder(this); _holder.ToolsRecyclerView.SetLayoutManager(new LinearLayoutManager(Context)); _adapter = new CreatePostToolsRecyclerAdapter(); _holder.ToolsRecyclerView.SetAdapter(_adapter); _decorator = new SimpleDividerItemDecoration(Context); _holder.ToolsRecyclerView.AddItemDecoration(_decorator); SetButtonsActions(); }
public void SetDataSource(List <string> listTools, IToolsStylesHolder stylesHolder) { (Context as Activity)?.RunOnUiThread(() => { _adapter = new CreatePostToolsRecyclerAdapter { CellClick = OnCellClick, ToolsList = listTools, StylesHolder = stylesHolder, RecyclerView = _holder.ToolsRecyclerView }; _holder.ToolsRecyclerView.SetAdapter(_adapter); _holder.ToolsRecyclerView.AddItemDecoration(_decorator); }); }