コード例 #1
0
        private void AddView(Sponsor sponsor, FlowLayout container)
        {
            var imageView = new SponsorImageView(Activity);
            imageView.BindData(sponsor, (_, __) =>
                {
                    if (string.IsNullOrEmpty(sponsor.Url))
                    {
                        return;
                    }
                    AnalyticsTracker.SendEvent("sponsor", sponsor.Url);
                    AppUtil.ShowWebPage(Activity, sponsor.Url);
                });

            var lparams = new FlowLayout.LayoutParams(
                FlowLayout.LayoutParams.WrapContent, FlowLayout.LayoutParams.WrapContent);
            int margin = (int) Resources.GetDimension(Resource.Dimension.spacing_small);
            lparams.SetMargins(margin, margin, 0, 0);
            container.AddView(imageView, lparams);
        }
コード例 #2
0
 private SponsorImageViewBinding(LayoutInflater inflater, int layoutId, SponsorImageView view, bool attachToRoot)
 {
     Root     = inflater.Inflate(layoutId, view, attachToRoot);
     rootView = Root.FindViewById <ViewGroup>(Resource.Id.root_view);
     imgLogo  = Root.FindViewById <ImageView>(Resource.Id.img_logo);
 }
コード例 #3
0
 public static SponsorImageViewBinding Inflate(LayoutInflater inflater, int layoutId, SponsorImageView view, bool attachToRoot)
 {
     return(new SponsorImageViewBinding(inflater, layoutId, view, attachToRoot));
 }
コード例 #4
0
 public static SponsorImageViewBinding Inflate(LayoutInflater inflater, int layoutId, SponsorImageView view, bool attachToRoot)
 {
     return new SponsorImageViewBinding(inflater, layoutId, view, attachToRoot);
 }
コード例 #5
0
 private SponsorImageViewBinding(LayoutInflater inflater, int layoutId, SponsorImageView view, bool attachToRoot)
 {
     Root = inflater.Inflate(layoutId, view, attachToRoot);
     rootView = Root.FindViewById<ViewGroup>(Resource.Id.root_view);
     imgLogo = Root.FindViewById<ImageView>(Resource.Id.img_logo);
 }