void OnItemClick(object sender, int position) { Tendencia itemSelecionado = tendencias[position]; var intent = new Intent(this, typeof(ResultadosActivity)); intent.PutExtra("pedido", itemSelecionado.Pedido); StartActivity(intent); }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { // loads the data at the specified position into the views whose // references are stored in the given view holder Tendencia tend = Tendencias[position]; TendenciaViewHolder vh = holder as TendenciaViewHolder; vh.Request.Text = tend.Pedido; vh.Occurrences.Text = tend.Repeticoes.ToString(); }
public List <Tendencia> ObterTendencias() { Dictionary <string, Tendencia> aux = new Dictionary <string, Tendencia>(); foreach (string s in pedidos.ObterPedidosUltimaSemana()) { Tendencia t; if (aux.TryGetValue(s, out t)) { t.inc(); } else { t = new Tendencia(s); aux.Add(s, t); } } SortedSet <Tendencia> tends = new SortedSet <Tendencia>(); foreach (Tendencia t in aux.Values) { tends.Add(t); } List <Tendencia> tendencias = new List <Tendencia>(); int i = 0; foreach (Tendencia tend in tends) { if (i == 5) { break; } tendencias.Add(tend); i++; } return(tendencias); }