Пример #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            var theView = inflater.Inflate(Resource.Layout.PlanetPopLayout, container, false);

            titleView = theView.FindViewById <TextView>(Resource.Id.PlanetInfo);
            gridView  = theView.FindViewById <GridLayout>(Resource.Id.Map);
            hScroller = theView.FindViewById <HorizontalScrollView>(Resource.Id.hscroller);
            vScroller = theView.FindViewById <ScrollView>(Resource.Id.vscroller);

            scanBtn     = theView.FindViewById <Button>(Resource.Id.scanBtn);
            gotoBtn     = theView.FindViewById <Button>(Resource.Id.gotoSectorBtn);
            paintBtn    = theView.FindViewById <Button>(Resource.Id.paintBtn);
            bombardBtn  = theView.FindViewById <Button>(Resource.Id.bombardBtn);
            colonizeBtn = theView.FindViewById <Button>(Resource.Id.colonizeBtn);
            landBtn     = theView.FindViewById <Button>(Resource.Id.landBtn);

            hScroller.SetOnTouchListener(this);
            vScroller.SetOnTouchListener(this);

            gridView.Touch += GridView_Touch;

            scanBtn.Click     += ScanBtn_Click;
            gotoBtn.Click     += GotoBtn_Click;
            paintBtn.Click    += PaintBtn_Click;
            bombardBtn.Click  += BombardBtn_Click;
            colonizeBtn.Click += ColonizeBtn_Click;
            landBtn.Click     += LandBtn_Click;

            return(theView);
        }