Пример #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _nickViewModel = ServiceContainer.Resolve<NickViewModel>();

            SetContentView(Resource.Layout.ResultLayout);

            Typeface fancy = Typeface.CreateFromAsset(Assets, "Fonts/Snell Roundhand Script.ttf");
            _greetingsText = FindViewById<TextView>(Resource.Id.greetingsText);
            _greetingsText.Text = string.Empty;
            _greetingsText.Typeface = fancy;

            _resultText = FindViewById<TextView>(Resource.Id.resultText);
            _resultText.Text = "Traveling...";

            _greetingsImage = FindViewById<ImageView>(Resource.Id.greetingsImage);
            _nicImage = FindViewById<ImageView>(Resource.Id.nickImage);
            _itemImage = FindViewById<ImageView>(Resource.Id.itemImage);

            _greetingsImage.SetImageBitmap(null);
            _nicImage.SetImageBitmap(null);
            _itemImage.SetImageBitmap(null);

            var adventureButton = FindViewById<Button>(Resource.Id.adventureButton);
            adventureButton.Click += (sender, e) =>
                {
                    StartActivity(typeof(MainActivity));
                };
        }
Пример #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _nickViewModel = ServiceContainer.Resolve<NickViewModel>();

            SetContentView(Resource.Layout.LocationLayout);

            EditText locationText = FindViewById(Resource.Id.locationField) as EditText;
            Button submitButton = FindViewById(Resource.Id.submitButton) as Button;

            submitButton.Click += (sender, e) =>
                {
                    _nickViewModel.LocationSearch = locationText.Text;
                    StartActivity(typeof(ResultActivity));
                };
        }
Пример #3
0
        protected async override void OnCreate(Bundle bundle)
        {           
            base.OnCreate(bundle);

            ServiceContainer.Register<NickViewModel>();
            ServiceContainer.Register<INickServer>(() => new FakeNickServer());

            _nickViewModel = ServiceContainer.Resolve<NickViewModel>();

            await _nickViewModel.GetNicks();

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

            _nicks = _nickViewModel.Nicks;

            var nickList = FindViewById<ListView>(Resource.Id.nickList);
            nickList.Adapter = new NickAdapter(this, _nicks);
            nickList.ItemClick += OnItemClick;
        }
Пример #4
0
        public void TestInitialize()
        {
            ServiceContainer.Register<INickServer>(() => new FakeNickServer());

            _nickViewModel = new NickViewModel();
        }