Exemplo n.º 1
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            View itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.activity_reminder_item, parent, false);
            RiwayatReminderAdapterViewHolder vh = new RiwayatReminderAdapterViewHolder(itemView);

            return(vh);
        }
Exemplo n.º 2
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            RiwayatReminderAdapterViewHolder vh = holder as RiwayatReminderAdapterViewHolder;

            DateTime time = riwayatReminder[position].Time;

            vh.tvReminderTime.Text      = $"{time.Hour}:{time.Minute} {time.ToString("tt")}";
            vh.tvReminderMessage.Text   = riwayatReminder[position].Message.ToString();
            vh.swReminderSwitch.Checked = riwayatReminder[position].Active;

            // add listener
            vh.swReminderSwitch.CheckedChange += delegate(object sender, CompoundButton.CheckedChangeEventArgs e) { switch_itemSelected(sender, e, vh.ItemView.Context, position); };
            vh.spReminderAction.ItemSelected  += new EventHandler <AdapterView.ItemSelectedEventArgs>((sender, e) => spinner_ItemSelected(sender, e, vh.ItemView.Context, position));
        }