コード例 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            _dbHandler = _dbHandlerFactory.CreateDBHandler();
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            _listView            = FindViewById <ListView>(Resource.Id.listTasksView);
            _listView.ItemClick += ListView_ItemClick;
            var swipeContainer = FindViewById <SwipeRefreshLayout>(Resource.Id.slSwipeContainer);

            swipeContainer.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
            swipeContainer.Refresh += SwipeContainer_Refresh;
            var searchView = FindViewById <SearchView>(Resource.Id.searchView);

            searchView.QueryTextSubmit += SearchView_QueryTextSubmit;
            searchView.Close           += SearchView_Close;
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetActionBar(toolbar);
            ActionBar.Title = "Tasks";
            _dbHandler.Init();
            _data = _dbHandler.GetTasks();
            var accessTokenPropery = _dbHandler.GetSetting(ACCESS_TOKEN_PROP);

            if (accessTokenPropery != null)
            {
                _accessToken = accessTokenPropery.Value;
            }
            RenderItems(_listView, _data);
        }
コード例 #2
0
 private void SearchView_Close(object sender, SearchView.CloseEventArgs e)
 {
     _data = _dbHandler.GetTasks();
     RenderItems(_listView, _data);
 }