コード例 #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SupportActionBar.Title = Resources.GetString(Resource.String.favourites_view);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            ListAdapter = new SearchResultsAdapter(this, new List <Property>()
            {
            });

            var app = PropertyCrossApplication.GetApplication(this);

            presenter           = (FavouritesPresenter)app.Presenter;
            app.CurrentActivity = this;
        }
コード例 #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var app = PropertyCrossApplication.GetApplication(this);

            app.CurrentActivity = this;

            var uiMarshal = new MarshalInvokeService(app);
            var source    = new PropertyDataSource(new JsonWebPropertySearch(uiMarshal));

            geoLocationService = new GeoLocationService((Android.Locations.LocationManager)GetSystemService(Context.LocationService), uiMarshal);
            var stateService = new StatePersistenceService(app);
            PropertyCrossPersistentState state = stateService.LoadState();

            SetContentView(Resource.Layout.PropertyCrossView);
            searchText              = (EditText)FindViewById(Resource.Id.search);
            searchText.TextChanged += SearchText_Changed;
            searchText.SetOnEditorActionListener(this);

            myLocationButton        = (Button)FindViewById(Resource.Id.use_location);
            myLocationButton.Click += LocationButton_Clicked;

            startSearchButton        = (Button)FindViewById(Resource.Id.do_search);
            startSearchButton.Click += StartSearchButton_Clicked;

            messageText = (TextView)FindViewById(Resource.Id.mainview_message);

            resultsHeader          = (TextView)FindViewById(Resource.Id.results_header);
            resultsList            = (ListView)FindViewById(Resource.Id.results_list);
            resultsList.ItemClick += ResultsListItem_Clicked;
            resultsList.Adapter    = new RecentSearchAdapter(this, new List <RecentSearch>());

            loadingAnimation            = AnimationUtils.LoadAnimation(this, Resource.Animation.loading_rotate);
            loadingAnimation.RepeatMode = RepeatMode.Restart;

            presenter =
                new PropertyCrossPresenter(state,
                                           source,
                                           new NavigationService(app),
                                           geoLocationService);
            presenter.SetView(this);

            app.Presenter = presenter;
        }
コード例 #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.property_view);

            SupportActionBar.Title = Resources.GetString(Resource.String.property_title);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            priceText       = (TextView)FindViewById(Resource.Id.property_price);
            locationText    = (TextView)FindViewById(Resource.Id.property_location);
            propertyImage   = (ImageView)FindViewById(Resource.Id.property_image);
            overviewText    = (TextView)FindViewById(Resource.Id.property_overview);
            informationText = (TextView)FindViewById(Resource.Id.property_information);

            placeholder = BitmapFactory.DecodeResource(Resources, Resource.Drawable.home);

            var app = PropertyCrossApplication.GetApplication(this);

            presenter = (PropertyPresenter)app.Presenter;
            presenter.SetView(this);
            app.CurrentActivity = this;
        }
コード例 #4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            LayoutInflater li = (LayoutInflater)GetSystemService(Context.LayoutInflaterService);

            footer        = li.Inflate(Resource.Layout.load_more_footer, null);
            resultDetails = (TextView)footer.FindViewById(Resource.Id.result_details);
            footer.Click += OnFooterClicked;

            ListView.AddFooterView(footer);
            ListAdapter = new SearchResultsAdapter(this, new List <Property>()
            {
            });

            var app = PropertyCrossApplication.GetApplication(this);

            presenter = (SearchResultsPresenter)app.Presenter;
            presenter.SetView(this);
            app.CurrentActivity = this;
        }