コード例 #1
0
        private View GetFriendTemplateDelegate(int i, MalUser malUser, View convertView)
        {
            var view = convertView;

            if (view == null)
            {
                view        = Activity.LayoutInflater.Inflate(Resource.Layout.ProfilePageGeneralTabFriendItem, null);
                view.Click += FriendButtonOnClick;
            }

            var img = (view as FrameLayout).FindViewById <ImageViewAsync>(Resource.Id.ProfilePageGeneralTabFriendItemImage);

            img.Into(malUser.ImgUrl);

            view.Tag = malUser.Wrap();

            return(view);
        }
コード例 #2
0
        private View GetTagItem(int i, MalUser s, View convertView)
        {
            var view = convertView;

            if (view == null)
            {
                view = MainActivity.CurrentContext.LayoutInflater.Inflate(Resource.Layout.PinnedUsersDialogItem, null);
                view.FindViewById <ImageButton>(Resource.Id.DeleteButton).Click +=
                    (sender, args) =>
                {
                    _dataStorageModule.StoredItems.Remove((sender as View).Tag.Unwrap <MalUser>());
                    if (ViewModelLocator.GeneralMain.CurrentMainPage == PageIndex.PageProfile)
                    {
                        ViewModelLocator.ProfilePage.RaisePropertyChanged("IsPinned");
                    }
                };

                view.SetOnClickListener(new OnClickListener(v =>
                {
                    ViewModelLocator.NavMgr.ResetMainBackNav();
                    ViewModelLocator.NavMgr.RegisterBackNav(PageIndex.PageAnimeList, null);
                    ViewModelLocator.GeneralMain.Navigate(
                        PageIndex.PageProfile,
                        new ProfilePageNavigationArgs {
                        TargetUser = v.Tag.Unwrap <MalUser>().Name
                    });

                    CleanupDialog();
                }));
            }
            var tag = s.Wrap();

            view.Tag = tag;
            view.FindViewById <ImageButton>(Resource.Id.DeleteButton).Tag = tag;
            view.FindViewById <TextView>(Resource.Id.Name).Text           = s.Name;
            view.FindViewById <ImageViewAsync>(Resource.Id.ProfileImg).Into(s.ImgUrl, new CircleTransformation());
            return(view);
        }