Exemplo n.º 1
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            if (convertView == null)
            {
                convertView = this._context.LayoutInflater.Inflate(Resource.Layout.expertslistviewitemlayout, null);
            }

            var name       = convertView.FindViewById <TextView>(Resource.Id.expert_text_name);
            var university = convertView.FindViewById <TextView>(Resource.Id.expert_text_university);
            var isexpert   = convertView.FindViewById <TextView>(Resource.Id.expert_text_isexpert);
            var email      = convertView.FindViewById <TextView>(Resource.Id.expert_text_email);
            var degree     = convertView.FindViewById <TextView>(Resource.Id.expert_text_degree);
            var image      = convertView.FindViewById <ImageView>(Resource.Id.expert_imageView);
            var lineitem   = _items[position];

            name.Text       = lineitem.Name;
            university.Text = lineitem.University;
            if (lineitem.IsTutor == true)
            {
                isexpert.Text = "Tutor";
            }
            else
            {
                isexpert.Text = "Expert";
            }
            email.Text  = lineitem.Email;
            degree.Text = lineitem.Degree;
            ////implement image loader for the image.
            var url = GlobalVal.webapibaseurl + lineitem.ImagePath;

            ImageDownloader.AssignImageAsync(image, url, _context);
            return(convertView);
        }
Exemplo n.º 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.ebookdetaillayout, container, false);

            var titlelabel = view.FindViewById <TextView>(Resource.Id.ebookdetail_titlelabel);

            titlelabel.Text = "Ebook Detail";
            var name        = view.FindViewById <TextView>(Resource.Id.ebookdetail_text_name);
            var subject     = view.FindViewById <TextView>(Resource.Id.ebookdetail_text_subject);
            var featured    = view.FindViewById <TextView>(Resource.Id.ebookdetail_text_featured);
            var description = view.FindViewById <TextView>(Resource.Id.ebookdetail_text_description);
            var author      = view.FindViewById <TextView>(Resource.Id.ebookdetail_text_author);
            var amount      = view.FindViewById <TextView>(Resource.Id.ebookdetail_text_amount);
            var image       = view.FindViewById <ImageView>(Resource.Id.ebookdetail_imageView);
            var btnpreview  = view.FindViewById <Button>(Resource.Id.btn_ebookdetail_previewebook);

            name.Text        = Vm.Name;
            subject.Text     = Vm.Subject;
            featured.Text    = Vm.Featured.ToString();
            description.Text = Vm.Description;
            author.Text      = Vm.Author;
            amount.Text      = Vm.Amount.ToString();
            var url = GlobalVal.webapibaseurl + Vm.ImagePath;

            ImageDownloader.AssignImageAsync(image, url, this.Activity);

            btnpreview.Click += Btnpreview_Click;

            return(view);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Details);

            // Retrieve navigation parameter and set as current "DataContext"
            Vm = GlobalNavigation.GetAndRemoveParameter <FlowerViewModel>(Intent);

            var headerView = LayoutInflater.Inflate(Resource.Layout.CommentsListHeaderView, null);

            headerView.FindViewById <TextView>(Resource.Id.NameText).Text        = Vm.Model.Name;
            headerView.FindViewById <TextView>(Resource.Id.DescriptionText).Text = Vm.Model.Description;

            CommentsList.AddHeaderView(headerView);
            CommentsList.Adapter = Vm.Model.Comments.GetAdapter(GetCommentTemplate);

            ImageDownloader.AssignImageAsync(FlowerImageView, Vm.Model.Image, this);

            AddCommentButton.SetCommand(Vm.AddCommentCommand);

            // Subscribing to events to avoid linker issues in release mode ---------------------------------

            // This "fools" the linker into believing that the events are used.
            // In fact we don't even subscribe to them.
            // See https://developer.xamarin.com/guides/android/advanced_topics/linking/

            if (_falseFlag)
            {
                AddCommentButton.Click += (s, e) => { };
            }
        }
Exemplo n.º 4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Details);

            // Retrieve navigation parameter and set as current "DataContext"
            Vm = GlobalNavigation.GetAndRemoveParameter <FlowerViewModel>(Intent);

            var headerView = LayoutInflater.Inflate(Resource.Layout.CommentsListHeaderView, null);

            headerView.FindViewById <TextView>(Resource.Id.NameText).Text        = Vm.Model.Name;
            headerView.FindViewById <TextView>(Resource.Id.DescriptionText).Text = Vm.Model.Description;

            CommentsList.AddHeaderView(headerView);
            CommentsList.Adapter = Vm.Model.Comments.GetAdapter(GetCommentTemplate);

            ImageDownloader.AssignImageAsync(FlowerImageView, Vm.Model.Image, this);

            // Avoid aggressive linker problem which removes the Click event
            AddCommentButton.Click += (s, e) =>
            {
            };

            AddCommentButton.SetCommand(
                "Click",
                Vm.AddCommentCommand);
        }
Exemplo n.º 5
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            if (convertView == null)
            {
                convertView = this._context.LayoutInflater.Inflate(Resource.Layout.evallistviewitemlayout, null);
            }

            var code    = convertView.FindViewById <TextView>(Resource.Id.eval_text_code);
            var name    = convertView.FindViewById <TextView>(Resource.Id.eval_text_name);
            var subject = convertView.FindViewById <TextView>(Resource.Id.eval_text_subject);
            var year    = convertView.FindViewById <TextView>(Resource.Id.eval_text_year);
            //var category = convertView.FindViewById<TextView>(Resource.Id.eval_text_category);
            var duration      = convertView.FindViewById <TextView>(Resource.Id.eval_text_duration);
            var noofquestions = convertView.FindViewById <TextView>(Resource.Id.eval_text_noofquestions);
            var image         = convertView.FindViewById <ImageView>(Resource.Id.eval_imageView);
            var lineitem      = _items[position];

            code.Text    = lineitem.Code;
            name.Text    = lineitem.Name;
            subject.Text = lineitem.Subject;
            year.Text    = lineitem.Year.ToString();
            //category.Text = lineitem.CategoryId.ToString();
            duration.Text      = lineitem.Duration.ToString();
            noofquestions.Text = lineitem.NoOfQuestions.ToString();
            //implement image loader for the image.
            var url = GlobalVal.webapibaseurl + lineitem.ImagePath;

            ImageDownloader.AssignImageAsync(image, url, _context);
            return(convertView);
        }
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            if (convertView == null)
            {
                convertView = this._context.LayoutInflater.Inflate(Resource.Layout.mysubscriptionslistviewitemlayout, null);
            }

            var name     = convertView.FindViewById <TextView>(Resource.Id.mysub_text_name);
            var category = convertView.FindViewById <TextView>(Resource.Id.mysub_text_category);
            var subject  = convertView.FindViewById <TextView>(Resource.Id.mysub_text_subject);
            var duration = convertView.FindViewById <TextView>(Resource.Id.mysub_text_duration);
            var author   = convertView.FindViewById <TextView>(Resource.Id.mysub_text_author);
            var amount   = convertView.FindViewById <TextView>(Resource.Id.mysub_text_amount);
            var image    = convertView.FindViewById <ImageView>(Resource.Id.mysub_imageView);
            var lineitem = _items[position];

            name.Text     = lineitem.Name;
            category.Text = lineitem.Category;
            subject.Text  = lineitem.Subject;
            duration.Text = lineitem.Duration.ToString();
            author.Text   = lineitem.Author;
            amount.Text   = lineitem.Amount.ToString();
            //implement image loader for the image.
            var url = GlobalVal.webapibaseurl + lineitem.url;

            ImageDownloader.AssignImageAsync(image, url, _context);
            return(convertView);
        }
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            if (convertView == null)
            {
                convertView = this._context.LayoutInflater.Inflate(Resource.Layout.mymessageslistviewitemlayout, null);
            }

            var instructorname = convertView.FindViewById <TextView>(Resource.Id.mymessage_text_instructorname);
            var message        = convertView.FindViewById <TextView>(Resource.Id.mymessage_text_message);
            var reply          = convertView.FindViewById <TextView>(Resource.Id.mymessage_text_reply);
            var subject        = convertView.FindViewById <TextView>(Resource.Id.mymessage_text_subject);
            var useremail      = convertView.FindViewById <TextView>(Resource.Id.mymessage_text_useremail);
            var read           = convertView.FindViewById <TextView>(Resource.Id.mymessage_text_read);
            var image          = convertView.FindViewById <ImageView>(Resource.Id.mymessage_imageView);
            var lineitem       = _items[position];

            instructorname.Text = lineitem.InstructorName;
            message.Text        = lineitem.Message;
            subject.Text        = lineitem.Subject;
            reply.Text          = lineitem.Reply;
            useremail.Text      = lineitem.UserEmail;
            read.Text           = lineitem.Read;
            //implement image loader for the image.
            var url = GlobalVal.webapibaseurl + lineitem.InstructorImage;

            ImageDownloader.AssignImageAsync(image, url, _context);
            return(convertView);
        }
Exemplo n.º 8
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            base.OnCreateView(inflater, container, savedInstanceState);
            var view          = inflater.Inflate(Resource.Layout.evalstartevallayout, container, false);
            var category      = view.FindViewById <TextView>(Resource.Id.starteval_text_category);
            var subject       = view.FindViewById <TextView>(Resource.Id.starteval_text_subject);
            var noofquestions = view.FindViewById <TextView>(Resource.Id.starteval_text_noofquestions);
            var totalscore    = view.FindViewById <TextView>(Resource.Id.starteval_text_totalscore);
            var textlabel     = view.FindViewById <TextView>(Resource.Id.starteval_titlelabel);

            textlabel.Text = "Start Exam";
            var btnnext      = view.FindViewById <Button>(Resource.Id.btn_starteval_next);
            var btnprevious  = view.FindViewById <Button>(Resource.Id.btn_starteval_previous);
            var btnsubmit    = view.FindViewById <Button>(Resource.Id.btn_starteval_submit);
            var qimage       = view.FindViewById <ImageView>(Resource.Id.starteval_imageView);
            var optionlist   = view.FindViewById <ListView>(Resource.Id.starteval_optionslistview);
            var questiontext = view.FindViewById <TextView>(Resource.Id.starteval_text_questiontext);

            //_bindings.Add(this.SetBinding(() => Vm.Category, category, () => category.Text, BindingMode.TwoWay));
            //_bindings.Add(this.SetBinding(() => Vm.NoOfQuestions, noofquestions, () => noofquestions.Text, BindingMode.TwoWay));
            //_bindings.Add(this.SetBinding(() => Vm.Subject, subject, () => subject.Text, BindingMode.TwoWay));
            //_bindings.Add(this.SetBinding(() => Vm.TotalScore, totalscore, () => totalscore.Text, BindingMode.TwoWay));
            //_bindings.Add(this.SetBinding(() => Vm.QuestionText, questiontext, () => questiontext.Text, BindingMode.TwoWay));


            Vm.EvalId = msg._evalId;

            category.Text      = Vm.Category;
            subject.Text       = Vm.Subject;
            noofquestions.Text = Vm.NoOfQuestions.ToString();
            totalscore.Text    = Vm.TotalScore.ToString();
            questiontext.Text  = Vm.QuestionText;

            if (Vm.ImagePath == "")
            {
                qimage.Visibility = ViewStates.Gone;
            }
            else
            {
                qimage.Visibility = ViewStates.Visible;
                var url = GlobalVal.webapibaseurl + Vm.ImagePath;
                ImageDownloader.AssignImageAsync(qimage, url, this.Activity);
            }
            _bindings.Add(this.SetBinding(() => Vm.QuestionOptionsList).WhenSourceChanges(() =>
            {
                optionlist.Adapter             = Vm.QuestionOptionsList.GetAdapter(GetOptionsList);
                optionlist.OnItemClickListener = this;
            }));

            btnnext.Click     += Btnnext_Click;
            btnprevious.Click += Btnprevious_Click;
            btnsubmit.Click   += Btnsubmit_Click;

            Vm.LoadStartEvaluationCommand.Execute(msg._evalId);
            return(view);
        }
Exemplo n.º 9
0
        private void BindViewHolder(CachingViewHolder holder, FlowerViewModel flower, int position)
        {
            var image = holder.FindCachedViewById <ImageView>(Resource.Id.FlowerImageView);

            ImageDownloader.AssignImageAsync(image, flower.Model.Image, this);

            var title = holder.FindCachedViewById <TextView>(Resource.Id.NameTextView);

            title.Text = flower.Model.Name;

            var desc = holder.FindCachedViewById <TextView>(Resource.Id.DescriptionTextView);

            desc.Text = flower.Model.Description;
        }
Exemplo n.º 10
0
        private void BindViewHolder(CachingViewHolder holder, ForecastViewModel forecast, int position)
        {
            var image = holder.FindCachedViewById <ImageView>(Resource.Id.FCT_IconImageView);

            ImageDownloader.AssignImageAsync(image, forecast.Icon, this);

            var dayOfWeek = holder.FindCachedViewById <TextView>(Resource.Id.FCT_DayOfWeekTextView);

            dayOfWeek.Text = forecast.DayOfWeek;

            var description = holder.FindCachedViewById <TextView>(Resource.Id.FCT_DescriptionTextView);

            description.Text = forecast.Description;

            var dayTemp = holder.FindCachedViewById <TextView>(Resource.Id.FCT_DayTempTextView);

            dayTemp.Text = forecast.DayTemp;
        }
Exemplo n.º 11
0
        private View GetFlowerAdapter(int position, FlowerViewModel flower, View convertView)
        {
            // Not reusing views here
            convertView = LayoutInflater.Inflate(Resource.Layout.FlowerTemplate, null);

            var title = convertView.FindViewById <TextView>(Resource.Id.NameTextView);

            title.Text = flower.Model.Name;

            var desc = convertView.FindViewById <TextView>(Resource.Id.DescriptionTextView);

            desc.Text = flower.Model.Description;

            var image = convertView.FindViewById <ImageView>(Resource.Id.FlowerImageView);

            ImageDownloader.AssignImageAsync(image, flower.Model.Image, this);

            return(convertView);
        }
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            if (convertView == null)
            {
                convertView = this._context.LayoutInflater.Inflate(Resource.Layout.evalcategorylistviewitemlayout, null);
            }

            var code     = convertView.FindViewById <TextView>(Resource.Id.evalcateg_text_code);
            var name     = convertView.FindViewById <TextView>(Resource.Id.evalcateg_text_name);
            var image    = convertView.FindViewById <ImageView>(Resource.Id.evalcateg_imageView);
            var lineitem = _items[position];

            code.Text = lineitem.Code;
            name.Text = lineitem.Name;
            //implement image loader for the image.
            var url = GlobalVal.webapibaseurl + lineitem.ImagePath;

            ImageDownloader.AssignImageAsync(image, url, _context);
            return(convertView);
        }
Exemplo n.º 13
0
        public override void SetupBindings()
        {
            SetContentView(Resource.Layout.Weather);
            _bindings.Add(this.SetBinding(
                              () => Vm.SearchLocation,
                              () => LocationTextView.Text));
            _bindings.Add(this.SetBinding(
                              () => Vm.CurrentWeather.Description,
                              () => DescriptionTextView.Text));
            _bindings.Add(this.SetBinding(
                              () => Vm.CurrentWeather.Temp,
                              () => TempTextView.Text));

            //TODO: This needs to happen as a binding
            ImageDownloader.AssignImageAsync(IconImageView, Vm.CurrentWeather.Icon, this);

            _adapter = Vm.Forecasts.GetRecyclerAdapter(
                BindViewHolder,
                Resource.Layout.ForecastTemplate);

            ForecastList.SetLayoutManager(new LinearLayoutManager(this));
            ForecastList.SetAdapter(_adapter);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            base.OnCreateView(inflater, container, savedInstanceState);
            var view       = inflater.Inflate(Resource.Layout.evaldetaillayout, container, false);
            var titlelabel = view.FindViewById <TextView>(Resource.Id.evaldetail_titlelabel);

            titlelabel.Text = "Evaluation Details";

            var code          = view.FindViewById <TextView>(Resource.Id.evaldetail_text_code);
            var name          = view.FindViewById <TextView>(Resource.Id.evaldetail_text_name);
            var subject       = view.FindViewById <TextView>(Resource.Id.evaldetail_text_subject);
            var year          = view.FindViewById <TextView>(Resource.Id.evaldetail_text_year);
            var category      = view.FindViewById <TextView>(Resource.Id.evaldetail_text_category);
            var duration      = view.FindViewById <TextView>(Resource.Id.evaldetail_text_duration);
            var noofquestions = view.FindViewById <TextView>(Resource.Id.evaldetail_text_noofquestions);
            var image         = view.FindViewById <ImageView>(Resource.Id.evaldetail_imageView);
            var btntaketest   = view.FindViewById <Button>(Resource.Id.btn_evaldetail_taketest);

            code.Text          = msg_dto.evaluation_dto.Code;
            name.Text          = msg_dto.evaluation_dto.Name;
            subject.Text       = msg_dto.evaluation_dto.Subject;
            year.Text          = msg_dto.evaluation_dto.Year.ToString();
            category.Text      = msg_dto.evaluation_dto.CategoryId.ToString();
            duration.Text      = msg_dto.evaluation_dto.Duration.ToString();
            noofquestions.Text = msg_dto.evaluation_dto.NoOfQuestions.ToString();
            //implement image loader for the image.
            var url = GlobalVal.webapibaseurl + msg_dto.evaluation_dto.ImagePath;

            ImageDownloader.AssignImageAsync(image, url, this.Activity);

            Bundle args = new Bundle();

            args.PutInt("EvalID", msg_dto.evaluation_dto.Id);
            Vm.EvalId = msg_dto.evaluation_dto.Id;
            //btntaketest.Click += delegate{
            //    Bundle args = new Bundle();
            //    args.PutInt("EvalID", msg_dto.Id);
            //    try
            //    {
            //        if (this.Activity == null || this.Activity.IsFinishing) return;
            //        var viewfragment = new TakeEvaluationFragment();
            //        var ft = ChildFragmentManager.BeginTransaction();
            //        ft.Replace(Resource.Id.dry_evalframelayout, viewfragment);
            //        ft.Commit();
            //    }
            //    catch (Exception ex)
            //    {
            //    }
            //    //Vm.OpenTakeEvaluationCommand.Execute(msg_dto.Id);
            //};
            //btntaketest.Click += Btntaketest_Click;
            btntaketest.Click += delegate {
                Vm.EvalId = msg_dto.evaluation_dto.Id;
                Vm.OpenTakeEvaluationCommand.Execute(null);
            };

            return(view);
        }