コード例 #1
0
ファイル: DrawerListAdapter.cs プロジェクト: takigava/pikabu
 public override View GetView(int position, View convertView, ViewGroup parent)
 {
     var row = _inflater.Inflate (Resource.Layout.DrawerListItemView,parent,false);
     var vh = new DrawerListViewHolder (row);
     vh.Icon.SetImageDrawable (_drawerMenuImages.GetDrawable(position));
     vh.Text.Text = _drawerMenuList [position];
     row.Click+= (object sender, EventArgs e) => {
         Toast.MakeText(_Context,"23523",ToastLength.Short).Show();
     };
     vh.Badge.Visibility = ViewStates.Invisible;
     if (position == 0 && _badges.Messages>0) {
         vh.Badge.Visibility = ViewStates.Visible;
         vh.Badge.Text = ""+_badges.Messages;
     }
     if (position == 1 && _badges.Feed>0) {
         vh.Badge.Visibility = ViewStates.Visible;
         vh.Badge.Text = ""+_badges.Feed;
     }
     return row;
 }
コード例 #2
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var row = _inflater.Inflate(Resource.Layout.DrawerListItemView, parent, false);
            var vh  = new DrawerListViewHolder(row);

            vh.Icon.SetImageDrawable(_drawerMenuImages.GetDrawable(position));
            vh.Text.Text = _drawerMenuList [position];
            row.Click   += (object sender, EventArgs e) => {
                Toast.MakeText(_Context, "23523", ToastLength.Short).Show();
            };
            vh.Badge.Visibility = ViewStates.Invisible;
            if (position == 0 && _badges.Messages > 0)
            {
                vh.Badge.Visibility = ViewStates.Visible;
                vh.Badge.Text       = "" + _badges.Messages;
            }
            if (position == 1 && _badges.Feed > 0)
            {
                vh.Badge.Visibility = ViewStates.Visible;
                vh.Badge.Text       = "" + _badges.Feed;
            }
            return(row);
        }