protected override void OnResume() { base.OnResume(); if (prefs.GetBoolean("FirstRun", true)) { var vt_btnTutor = new ViewTarget(Resource.Id.btnTutor, this); ShowcaseView.ConfigOptions config = new ShowcaseView.ConfigOptions(); config.IsOneShot = false; config.ShowcaseId = 0; ShowcaseView showcaseView_btnTutor = ShowcaseView.InsertShowcaseView(vt_btnTutor, this, "Tutorial", "Use this section to train by playing a series of notes.", config); var vt_btnTuner = new ViewTarget(Resource.Id.btnTuner, this); config.ShowcaseId = 1; ShowcaseView showcaseView_btnTuner = ShowcaseView.InsertShowcaseView(vt_btnTuner, this, "Tuner", "Use this to tune your guitar.", config); /*NoneOnShowcaseEventListener nosel = new NoneOnShowcaseEventListener(); * nosel.OnShowcaseViewDidHide(showcaseView_btnTuner); * showcaseView_btnTutor.SetOnShowcaseEventListener(nosel);*/ showcaseView_btnTutor.Show(); prefs.Edit().PutBoolean("FirstRun", false).Commit(); } }
public void OnShowcaseViewHide(ShowcaseView showcaseView) { if (IsHoneycombOrAbove()) { listView.Alpha = 1f; } buttonBlocked.Enabled = false; }
public SiteResponse <List <ShowcaseView> > Get() { myPanelDBEntities db = new myPanelDBEntities(); var response = new SiteResponse <List <ShowcaseView> >(); var allpack = db.PurchacingPackages.ToList(); var com = db.Companies.ToList(); response.Status = allpack.Any(); if (response.Status) { //packageid=1 kampanyalar bölümü veritabanında olmayan kampanyaların company_idsi 0dır. response.Message = "Showcase listeleniyor"; var showInfo = new List <ShowcaseView>(); foreach (var purchacing in allpack) { var show = new ShowcaseView(); if (purchacing.PackageId == 2) { var varmıCom = com.Where(c => c.CompanyName == purchacing.CompanyName).ToList().Any(); if (varmıCom) { show.Adress = purchacing.Adress; show.CompanyName = purchacing.CompanyName; show.PackageId = purchacing.PackageId; show.AddedDate = purchacing.PurchaseDate; show.CompanyId = db.Companies.FirstOrDefault(s => s.CompanyName.Contains(purchacing.CompanyName)).Id; showInfo.Add(show); var getComid = db.Companies.Find(show.CompanyId); var comidList = new List <Companies>(); //veritabanında kayıtlı olan firmalar if (show.CompanyId != 0) { var İnfoShowLists = new List <Company>(); var myCom = new Company(getComid); İnfoShowLists.Add(myCom); show.mycom = İnfoShowLists.ToList(); } } else { show.Adress = purchacing.Adress; show.CompanyName = purchacing.CompanyName; show.PackageId = purchacing.PackageId; show.AddedDate = purchacing.PurchaseDate; showInfo.Add(show); } } } response.Data = showInfo; } else { response.Message = "Listelenecek Showcase yok"; } return(response); }
public override bool OnCreateOptionsMenu(IMenu menu) { MenuInflater.Inflate(Resource.Menu.menu, menu); var target = new ActionViewTarget(this, ActionViewTarget.Type.OVERFLOW); sv = ShowcaseView.InsertShowcaseView(target, this, Resource.String.showcase_simple_title, Resource.String.showcase_simple_message, mOptions); sv.Activated = true; return(base.OnCreateOptionsMenu(menu)); }
public override void OnActivityCreated(Bundle savedInstanceState) { base.OnActivityCreated(savedInstanceState); //SetContentView() needs to be called in the Activity first. //That's why it has to be in OnActivityCreated(). var configOptions = new ShowcaseView.ConfigOptions(); configOptions.HideOnClickOutside = true; ShowcaseView.InsertShowcaseView(new ViewTarget(Resource.Id.buttonFragments, Activity), Activity, Resource.String.showcase_fragment_title, Resource.String.showcase_fragment_message, configOptions); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_animation); counter = 0; var textView1 = FindViewById <TextView>(Resource.Id.animation_textView); var textView2 = FindViewById <TextView>(Resource.Id.animation_textView2); var textView3 = FindViewById <TextView>(Resource.Id.animation_textView3); showcaseView = ShowcaseView.InsertShowcaseView(new ViewTarget(FindViewById(Resource.Id.animation_textView)), this); showcaseView.OverrideButtonClick((s, e) => { switch (counter) { case 0: showcaseView.SetShowcase(new ViewTarget(textView2), true); break; case 1: showcaseView.SetShowcase(new ViewTarget(textView3), true); break; case 2: showcaseView.SetShowcase(null); showcaseView.SetText("Look ma!", "You don't always need a target to showcase"); SetAlpha(0.4f, new View[] { textView1, textView2, textView3 }); break; case 3: showcaseView.Hide(); SetAlpha(1.0f, new View[] { textView1, textView2, textView3 }); break; } counter++; }); if (Build.VERSION.SdkInt >= BuildVersionCodes.Honeycomb) { enableUp(); } }
public static Point GetShowcasePointFromView(View view, ShowcaseView.ConfigOptions options) { var result = new Point(); if (options.Insert == ShowcaseView.INSERTTOVIEW) { result.X = view.Left + view.Width / 2; result.Y = view.Top + view.Height / 2; } else { var coordinates = new int[2]; view.GetLocationInWindow(coordinates); result.X = coordinates[0] + view.Width / 2; result.Y = coordinates[1] + view.Height / 2; } return result; }
public static Animator OfPoints(ShowcaseView showcaseView, Point[] values) { return OfPoints(showcaseView, "showcaseX", "showcaseY", values); }
public void OnShowCaseAcknowledged(ShowcaseView showcaseView) { Toast.MakeText(parent, Resource.String.dismissed_message, ToastLength.Short).Show(); }
public static Animator OfPoints(ShowcaseView showcaseView, Point[] values) { return(OfPoints(showcaseView, "showcaseX", "showcaseY", values)); }
public static Animator OfPoints(ShowcaseView showcaseView, Point point) { return(OfPoints(showcaseView, new Point[] { point })); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main); var adapter = new HardcodedListAdapter(this); listView = FindViewById <ListView>(Resource.Id.listView); listView.Adapter = adapter; listView.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs e) { switch (e.Position) { case 0: StartActivity(typeof(ActionItemsSampleActivity)); break; case 1: StartActivity(typeof(MultipleShowcaseSampleActivity)); break; case 2: StartActivity(typeof(ShowcaseFragmentActivity)); break; case 3: StartActivity(typeof(AnimationSampleActivity)); break; // Not currently used case 4: StartActivity(typeof(MemoryManagementTesting)); break; } }; DimView(listView); buttonBlocked = FindViewById <Button>(Resource.Id.buttonBlocked); buttonBlocked.Click += delegate { showcaseView.AnimateGesture(0, 0, 0, 400); }; var co = new ShowcaseView.ConfigOptions(); co.HideOnClickOutside = true; // The following code will reposition the OK button to the left. // var layoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); // layoutParams.AddRule(LayoutRules.AlignParentBottom); // layoutParams.AddRule(LayoutRules.AlignParentLeft); // int margin = (int)Resources.DisplayMetrics.Density * 12; // layoutParams.SetMargins(margin, margin, margin, margin); // co.ButtonLayoutParams = layoutParams; var target = new ViewTarget(Resource.Id.buttonBlocked, this); showcaseView = ShowcaseView.InsertShowcaseView(target, this, Resource.String.showcase_main_title, Resource.String.showcase_main_message, co); showcaseView.SetOnShowcaseEventListener(this); }
public void OnShowcaseViewShow(ShowcaseView showcaseView) { DimView(listView); buttonBlocked.Enabled = true; }
public void OnShowcaseViewDidHide(ShowcaseView showcaseView) { }
/** * Calculates the best place to position text * * @param canvasW width of the screen * @param canvasH height of the screen */ public void CalculateTextPosition(int canvasW, int canvasH, ShowcaseView showcaseView) { Rect showcase = showcaseView.HasShowcaseView() ? mCalculator.GetShowcaseRect() : new Rect(); int[] areas = new int[4]; //left, top, right, bottom areas[0] = showcase.Left * canvasH; areas[1] = showcase.Top * canvasW; areas[2] = (canvasW - showcase.Right) * canvasH; areas[3] = (canvasH - showcase.Bottom) * canvasW; int largest = 0; for (int i = 1; i < areas.Length; i++) { if (areas[i] > areas[largest]) { largest = i; } } // Position text in largest area switch (largest) { case 0: mBestTextPosition[0] = PADDING * mDensityScale; mBestTextPosition[1] = PADDING * mDensityScale; mBestTextPosition[2] = showcase.Left - 2 * PADDING * mDensityScale; break; case 1: mBestTextPosition[0] = PADDING * mDensityScale; mBestTextPosition[1] = (PADDING + ACTIONBAR_PADDING) * mDensityScale; mBestTextPosition[2] = canvasW - 2 * PADDING * mDensityScale; break; case 2: mBestTextPosition[0] = showcase.Right + PADDING * mDensityScale; mBestTextPosition[1] = PADDING * mDensityScale; mBestTextPosition[2] = (canvasW - showcase.Right) - 2 * PADDING * mDensityScale; break; case 3: mBestTextPosition[0] = PADDING * mDensityScale; mBestTextPosition[1] = showcase.Bottom + PADDING * mDensityScale; mBestTextPosition[2] = canvasW - 2 * PADDING * mDensityScale; break; } if (showcaseView.ConfigurationOptions.CenterText) { // Center text vertically or horizontally switch (largest) { case 0: case 2: mBestTextPosition[1] += canvasH / 4; break; case 1: case 3: mBestTextPosition[2] /= 2; mBestTextPosition[0] += canvasW / 4; break; } } else { // As text is not centered add actionbar padding if the text is left or right switch (largest) { case 0: case 2: mBestTextPosition[1] += ACTIONBAR_PADDING * mDensityScale; break; } } }
public void OnShowcaseViewHide(ShowcaseView showcaseView) { }
/** * Calculates the best place to position text * * @param canvasW width of the screen * @param canvasH height of the screen */ public void CalculateTextPosition(int canvasW, int canvasH, ShowcaseView showcaseView) { Rect showcase = showcaseView.HasShowcaseView() ? mCalculator.GetShowcaseRect() : new Rect(); int[] areas = new int[4]; //left, top, right, bottom areas[0] = showcase.Left * canvasH; areas[1] = showcase.Top * canvasW; areas[2] = (canvasW - showcase.Right) * canvasH; areas[3] = (canvasH - showcase.Bottom) * canvasW; int largest = 0; for(int i = 1; i < areas.Length; i++) { if(areas[i] > areas[largest]) largest = i; } // Position text in largest area switch(largest) { case 0: mBestTextPosition[0] = PADDING * mDensityScale; mBestTextPosition[1] = PADDING * mDensityScale; mBestTextPosition[2] = showcase.Left - 2 * PADDING * mDensityScale; break; case 1: mBestTextPosition[0] = PADDING * mDensityScale; mBestTextPosition[1] = (PADDING + ACTIONBAR_PADDING) * mDensityScale; mBestTextPosition[2] = canvasW - 2 * PADDING * mDensityScale; break; case 2: mBestTextPosition[0] = showcase.Right + PADDING * mDensityScale; mBestTextPosition[1] = PADDING * mDensityScale; mBestTextPosition[2] = (canvasW - showcase.Right) - 2 * PADDING * mDensityScale; break; case 3: mBestTextPosition[0] = PADDING * mDensityScale; mBestTextPosition[1] = showcase.Bottom + PADDING * mDensityScale; mBestTextPosition[2] = canvasW - 2 * PADDING * mDensityScale; break; } if(showcaseView.ConfigurationOptions.CenterText) { // Center text vertically or horizontally switch(largest) { case 0: case 2: mBestTextPosition[1] += canvasH / 4; break; case 1: case 3: mBestTextPosition[2] /= 2; mBestTextPosition[0] += canvasW / 4; break; } } else { // As text is not centered add actionbar padding if the text is left or right switch(largest) { case 0: case 2: mBestTextPosition[1] += ACTIONBAR_PADDING * mDensityScale; break; } } }
public void OnShowcaseViewShow(ShowcaseView showcaseView) { }
public void OnShowcaseViewShow(ShowcaseView showcaseView) { }
public static Animator OfPoints(ShowcaseView showcaseView, Point point) { return OfPoints(showcaseView, new Point[]{ point }); }