Beispiel #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var root = new RootElement("Test Root Elem")
                {
                    new Section("Test Header", "Test Footer")
                        {
                            new ButtonElement("DialogActivity", (o, e) => StartNew()),
                            new BooleanElement("Push my button", true),
                            new BooleanElement("Push this too", false),
                            new StringElement("Text label", "The Value"),
							new BooleanElement("Push my button", true),
                            new BooleanElement("Push this too", false),
                        },
                    new Section("Part II")
                        {
                            new StringElement("This is the String Element", "The Value"),
                            new CheckboxElement("Check this out", true),
                            new EntryElement("Username",""){
                                Hint = "Enter Login"
                            },
                            new EntryElement("Password", "") {
                                Hint = "Enter Password",
                                Password = true,
                            },
                        }
                };

            var da = new DialogAdapter(this, root);

            var lv = new ListView(this) {Adapter = da};

            SetContentView(lv);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
			
			
			ImageView img = new ImageView(this);
			img.SetImageResource(Resource.Drawable.spadeicon);
			
            var root = new RootElement("Test Root Elem")
                           {
                               new Section("Test Header", "Test Footer")
                                   {
                                       new BooleanElement("Push my button", true),
                                       new BooleanElement("Push this too", false),
                                       new StringElement("Text label", "The Value"),
									   new BooleanElement("Push my button", true),
                                       new BooleanElement("Push this too", false),
                                   },
                               new Section("Part II")
                                   {
                                       new StringElement("This is the String Element", "The Value"),
                                       new CheckboxElement("Check this out", true),
                                       new ImageElement(img),
									   new HtmlElement("Go to Google.com","http://www.google.com")
                                   }
                           };

            var da = new DialogAdapter(this, root);

            var lv = new ListView(this) {Adapter = da};

            SetContentView(lv);
        }
        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);

            test_suite = Intent.GetStringExtra ("TestSuite");
            suite = AndroidRunner.Suites [test_suite];

            var menu = new RootElement (String.Empty);
            
            main = new Section (test_suite);
            foreach (ITest test in suite.Tests) {
                TestSuite ts = test as TestSuite;
                if (ts != null)
                    main.Add (new TestSuiteElement (ts));
                else
                    main.Add (new TestCaseElement (test as TestCase));
            }
            menu.Add (main);

            Section options = new Section () {
                new ActionElement ("Run all", Run),
            };
            menu.Add (options);

            var da = new DialogAdapter (this, menu);
            var lv = new ListView (this) {
                Adapter = da
            };
            SetContentView (lv);
        }
Beispiel #4
0
		protected override void OnCreate(Bundle bundle)
		{
			base.OnCreate(bundle);

			/*
			// Set our view from the "main" layout resource
			SetContentView(Resource.Layout.Main);

			// Get our button from the layout resource,
			// and attach an event to it
			Button button = FindViewById<Button>(Resource.Id.MyButton);

			button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
			*/

			RootElement re = new MonoMobileDialogUI().CreateDialogUI();

			// mc++: equivalent to MonoTouchDialog.DialogViewController
			DialogAdapter da = new DialogAdapter(this, re);
			// mc++: equivalent to MonoTouch UINavigationController
			ListView lv = new ListView(this) { Adapter = da };

			// mc++: equivalent to MonoTouch Window
			// Activity.SetContentView ~ Window.RootViewController	iOS 5+
			// Activity.SetContentView ~ Window.AddSubview			iOS other
			SetContentView(lv);

		}
Beispiel #5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            string test_case = Intent.GetStringExtra("TestCase");

            ITestResult result = AndroidRunner.Results [test_case];

            string error = String.Format("<b>{0}<b><br><font color='grey'>{1}</font>",
                                         result.Message, result.StackTrace.Replace(System.Environment.NewLine, "<br>"));

            var menu = new RootElement(String.Empty)
            {
                new Section(test_case)
                {
                    new FormattedElement(error)
                }
            };

            var da = new DialogAdapter(this, menu);
            var lv = new ListView(this)
            {
                Adapter = da
            };

            SetContentView(lv);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            sourceName = Intent.GetStringExtra("TestSuite");
            suiteElement = AndroidRunner.Runner.Suites[sourceName];

            var menu = new RootElement(String.Empty);

            main = new Section(sourceName);
            foreach (var test in suiteElement.TestCases)
            {
                main.Add(test);
            }
            menu.Add(main);

            var options = new Section()
            {
                new ActionElement("Run all", Run),
            };
            menu.Add(options);

            var da = new DialogAdapter(this, menu);
            var lv = new ListView(this)
            {
                Adapter = da
            };
            SetContentView(lv);
        }
Beispiel #7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            /*
             * // Set our view from the "main" layout resource
             * SetContentView(Resource.Layout.Main);
             *
             * // Get our button from the layout resource,
             * // and attach an event to it
             * Button button = FindViewById<Button>(Resource.Id.MyButton);
             *
             * button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
             */

            RootElement re = new MonoMobileDialogUI().CreateDialogUI();

            // mc++: equivalent to MonoTouchDialog.DialogViewController
            DialogAdapter da = new DialogAdapter(this, re);
            // mc++: equivalent to MonoTouch UINavigationController
            ListView lv = new ListView(this)
            {
                Adapter = da
            };

            // mc++: equivalent to MonoTouch Window
            // Activity.SetContentView ~ Window.RootViewController	iOS 5+
            // Activity.SetContentView ~ Window.AddSubview			iOS other
            SetContentView(lv);
        }
        /// <summary>
        /// A callback which is called when the activity is being created.
        /// Subclass's corresponding method needs to call OnCreate after the initialzation of Root property
        /// </summary>
        /// <param name='savedInstanceState'>
        /// Saved instance state.
        /// </param>
		protected override void OnCreate(Bundle savedInstanceState)
		{
			base.OnCreate(savedInstanceState);
            this.DialogAdapter = new DialogAdapter(this, Root);
			this.ListAdapter = this.DialogAdapter;
            this.ListView.ItemClick += ListView_ItemClick;
			this.ListView.ItemLongClick += ListView_ItemLongClick;
		}
        public DialogHelper(Context context, ListView dialogView, RootElement root)
        {
            root.Context = context;

            dialogView.Adapter = this.DialogAdapter = new DialogAdapter(context, root);
            dialogView.ItemClick += new EventHandler<ItemEventArgs>(ListView_ItemClick);
            dialogView.ItemLongClick += new EventHandler<ItemEventArgs>(ListView_ItemLongClick);
            dialogView.Tag = root;
        }
Beispiel #10
0
        public DialogHelper(Context context, ListView dialogView, RootElement root)
        {
            this.Root = root;
            this.Root.Context = context;

            dialogView.Adapter = this.DialogAdapter = new DialogAdapter(context, this.Root);
            dialogView.ItemClick += ListView_ItemClick;
            // FIXME: should I comment out this? some branch seems to have done it.
            dialogView.ItemLongClick += ListView_ItemLongClick;;
            dialogView.Tag = root;
        }
Beispiel #11
0
		public void Navigate(RootElement root_element_next_screen)
		{
			DialogAdapter da = new DialogAdapter(this, root_element_next_screen);
			ListView lv = new ListView(this)
			{
				Adapter = da
			};
			this.SetContentView(lv);

			return;
		}
Beispiel #12
0
		protected override void OnCreate(Bundle bundle)
		{
			base.OnCreate(bundle);

			RootElement root = RootElementFactory.CreateRootElement();

			var da = new DialogAdapter(this, root);

			var lv = new ListView(this) {Adapter = da};

			SetContentView(lv);
		}
        public override void OnViewCreated(Views.View p0, OS.Bundle p1)
        {
            if (DialogAdapter == null)
            {
                ListAdapter = DialogAdapter = new DialogAdapter(Activity, _root, ListView);
                _root = null;
            }

            DialogAdapter.List = ListView;
            DialogAdapter.RegisterListView();
            base.OnViewCreated(p0, p1);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.main);
            progressBar = FindViewById <ProgressBar> (Resource.Id.dialog_progressbar);
            listView    = FindViewById <ListView> (Resource.Id.dialog_listView);

            var s = new Section("Test Header", "Test Footer")
            {
                new StringElement("Do Something", "Foo", (int)DroidResources.ElementLayout.dialog_labelfieldright, delegate {
                    Console.WriteLine("OK");
                }, Resource.Color.creme, Android.Graphics.Color.Transparent),
                new ButtonElement("DialogActivity", () => StartNew()),
                new BooleanElement("Push my button", true),
                new BooleanElement("Push this too", false),
                new StringElement("Text label", "The Value"),
                new BooleanElement("Push my button", true),
                new BooleanElement("Push this too", false),
            };

            //s.BackgroundColor = Color.DarkRed;

            var root = new RootElement("Test Root Elem")
            {
                s,
//                    new Section("Part II")
//                        {
//                            new StringElement("This is the String Element", "The Value", delegate {
//						Console.WriteLine("Clicked string element.");}
//                           ),
//                            new CheckboxElement("Check this out", true),
//                            new EntryElement("Username",""){
//                                Hint = "Enter Login"
//                            },
//                            new EntryElement("Password", "") {
//                                Hint = "Enter Password",
//                                Password = true,
//                            },
//							//new ProgressBarElement("")
//                        },
//					new Section("Part III")
//						{
//							new ButtonElement("Hide Progress", () => HideProgress())
//						}
            };

            var da = new DialogAdapter(this, root);

            listView.Adapter = da;
            //var lv = new ListView(this) {Adapter = da};
            //SetContentView(listView);
        }
Beispiel #15
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.main);
			progressBar = FindViewById<ProgressBar> (Resource.Id.dialog_progressbar);
			listView = FindViewById<ListView> (Resource.Id.dialog_listView);

			var s = new Section("Test Header", "Test Footer")
			{
				new StringElement("Do Something", "Foo", (int)DroidResources.ElementLayout.dialog_labelfieldright, delegate {
					Console.WriteLine("OK");
				}, Resource.Color.creme, Android.Graphics.Color.Transparent),
				new ButtonElement("DialogActivity", () => StartNew()),
				new BooleanElement("Push my button", true),
				new BooleanElement("Push this too", false),
				new StringElement("Text label", "The Value"),
				new BooleanElement("Push my button", true),
				new BooleanElement("Push this too", false),
			};

			//s.BackgroundColor = Color.DarkRed;

			var root = new RootElement ("Test Root Elem")
                {
                    s,
//                    new Section("Part II")
//                        {
//                            new StringElement("This is the String Element", "The Value", delegate {
//						Console.WriteLine("Clicked string element.");}
//                           ),
//                            new CheckboxElement("Check this out", true),
//                            new EntryElement("Username",""){
//                                Hint = "Enter Login"
//                            },
//                            new EntryElement("Password", "") {
//                                Hint = "Enter Password",
//                                Password = true,
//                            },
//							//new ProgressBarElement("")
//                        },
//					new Section("Part III")
//						{
//							new ButtonElement("Hide Progress", () => HideProgress())
//						}
                };

			var da = new DialogAdapter (this, root);
			listView.Adapter = da;
			//var lv = new ListView(this) {Adapter = da};
			//SetContentView(listView);
		}
		public DialogHelper(Context context, ListView dialogView, RootElement root)
		{
			this.Root = root;
			this.Root.Context = context;

			dialogView.Adapter = this.DialogAdapter = new DialogAdapter(context, this.Root);
			dialogView.ItemClick += 
				// mc++				
				new EventHandler<AdapterView.ItemClickEventArgs>(dialogView_ItemClick)
				// new EventHandler<ItemEventArgs>(ListView_ItemClick) // obsolete
				;
			dialogView.ItemLongClick += ListView_ItemLongClick;;
			dialogView.Tag = root;
		}
        public DialogHelper(Context context, ListView dialogView, RootElement root)
        {
            root.Context = context;

            dialogView.Adapter = this.DialogAdapter = new DialogAdapter(context, root);
            dialogView.ItemClick += new EventHandler<ItemEventArgs>(ListView_ItemClick);

            // TODO - sort out long click changes
            /*
            dialogView.ItemLongClick = new AdapterView.ItemLongClickHandler(ListView_ItemLongClick);
            dialogView.ItemLongClick += new EventHandler<ItemEventArgs>(ListView_ItemLongClick);
            */
            dialogView.Tag = root;
        }
Beispiel #18
0
        public DialogHelper(Context context, ListView dialogView, RootElement root)
        {
            this.Root = root;
            this.Root.Context = context;

            dialogView.Adapter = this.DialogAdapter = new DialogAdapter(context, this.Root);
            dialogView.ItemClick += new EventHandler<AdapterView.ItemClickEventArgs>(ListView_ItemClick);
            dialogView.ItemLongClick += ListView_ItemLongClick;
            dialogView.Scroll += delegate(object sender, AbsListView.ScrollEventArgs e) {
                Console.WriteLine( "Item Count "  + e.View.Count );
            };

            dialogView.Tag = root;
        }
Beispiel #19
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            RootElement root = RootElementFactory.CreateRootElement();

            var da = new DialogAdapter(this, root);

            var lv = new ListView(this)
            {
                Adapter = da
            };

            SetContentView(lv);
        }
Beispiel #20
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);


            ImageView img = new ImageView(this);

            img.SetImageResource(Resource.Drawable.spadeicon);

            var root = new RootElement("Test Root Elem")
            {
                new Section("Test Header", "Test Footer")
                {
                    new StringElement("Do Something", "Foo", () => {
                        Console.WriteLine("Did Something");
                    }),
                    new ButtonElement("DialogActivity", () => StartNew()),
                    new BooleanElement("Push my button", true),
                    new BooleanElement("Push this too", false),
                    new StringElement("Text label", "The Value"),
                    new BooleanElement("Push my button", true),
                    new BooleanElement("Push this too", false),
                },
                new Section("Part II")
                {
                    new StringElement("This is the String Element", "The Value"),
                    new CheckboxElement("Check this out", true),
                    new EntryElement("Username", "")
                    {
                        Hint = "Enter Login"
                    },
                    new EntryElement("Password", "")
                    {
                        Hint     = "Enter Password",
                        Password = true,
                    },
                }
            };

            var da = new DialogAdapter(this, root);

            var lv = new ListView(this)
            {
                Adapter = da
            };

            SetContentView(lv);
        }
Beispiel #21
0
		protected override void OnCreate(Bundle bundle)
		{
			base.OnCreate(bundle);

			UserInterface.a1 = this;

			RootElement root =
				//DialogSampleApp.UserInterface.UIDefine()
				//UserInterface.UICities()
				UserInterface.TestElements()
				;

			var da = new DialogAdapter(this, root);

			var lv = new ListView(this) {Adapter = da};

			SetContentView(lv);
		}
Beispiel #22
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            test_suite = Intent.GetStringExtra("TestSuite");
            suite      = AndroidRunner.Suites [test_suite];

            var menu = new RootElement(String.Empty);

            while (suite.Tests.Count == 1 && (suite.Tests[0] is TestSuite))
            {
                suite = (TestSuite)suite.Tests[0];
            }

            main = new Section(suite.FullName ?? suite.Name);
            foreach (ITest test in suite.Tests)
            {
                TestSuite ts = test as TestSuite;
                if (ts != null)
                {
                    main.Add(new TestSuiteElement(ts));
                }
                else
                {
                    main.Add(new TestCaseElement(test));
                }
            }
            menu.Add(main);

            Section options = new Section()
            {
                new ActionElement("Run all", Run),
            };

            menu.Add(options);

            var da = new DialogAdapter(this, menu);
            var lv = new ListView(this)
            {
                Adapter = da
            };

            SetContentView(lv);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
			
			
			ImageView img = new ImageView(this);
			img.SetImageResource(Resource.Drawable.spadeicon);
			
            var root = new RootElement("Test Root Elem")
                {
                    new Section("Test Header", "Test Footer")
                        {
							new StringElement("Do Something", "Foo", () => {
								Console.WriteLine("Did Something");
								
							}),
                            new ButtonElement("DialogActivity", () => StartNew()),
                            new BooleanElement("Push my button", true),
                            new BooleanElement("Push this too", false),
                            new StringElement("Text label", "The Value"),
							new BooleanElement("Push my button", true),
                            new BooleanElement("Push this too", false),
                        },
                    new Section("Part II")
                        {
                            new StringElement("This is the String Element", "The Value"),
                            new CheckboxElement("Check this out", true),
                            new EntryElement("Username",""){
                                Hint = "Enter Login"
                            },
                            new EntryElement("Password", "") {
                                Hint = "Enter Password",
                                Password = true,
                            },
                        }
                };

            var da = new DialogAdapter(this, root);

            var lv = new ListView(this) {Adapter = da};

            SetContentView(lv);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            _pd =	ProgressDialog.Show (this, "Please wait...", "Querying Azure!");

            ThreadPool.QueueUserWorkItem (delegate {

                var root = BuildRoot (kGetAllUrl);

                RunOnUiThread (delegate {
                    var da = new DialogAdapter(this, root);
                    var lv = new ListView(this) {Adapter = da};

                    SetContentView(lv);
                    _pd.Dismiss ();
                    _pd.Dispose ();
                });

            });
        }
Beispiel #25
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            UserInterface.a1 = this;

            RootElement root =
                //DialogSampleApp.UserInterface.UIDefine()
                //UserInterface.UICities()
                UserInterface.TestElements()
            ;

            var da = new DialogAdapter(this, root);

            var lv = new ListView(this)
            {
                Adapter = da
            };

            SetContentView(lv);
        }
Beispiel #26
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var root = new RootElement("Test Root Elem")
            {
                new Section("Test Header", "Test Footer")
                {
                    new ButtonElement("DialogActivity", (o, e) => StartNew()),
                    new BooleanElement("Push my button", true),
                    new BooleanElement("Push this too", false),
                    new StringElement("Text label", "The Value"),
                    new BooleanElement("Push my button", true),
                    new BooleanElement("Push this too", false),
                },
                new Section("Part II")
                {
                    new StringElement("This is the String Element", "The Value"),
                    new CheckboxElement("Check this out", true),
                    new EntryElement("Username", "")
                    {
                        Hint = "Enter Login"
                    },
                    new EntryElement("Password", "")
                    {
                        Hint     = "Enter Password",
                        Password = true,
                    },
                }
            };

            var da = new DialogAdapter(this, root);

            var lv = new ListView(this)
            {
                Adapter = da
            };

            SetContentView(lv);
        }
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			string test_case = Intent.GetStringExtra ("TestCase");
			
			TestResult result = AndroidRunner.Results [test_case];

			string error = String.Format ("<b>{0}<b><br><font color='grey'>{1}</font>", 
				result.Message, result.StackTrace.Replace (System.Environment.NewLine, "<br>"));
			
			var menu = new RootElement (String.Empty) {
				new Section (test_case) {
					new FormattedElement (error)
				}
			};
			
			var da = new DialogAdapter (this, menu);
			var lv = new ListView (this) {
				Adapter = da
			};
			SetContentView (lv);
		}
Beispiel #28
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);


            ImageView img = new ImageView(this);

            img.SetImageResource(Resource.Drawable.spadeicon);

            var root = new RootElement("Test Root Elem")
            {
                new Section("Test Header", "Test Footer")
                {
                    new BooleanElement("Push my button", true),
                    new BooleanElement("Push this too", false),
                    new StringElement("Text label", "The Value"),
                    new BooleanElement("Push my button", true),
                    new BooleanElement("Push this too", false),
                },
                new Section("Part II")
                {
                    new StringElement("This is the String Element", "The Value"),
                    new CheckboxElement("Check this out", true),
                    new ImageElement(img),
                    new HtmlElement("Go to Google.com", "http://www.google.com")
                }
            };

            var da = new DialogAdapter(this, root);

            var lv = new ListView(this)
            {
                Adapter = da
            };

            SetContentView(lv);
        }
Beispiel #29
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            AppDelegate ad = new AppDelegate();

            RootElement root =
                new AppDelegate().CreateRootHolisticWare()
                // new RootElement("Test Root Elem") { }
            ;


            var da = new DialogAdapter(this, root);
            //

            var lv = new ListView(this)
            {
                Adapter = da
            };

            SetContentView(lv);

            return;
        }
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (Root != null)
                {
                    Root.ValueChanged -= HandleValueChangedEvent;
                }
                if (_observer != null)
                {
                    _observer.Changed -= ObserverOnChanged;
                    _observer.Invalidated -= ObserverOnChanged;
                    _observer.Dispose();
                    _observer = null;
                }
                if (_dialogAdapter != null)
                {
                    _dialogAdapter.DeregisterListView();
                    _dialogAdapter.Dispose();
                    _dialogAdapter = null;
                }
                if (_list != null)
                {
                    _list.Dispose();
                    _list = null;
                }

                //lists can take up a huge numer of gref's, force a cleanup here as soon as we don't need these any longer
                GC.Collect(0);
            }
            base.Dispose(disposing);
        }