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)); }
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); } }
public override void OnBackPressed() { ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this); Intent intent = new Intent(this, typeof(MainActivity)); this.StartActivity(intent, option.ToBundle()); }
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)); }
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()); }; }; }
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); } }
void view_Click(object sender, EventArgs e) { var position = (int)((View)sender).Tag; var view = (View)sender; var pictureImage = view.FindViewById <ImageViewAsync>(Resource.Id.pictureImage); var txtTitle = view.FindViewById <TextView>(Resource.Id.txtTitle); Intent intent = new Intent(context, typeof(DetailActivity)); intent.PutExtra(DetailActivity.POSITION, position); if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop) { var p1 = Pair.Create(pictureImage, pictureImage.TransitionName); var p2 = Pair.Create(txtTitle, txtTitle.TransitionName); var options = ActivityOptionsCompat.MakeSceneTransitionAnimation(context, p1, p2); context.StartActivity(intent, options.ToBundle()); } else { context.StartActivity(intent); } }
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()); }; }; }
public async Task Bugzilla_51180_ToBundle_Compat_Does_Not_Fail() { var tcsUIThread = new TaskCompletionSource <object>(); Bundle bundleOrig = null; Bundle bundleCompat = null; // We need to run these things on the UI Thread MainActivity.TestParentActivity.RunOnUiThread(() => { var context = MainActivity.TestParentActivity; var someView = MainActivity.TestParentActivity.FindViewById(Resource.Id.listView); var optionsOrig = ActivityOptions.MakeSceneTransitionAnimation(context, someView, "testTransition"); var optionsCompat = ActivityOptionsCompat.MakeSceneTransitionAnimation(context, someView, "testTransition"); bundleOrig = optionsOrig.ToBundle(); bundleCompat = optionsCompat.ToBundle(); tcsUIThread.SetResult(null); }); await tcsUIThread.Task; Assert.NotNull(bundleOrig); Assert.NotNull(bundleCompat); }
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()); }
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 OnFabClicked(object sender, EventArgs e) { adapter.CancelEditMode(); var intent = new Intent(this, typeof(GoalEditActivity)); var fabButtonPair = new Pair(fab, "fab_button"); var options = ActivityOptionsCompat.MakeSceneTransitionAnimation(this, fabButtonPair); intent.PutExtra(GoalEditActivity.NewGoal, true); ActivityCompat.StartActivity(this, intent, options.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()); }
/// <summary> /// Transitions to activity, optionally with a shared element transition. /// </summary> /// <param name="intent">The Intent for the activity to launch.</param> /// <param name="transitionView">The view that contains the shared element transition, if any.</param> protected virtual void TransitionToActivity(Intent intent, View transitionView = null) { Bundle options = null; // shared element transitions are only supported on Android 5.0+ if (transitionView != null) { options = ActivityOptionsCompat.MakeSceneTransitionAnimation(Activity, transitionView, transitionView.TransitionName).ToBundle(); } StartActivity(intent, options); }
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()); }
private void fab_click(object sender, EventArgs e) { var intent = new Intent(this, typeof(NewPollActivity)); var transitionName = GetString(Resource.String.Transition_Popup); var fab = FindViewById <FloatingActionButton>(Resource.Id.fab_add); //var sharedElement = new SharedElementHotfix(); //var bundle = sharedElement.SharedElementBundle(this, fab, transitionName); var options = ActivityOptionsCompat.MakeSceneTransitionAnimation(this, fab, transitionName); var bundle = options.ToBundle(); Android.Support.V4.Content.ContextCompat.StartActivity(this, intent, bundle); }
private void Transition(View view) { if (Build.VERSION.SdkInt < BuildVersionCodes.Lollipop) { Toast.MakeText(this, "21+ only, keep out", ToastLength.Short).Show(); } else { var intent = new Intent(this, typeof(ActivityTransitionToSampleActivity)); var options = ActivityOptionsCompat.MakeSceneTransitionAnimation(this, view, GetString(Resource.String.transition_test)); StartActivity(intent, options.ToBundle()); } }
void OnItemClick(object sender, GoalClickedEvent @event) { var intent = new Intent(this, typeof(GoalEditActivity)); intent.PutExtra(GoalEditActivity.GoalId, @event.Id.ToString()); intent.PutExtra(GoalEditActivity.ColorPalette, @event.Color); var imagePair = new Pair(@event.ImageView, GetString(Resource.String.transition_goal_image)); var fabButtonPair = new Pair(fab, "fab_button"); var options = ActivityOptionsCompat.MakeSceneTransitionAnimation(this, imagePair, fabButtonPair); ActivityCompat.StartActivity(this, intent, options.ToBundle()); }
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(); } }
private void ProfileImageView_Click(object sender, EventArgs e) { var intent = new Intent(this, typeof(FullscreenImageActivity)); var pp = new ProfileParcelable(); pp.UserProfile = user; intent.PutExtra(Constants.TRANSITION_NAME, ViewCompat.GetTransitionName(profileImageView)); intent.PutExtra(Constants.PROFILE_DATA_EXTRA, pp); intent.PutExtra(Constants.PARCEL_TYPE, 1); var options = ActivityOptionsCompat.MakeSceneTransitionAnimation(this, profileImageView, ViewCompat.GetTransitionName(profileImageView)); StartActivity(intent, options.ToBundle()); }
public void OnItemClicked(Presenter.ViewHolder itemViewHolder, Java.Lang.Object item, RowPresenter.ViewHolder rowViewHolder, Java.Lang.Object row) { if (item is Movie) { var movie = (Movie)item; var intent = new Intent(this.Activity, typeof(DetailsActivity)); intent.PutExtra(GetString(Resource.String.movie), Utils.Serialize(movie)); Bundle bundle = ActivityOptionsCompat.MakeSceneTransitionAnimation(Activity, ((ImageCardView)itemViewHolder.View).MainImageView, DetailsActivity.SHARED_ELEMENT_NAME).ToBundle(); StartActivity(intent, bundle); } }
protected virtual ActivityOptionsCompat CreateActivityTransitionOptions(Android.Content.Intent intent, MvxActivityPresentationAttribute attribute) { ActivityOptionsCompat options = null; 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)); } options = ActivityOptionsCompat.MakeSceneTransitionAnimation(CurrentActivity, sharedElements.ToArray()); } return(options); }
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)); }
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()); }
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()); }
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)); }
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()); }
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()); }
private void LoginUser(string phoneNumber) { FirebaseDatabase database = FirebaseDatabase.Instance; FirebaseCallback p = new FirebaseCallback(); p.LoginUserAsync(database, phoneNumber); p._Auth += (sender, obj) => { Progress.Hide(); if (!string.IsNullOrEmpty(obj.UserID)) { SaveUserData(obj); ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(Activity); Intent intent = new Intent(Activity, typeof(MainActivity)); StartActivity(intent); } else { LoginFailAlertDialog(); } }; }
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)); }