public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ((MyPublicationsActivity)Activity).PublicationListFragment = this;
            Log.Info("dbg", "set PublicationListFragment.");

            var v = inflater.Inflate(Resource.Layout.publicationlist_fragment, container, false);

            tvNoTitleMessage   = v.FindViewById <TextView>(Resource.Id.tvNoTitleMessage);
            tvNoHistoryMessage = v.FindViewById <TextView>(Resource.Id.tvNoHistoryMessage);

            publicationfilter = v.FindViewById <Spinner>(Resource.Id.publicationfilter);
            ArrayAdapter aa = ArrayAdapter.CreateFromResource(Activity, Resource.Array.PublicationFilter, Android.Resource.Layout.SimpleSpinnerItem);

            aa.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            publicationfilter.Adapter       = aa;
            publicationfilter.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected);

            rcPublicationList                = v.FindViewById <RecyclerView>(Resource.Id.rcPublicationList);
            publistLayoutManager             = new LinearLayoutManager(Activity);
            publistLayoutManager.Orientation = LinearLayoutManager.Vertical;
            rcPublicationList.SetLayoutManager(publistLayoutManager);
            prcAdaptor = new PublicationsAdaptor(Activity);
            prcAdaptor.HasStableIds = true;
            rcPublicationList.SetAdapter(prcAdaptor);
            rcPublicationList.GetItemAnimator().SupportsChangeAnimations = false;

            llHistoryListContainer            = v.FindViewById <LinearLayout>(Resource.Id.llHistoryListContainer);
            llHistoryListContainer.Visibility = ViewStates.Invisible;

            bool originalyEmptyPublicationList = DataCache.INSTATNCE.PublicationManager.IsPublicationListEmpty();

            //tvNoTitleMessage.Visibility = originalyEmptyPublicationList ? ViewStates.Visible : ViewStates.Gone;
            tvNoTitleMessage.Visibility = ViewStates.Gone;

            // Only when truely new create view, the wait dialog should be poped up.
            // Rotation of screen will not popup wait dialog.
            bool newCreated = savedInstanceState == null;

            GetPublicationListOnline(originalyEmptyPublicationList && newCreated);

            return(v);
        }
Esempio n. 2
0
        public PublicationsAdaptorViewHolder(View v, PublicationsAdaptor adaptor) : base(v)
        {
            this.adaptor = adaptor;

            llPublicationItemBackground = v.FindViewById <LinearLayout>(Resource.Id.llPublicationItemBackground);

            coverHolder = new PublicationCoverViewHolder(v);

            tvPubInfo_1stLine = v.FindViewById <TextView>(Resource.Id.tvPubInfo_1stLine);
            tvPubInfo_2ndLine = v.FindViewById <TextView>(Resource.Id.tvPubInfo_2ndLine);


            //tvTaskStatus = v.FindViewById<TextView>(Resource.Id.tvTaskStatus);
            imgPubInfo_1stLine = v.FindViewById <ImageView>(Resource.Id.imgPubInfo_1stLine);
            imgPubInfo_2ndLine = v.FindViewById <ImageView>(Resource.Id.imgPubInfo_2ndLine);

            imgPubInfo_1stLine.SetOnClickListener(new InfoButtonClickListener(this));
            imgPubInfo_2ndLine.SetOnClickListener(new DownloadButtonClickListener(this));

            llPublicationItemBackground.SetOnClickListener(new PublicationItemClickListener(this));
        }