Esempio n. 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            this.SetContentView(Resource.Layout.activity_control);

            if (SupportActionBar != null && selectedControl != null)
            {
                SupportActionBar.Title = selectedControl.ControlName();
            }

            this.expList = (ExpandableListView)this.FindViewById(Resource.Id.expListView);
            MoveIndicatorImage();

            ExamplesAdapter ea = new ExamplesAdapter(selectedControl.Examples());

            this.expList.SetAdapter(ea);

            for (int i = 0; i < ea.GroupCount; i++)
            {
                expList.ExpandGroup(i);
            }

            this.expList.ChildClick += (object sender, ExpandableListView.ChildClickEventArgs e) => {
                ExampleActivity.selectedExampleFragment = (Android.Support.V4.App.Fragment)ea.GetChild(e.GroupPosition, e.ChildPosition);
                Intent exampleIntent = new Intent(this, typeof(ExampleActivity));
                this.StartActivity(exampleIntent);
                e.Handled = true;
            };
        }
Esempio n. 2
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            if (convertView == null)
            {
                convertView = View.Inflate(parent.Context, Resource.Layout.list_item_control, null);
            }

            ExamplesProvider currentProvider = (ExamplesProvider)this.GetItem(position);
            TextView         controlName     = (TextView)convertView.FindViewById(Resource.Id.txtControlName);

            controlName.Text = currentProvider.ControlName();
            return(convertView);
        }
Esempio n. 3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            this.SetContentView(Resource.Layout.activity_control);
            this.expList = (ExpandableListView)this.FindViewById(Resource.Id.expListView);
            this.Title   = currentProvider.ControlName();
            ExamplesAdapter ea = new ExamplesAdapter(currentProvider.Examples());

            this.expList.SetAdapter(ea);
            this.expList.ChildClick += (object sender, ExpandableListView.ChildClickEventArgs e) => {
                ExampleActivity.selectedExampleFragment = (Android.Support.V4.App.Fragment)ea.GetChild(e.GroupPosition, e.ChildPosition);
                Intent exampleIntent = new Intent(this, typeof(ExampleActivity));
                this.StartActivity(exampleIntent);
                e.Handled = true;
            };
            // Create your application here
        }