示例#1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var v = inflater.Inflate(Resource.Layout.contentpage_tocpanel_fragment, container, false);

            if (((ContentActivity)Activity).Publication == null)
            {
                return(v);
            }

            rcTOCList = v.FindViewById <RecyclerView>(Resource.Id.rcTOCList);

            llExpiredInfoContainer = v.FindViewById <LinearLayout>(Resource.Id.llExpiredInfoContainer);
            tvExpiredCurrencyData  = v.FindViewById <TextView>(Resource.Id.tvExpiredCurrencyData);

            //llExpiredInfoContainer.Click +=
            //	(object sender, EventArgs e) =>
            //	PublicationDetailInfoFragment.NewInstance(
            //		((ContentActivity)Activity).Publication.Value.BookId, true)
            //		.Show(Activity.SupportFragmentManager);

            layoutManager             = new LinearLayoutManager(Activity);
            layoutManager.Orientation = LinearLayoutManager.Vertical;
            rcTOCList.SetLayoutManager(layoutManager);
            tocListAdaptor = new TOCListAdaptor((ContentActivity)Activity);
            rcTOCList.SetAdapter(tocListAdaptor);

            UpdateExpiredInfo();

            return(v);
        }
        public TOCListAdaptorViewHolder(View v, TOCListAdaptor adaptor) : base(v)
        {
            this.adaptor = adaptor;

            llLevelMark  = v.FindViewById <LinearLayout>(Resource.Id.llLevelMark);
            llBackground = v.FindViewById <LinearLayout>(Resource.Id.llBackground);
            llDivider    = v.FindViewById <LinearLayout>(Resource.Id.llDivider);
            tvTitle      = v.FindViewById <TextView>(Resource.Id.tvTitle);
            ivIcon       = v.FindViewById <ImageView>(Resource.Id.ivIcon);

            llBackground.SetOnClickListener(new ItemClickListener(this));
        }