Ejemplo n.º 1
0
        private void GetCategories()
        {
            FirebaseDatabase database = FirebaseDatabase.Instance;

            FirebaseCallback p = new FirebaseCallback();

            p.GetSubCategories(Selected, database);
            p.SubCategories += (sender, obj) =>
            {
                objCategories        = obj;
                mProgress.Visibility = ViewStates.Gone;
                mCatAdapter          = new SubCategory_Adapters(ApplicationContext, obj);
                recyclerView.SetAdapter(mCatAdapter);
                mCatAdapter.ItemClick += (s, o) =>
                {
                    ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
                    Intent intent = new Intent(this, typeof(ShoppingActivity));
                    intent.PutExtra("CategoryID", mCatAdapter.category[o].CategoryID);
                    intent.PutExtra("Category", mCatAdapter.category[o].SubCategory);
                    intent.PutExtra("Translation", mCatAdapter.category[o].Translation);

                    intent.PutExtra("SubCategory", mCatAdapter.category[o].SubCategoryID);
                    StartActivity(intent, option.ToBundle());
                };
            };
        }
        public override void OnBackPressed()
        {
            ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
            Intent intent = new Intent(this, typeof(MainActivity));

            this.StartActivity(intent, option.ToBundle());
        }
        private void AdapterOnItemClicked(object sender, SillyDudeItemViewModel viewModel)
        {
            Log.Info($"AdapterOnItemClicked item {viewModel}");

            Intent intent = new Intent(this, typeof(SillyDudeDetailsActivity));

            intent.PutExtra("id", viewModel.Id);

            if ((int)Build.VERSION.SdkInt >= (int)BuildVersionCodes.Lollipop)
            {
                intent.PutExtra(SillyDudeDetailsActivity.TRANSITION_NAME, viewModel.ImageUrl);

                var imageView = (ImageView)sender;
                imageView.TransitionName = SillyDudeDetailsActivity.TRANSITION_NAME;

                ActivityOptionsCompat options =
                    ActivityOptionsCompat.MakeSceneTransitionAnimation(this, imageView, imageView.TransitionName);

                ActivityCompat.StartActivity(this, intent, options.ToBundle());
            }
            else
            {
                StartActivity(intent);
            }
        }
        protected override void ShowActivity(Type view,
                                             MvxActivityPresentationAttribute attribute,
                                             MvxViewModelRequest request)
        {
            var intent = CreateIntentForRequest(request);

            if (attribute.Extras != null)
            {
                intent.PutExtras(attribute.Extras);
            }

            var activity = CurrentActivity;

            if (activity == null)
            {
                MvxTrace.Warning("Cannot Resolve current top activity");
                return;
            }

            if (attribute.SharedElements != null)
            {
                IList <Pair> sharedElements = new List <Pair>();
                foreach (var item in attribute.SharedElements)
                {
                    intent.PutExtra(item.Key, ViewCompat.GetTransitionName(item.Value));
                    sharedElements.Add(Pair.Create(item.Value, item.Key));
                }
                ActivityOptionsCompat options = ActivityOptionsCompat.MakeSceneTransitionAnimation(CurrentActivity, sharedElements.ToArray());
                activity.StartActivity(intent, options.ToBundle());
            }
            else
            {
                activity.StartActivity(intent);
            }
        }
Ejemplo n.º 5
0
        public bool OnNavigationItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Resource.Id.sorting:
                var trans = SupportFragmentManager.BeginTransaction();
                var sort  = new Sort_Menu_Dialogy();
                sort.Show(trans, "Sorting");
                return(true);

            case Resource.Id.view:
                ChangeLayout(recyclerView);
                return(true);

            case Resource.Id.home:
                ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
                Intent i = new Intent(this, typeof(MainActivity));
                StartActivity(i, option.ToBundle());
                return(true);

            default:
                break;
            }
            return(OnNavigationItemSelected(item));
        }
Ejemplo n.º 6
0
        private void GetCategories()
        {
            FirebaseDatabase database = FirebaseDatabase.Instance;
            FirebaseCallback p        = new FirebaseCallback();

            p.GetCategoriesAll(database);
            p.Categories += (sender, obj) =>
            {
                progressBar.Visibility = ViewStates.Invisible;

                objCategories = obj;
                Adapter       = new Category_Adapter(this, obj);
                recyclerView.SetAdapter(Adapter);
                Adapter.ItemClick += (s, o) =>
                {
                    p.Dispose();
                    database.Dispose();

                    Intent intent = new Intent(this, typeof(Activity_SubCategory));
                    ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
                    intent.PutExtra("CategoryID", Adapter.category[o].CategoryID);
                    intent.PutExtra("Category", Adapter.category[o].Category);
                    intent.PutExtra("Translation", Adapter.category[o].Translation);

                    StartActivity(intent, option.ToBundle());
                };
            };
        }
Ejemplo n.º 7
0
        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            MenuInflater.Inflate(Resource.Menu.menu_shopping_cart, menu);
            var item = menu.FindItem(Resource.Id.action_cart);

            View actionView = MenuItemCompat.GetActionView(item);

            _CartItemCount = actionView.FindViewById <ImageView>(Resource.Id.cart_badge);

            mCartItemCount = Broker.GetCart().Rows.Count;
            if (mCartItemCount == 0)
            {
                _CartItemCount.Visibility = ViewStates.Gone;
            }
            else
            {
                _CartItemCount.Visibility = ViewStates.Visible;
            }
            actionView.Click += (o, e) =>
            {
                ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
                Intent i = new Intent(this, typeof(MyCart_Activity));
                StartActivity(i, option.ToBundle());
            };

            return(base.OnCreateOptionsMenu(menu));
        }
Ejemplo n.º 8
0
        private void FAQ()
        {
            ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(Activity);
            Intent intent = new Intent(Activity, typeof(Faq_Activity));

            intent.PutExtra("Back", true);
            this.StartActivity(intent, option.ToBundle());
        }
Ejemplo n.º 9
0
        private void ProfileConstraint_Click(object sender, System.EventArgs e)
        {
            var intent = new Intent(this, typeof(ProfileActivity));

            intent.PutStringArrayListExtra("extra_details", userPro);
            ActivityOptionsCompat op = ActivityOptionsCompat.MakeSceneTransitionAnimation(this, profileIv, "profile_holder");

            StartActivity(intent, op.ToBundle());
        }
        private void GetSharedIntent()
        {
            var sharedIntent = new Intent(this, typeof(GetStartedActivity));

            Android.Support.V4.Util.Pair p1 = Android.Support.V4.Util.Pair.Create(countryFlagImg, "cc_trans");
            Android.Support.V4.Util.Pair p2 = Android.Support.V4.Util.Pair.Create(mEditText, "edittext_trans");

            ActivityOptionsCompat activityOptions = ActivityOptionsCompat.MakeSceneTransitionAnimation(this, p1, p2);

            StartActivity(sharedIntent, activityOptions.ToBundle());
        }
Ejemplo n.º 11
0
        private void Adapter_ItemClick(object sender, int p)
        {
            Broker.UpdateReaded(Adapter._Notifications[p].Id);
            ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
            Intent i = new Intent(this, typeof(DetailsNotification));

            i.PutExtra("body", Adapter.Notif[p].Body);
            i.PutExtra("title", Adapter.Notif[p].Title);
            i.PutExtra("date", Adapter.Notif[p].Date);
            i.PutExtra("json", Adapter.Notif[p].Json);
            StartActivity(i, option.ToBundle());
        }
Ejemplo n.º 12
0
 public override void OnBackPressed()
 {
     if (Intent.GetBooleanExtra("Back", false))
     {
         ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
         Intent intent = new Intent(this, typeof(Order_Complete_Activity));
         this.StartActivity(intent, option.ToBundle());
     }
     else
     {
         base.OnBackPressed();
     }
 }
Ejemplo n.º 13
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Android.Resource.Id.Home:
                Finish();
                return(true);

            case Resource.Id.action_cart:
                ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
                Intent i = new Intent(this, typeof(MyCart_Activity));
                StartActivity(i, option.ToBundle());
                return(true);

            default:
                break;
            }
            return(base.OnOptionsItemSelected(item));
        }
Ejemplo n.º 14
0
        public void OnItemClicked(int p, ImageView view)
        {
            ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this, view, Adapter.Product[p].ProductID);
            Intent i = new Intent(this, typeof(ActivityDetails));

            i.PutExtra("SellerID", Adapter.Product[p].SellerID);
            i.PutExtra("ProductID", Adapter.Product[p].ProductID);
            i.PutExtra("Product", Adapter.Product[p].Product);
            i.PutExtra("Price", Adapter.Product[p].Price);
            i.PutExtra("Buy_Price", Adapter.Product[p].Buy_Price);
            i.PutExtra("Description", Adapter.Product[p].Description);
            i.PutExtra("Sizes", Adapter.Product[p].Sizes);
            i.PutExtra("Thumbnail_1", Adapter.Product[p].Thumbnail_1);
            i.PutExtra("Thumbnail_2", Adapter.Product[p].Thumbnail_2);
            i.PutExtra("Thumbnail_3", Adapter.Product[p].Thumbnail_3);
            i.PutExtra("Category", Adapter.Product[p].Category);
            i.PutExtra("SubCategory", Adapter.Product[p].SubCategory);

            StartActivity(i, option.ToBundle());
        }
Ejemplo n.º 15
0
        private void Purchasing(List <Products> pr, User S)
        {
            string           purchasesID = string.Empty;
            FirebaseDatabase database    = FirebaseDatabase.Instance;
            var myRef = database.Reference;

            if (S == null)
            {
                purchasesID = myRef.Push().Key;
            }
            else
            {
                purchasesID = S.PurchasesID;
            }

            if (!string.IsNullOrEmpty(S.PurchasesID))
            {
                myRef.Child("Purchases").Child(UserID).Child(purchasesID).RemoveValue();
            }



            var jsonObject2 = new Purchases();

            jsonObject2.PurchasesID = purchasesID;
            jsonObject2.UserID      = UserID;

            //Insert transaction required
            var json  = JsonConvert.SerializeObject(pr);
            var json1 = JsonConvert.SerializeObject(jsonObject2);

            ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
            Intent i = new Intent(this, typeof(ShippingDetails));

            i.PutExtra("products", json);
            i.PutExtra("transaction", json1);
            i.PutExtra("from", "cart");

            StartActivity(i, option.ToBundle());
        }
Ejemplo n.º 16
0
        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            MenuInflater.Inflate(Resource.Menu.menu_shopping, menu);

            var item  = menu.FindItem(Resource.Id.search);
            var item2 = menu.FindItem(Resource.Id.action_cart);

            var searchView = MenuItemCompat.GetActionView(item);

            _searchView = searchView.JavaCast <Android.Support.V7.Widget.SearchView>();

            var hint = Resources.GetString(Resource.String.hint_search_in);

            _searchView.QueryHint        = Resources.GetString(Resource.String.hint_search);
            _searchView.QueryTextSubmit += SearchView_QueryTextSubmitAsync;

            _searchView.OnActionViewExpanded();

            View actionView = MenuItemCompat.GetActionView(item2);

            _CartItemCount = actionView.FindViewById <ImageView>(Resource.Id.cart_badge);

            mCartItemCount = app.GetInt("MyCart", 0);
            if (mCartItemCount == 0)
            {
                _CartItemCount.Visibility = ViewStates.Gone;
            }
            else
            {
                _CartItemCount.Visibility = ViewStates.Visible;
            }
            actionView.Click += (o, e) =>
            {
                ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
                Intent i = new Intent(this, typeof(MyCart_Activity));
                StartActivity(i, option.ToBundle());
            };

            return(base.OnCreateOptionsMenu(menu));
        }
Ejemplo n.º 17
0
        private void BtnContinue_Click(object sender, EventArgs e)
        {
            ISharedPreferences       preferences = PreferenceManager.GetDefaultSharedPreferences(this);
            ISharedPreferencesEditor editor      = preferences.Edit();

            editor.PutString("locale", locale);
            editor.Commit();


            Intent intent = new Intent(this, typeof(LoginActivity));
            //ActivityOptionsCompat options = ActivityOptionsCompat.
            //    MakeSceneTransitionAnimation(this, (View)overlay, "background");

            Pair p1 = Pair.Create(overlay, "background");
            Pair p2 = Pair.Create(logo, "logo");

            ActivityOptionsCompat options = ActivityOptionsCompat.
                                            MakeSceneTransitionAnimation(this, p1, p2);


            StartActivity(intent, options.ToBundle());
        }
Ejemplo n.º 18
0
        private void DirectPurchasing(Products p, User S)
        {
            string           purchasesID = string.Empty;
            FirebaseDatabase database    = FirebaseDatabase.Instance;
            FirebaseCallback firebase    = new FirebaseCallback();
            var myRef = database.Reference;

            if (S == null)
            {
                purchasesID = myRef.Push().Key;
            }
            else
            {
                purchasesID = S.PurchasesID;
            }


            //Insert transaction required
            var json = JsonConvert.SerializeObject(p);

            var jsonObject2 = new Purchases();

            jsonObject2.PurchasesID = purchasesID;
            jsonObject2.UserID      = UserID;

            p.Selected_Size = selected_size;
            p.Qty           = qty;
            var json2 = JsonConvert.SerializeObject(p);
            var json1 = JsonConvert.SerializeObject(jsonObject2);

            ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
            Intent i = new Intent(this, typeof(ShippingDetails));

            i.PutExtra("products", json2);
            i.PutExtra("transaction", json1);
            //i.PutExtra("from", "cart");

            StartActivity(i, option.ToBundle());
        }
Ejemplo n.º 19
0
        public bool OnNavigationItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Resource.Id.sorting:
                SortingDialog();
                return(true);

            case Resource.Id.view:
                ChangeLayout(recyclerView);
                return(true);

            case Resource.Id.home:
                ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
                Intent i = new Intent(this, typeof(MainActivity));
                StartActivity(i, option.ToBundle());
                return(true);

            default:
                break;
            }
            return(OnNavigationItemSelected(item));
        }
Ejemplo n.º 20
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Android.Resource.Id.Home:
                if (Intent.GetBooleanExtra("Back", false))
                {
                    ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
                    Intent intent = new Intent(this, typeof(Order_Complete_Activity));
                    this.StartActivity(intent, option.ToBundle());
                    Finish();
                }
                else
                {
                    base.Finish();
                }
                return(true);

            default:
                break;
            }
            return(base.OnOptionsItemSelected(item));
        }
Ejemplo n.º 21
0
 public static void OpenProfile(Activity activity, string eventPage, UserInfoObject item, ImageView image)
 {
     try
     {
         if (item.Id != UserDetails.UserId)
         {
             var intent = new Intent(activity, typeof(UserProfileActivity));
             intent.PutExtra("EventPage", eventPage); // Close , Move , likeAndClose , HideButton
             intent.PutExtra("ItemUser", JsonConvert.SerializeObject(item));
             if (AppSettings.EnableAddAnimationImageUser)
             {
                 if (image != null)
                 {
                     ActivityOptionsCompat options = ActivityOptionsCompat.MakeSceneTransitionAnimation((Activity)activity, image, "profileimage");
                     activity.StartActivity(intent, options.ToBundle());
                 }
                 else
                 {
                     activity.StartActivity(intent);
                 }
             }
             else
             {
                 activity.StartActivity(intent);
             }
         }
         else
         {
             HomeActivity.GetInstance()?.NavigationTabBar.SetModelIndex(4, true);
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }