Esempio n. 1
0
 public TableSource(List <JobCMS> jobList1, SearchResultVC searchResultVcObj, Boolean isFav)
 {
     jobList        = jobList1;
     searchResultVC = searchResultVcObj;
     isFavoriteJob  = isFav;
     isLoadingData  = false;
 }
Esempio n. 2
0
        static void favAnimation(SearchResultVC instance, UIView view, bool isIn, double duration = 0.3, Action onFinished = null)
        {
            var minAlpha     = (nfloat)0.0f;
            var maxAlpha     = (nfloat)1.0f;
            var minTransform = CGAffineTransform.MakeScale((nfloat)0.1, (nfloat)0.1);
            var maxTransform = CGAffineTransform.MakeScale((nfloat)1, (nfloat)1);

            view.Alpha     = isIn ? minAlpha : maxAlpha;
            view.Transform = isIn ? minTransform : maxTransform;
            UIView.Animate(duration, 0, UIViewAnimationOptions.CurveEaseInOut,
                           () =>
            {
                view.Alpha     = isIn ? maxAlpha : minAlpha;
                view.Transform = isIn ? maxTransform : minTransform;
            },
                           onFinished
                           );
        }
Esempio n. 3
0
        void FavoriteButtonWithCount(UINavigationItem navItem)
        {
            Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent("Job Search", "Favorate_button_press", "AppEvent", null).Build());
            Gai.SharedInstance.Dispatch();             // Manually dispatch the event immediately // just for demonstration // not much recommended



            if (isFavoriteJob)
            {
                return;
            }


            List <JobCMS> favJobList = DbHelper.GetFavoriteJobs();
            int           favCount   = 0;

            if (favJobList != null)
            {
                favCount = favJobList.Count;
            }


            UIButton btn = new UIButton(UIButtonType.Custom);

            btn.Frame                     = new RectangleF(0, 0, 40, 40);
            btn.TouchUpInside            += FavoriteButtonPressed;
            btn.ShowsTouchWhenHighlighted = true;

            UILabel lbl = new UILabel();

            lbl.Frame         = new RectangleF(19, 0, 20, 20);
            lbl.Text          = favCount.ToString();
            lbl.TextAlignment = UITextAlignment.Center;
            lbl.TextColor     = UIColor.Red;

            if (favCount < 10)
            {
                lbl.Font = UIFont.BoldSystemFontOfSize(14);
            }

            else
            {
                lbl.Font = UIFont.BoldSystemFontOfSize(12);
            }

            if (favCount == 0)
            {
                btn.SetImage(UIImage.FromBundle("favicon-unselected"), UIControlState.Normal);
            }
            else
            {
                btn.SetImage(UIImage.FromBundle("Badge"), UIControlState.Normal);
                btn.AddSubview(lbl);
            }

            UIBarButtonItem barButton2 = new UIBarButtonItem(btn);

            navItem.RightBarButtonItem = barButton2;

            SearchResultVC.favAnimation(this, lbl, true, 0.3f, null);
        }