public override void CreateNewControl(SectionView sectionView) { var startPoint = sectionView.PointInSectionByAbsolutePoint(designService.StartPressPoint.X, designService.StartPressPoint.Y); var tb = new TextBlock { Location = new MonoReports.Model.Point(startPoint.X, startPoint.Y), Text = "text", FontName = "Helvetica", FontSize = 11, Size = new Size(70, 14) }; TextBlockView textBlockView = sectionView.CreateControlView(tb) as TextBlockView; sectionView.Section.Controls.Add(tb); textBlockView.ParentSection = sectionView; designService.SelectedControl = textBlockView; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main); EnableFullScreen(); Rv = FindViewById <RecyclerView>(Resource.Id.main_rv); ScrollView = FindViewById <ScrollView>(Resource.Id.main_scrollview); Ll = FindViewById <LinearLayout>(Resource.Id.main_ll); RecyclerAdapter adapter = new RecyclerAdapter(this, BlockView.Categories.Instructions); Rv.SetLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false)); Rv.SetAdapter(adapter); // TODO selected TAB Rv.SetOnDragListener(this); Ll.SetOnDragListener(this); for (int i = 0; i < 10; i++) { BlockView textBv = new TextBlockView(this, "BlockView : " + i); Ll.AddView(textBv); textBv.SetOnTouchListener(this); } Handler = new Handler(); void SmoothScrollCheck() { // Log("SmoothScrollCheck"); if (SmoothScrolling) { ScrollView.ScrollBy(0, IsScrollingUp ? 15 : -15); } Handler.PostDelayed(SmoothScrollCheck, 1000 / 60); } new Runnable(() => { Handler.PostDelayed(SmoothScrollCheck, 1000 / 60); }).Run(); }