Exemple #1
0
 public EigenschapAdapter(Activity activity, List <Eigenschap> list, MyOnCheckBoxClickListener listener)
 {
     _activity      = activity;
     eigenschapList = list;
     mListener      = listener;
     _appController.FireUpdateEvent();
 }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.AllEigenschappen);

            //Action bar
            InitializeActionBar(SupportActionBar);
            title  = ActionBarTitle;
            query  = ActionBarQuery;
            search = ActionBarSearch;
            back   = ActionBarBack;

            mToastShort = Toast.MakeText(this, "", ToastLength.Short);
            mToastLong  = Toast.MakeText(this, "", ToastLength.Long);

            currProfiel       = _appController.CurrentProfiel;
            IsProfileNull     = (currProfiel == null);
            eigenschappenList = _appController.Eigenschappen;

            //listener to pass to EigenschapAdapter containing context
            mListener = new MyOnCheckBoxClickListener(this);

            eigenschapAdapter                = new EigenschapAdapter(this, _appController.Eigenschappen, mListener);
            allEigenschappenListView         = FindViewById <ListView> (Resource.Id.all_eigenschappen_list);
            allEigenschappenListView.Adapter = eigenschapAdapter;

            title.Text = IsProfileNull ? "Eigenschappen" : "Selectie";
            query.Hint = "Zoek eigenschap";

            //hide keyboard when scrolling through list
            allEigenschappenListView.SetOnTouchListener(new MyOnTouchListener(this, query));

            //initialize progress dialog used when calculating totemlist
            progress = new ProgressDialog(this);
            progress.SetMessage("Totems zoeken...");
            progress.SetProgressStyle(ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);

            LiveSearch();

            sharedPrefs = GetSharedPreferences("data", FileCreationMode.Private);

            var vind = FindViewById <LinearLayout> (Resource.Id.vind);

            vind.Click += VindTotem;

            bottomBar = FindViewById <RelativeLayout> (Resource.Id.bottomBar);

            search.Visibility = ViewStates.Visible;
            search.Click     += (sender, e) => ToggleSearch();

            //hide keyboard when enter is pressed
            query.EditorAction += (sender, e) => {
                if (e.ActionId == ImeAction.Search)
                {
                    KeyboardHelper.HideKeyboard(this);
                }
                else
                {
                    e.Handled = false;
                }
            };
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            SetContentView (Resource.Layout.AllEigenschappen);

            //Action bar
            InitializeActionBar (SupportActionBar);
            title = ActionBarTitle;
            query = ActionBarQuery;
            search = ActionBarSearch;
            back = ActionBarBack;

            mToastShort = Toast.MakeText (this, "", ToastLength.Short);
            mToastLong = Toast.MakeText (this, "", ToastLength.Long);

            currProfiel = _appController.CurrentProfiel;
            IsProfileNull = (currProfiel == null);
            eigenschappenList = _appController.Eigenschappen;

            //listener to pass to EigenschapAdapter containing context
            mListener = new MyOnCheckBoxClickListener (this);

            eigenschapAdapter = new EigenschapAdapter (this, _appController.Eigenschappen, mListener);
            allEigenschappenListView = FindViewById<ListView> (Resource.Id.all_eigenschappen_list);
            allEigenschappenListView.Adapter = eigenschapAdapter;

            title.Text = IsProfileNull ? "Eigenschappen" : "Selectie";
            query.Hint = "Zoek eigenschap";

            //hide keyboard when scrolling through list
            allEigenschappenListView.SetOnTouchListener(new MyOnTouchListener(this, query));

            //initialize progress dialog used when calculating totemlist
            progress = new ProgressDialog(this);
            progress.SetMessage("Totems zoeken...");
            progress.SetProgressStyle(ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);

            LiveSearch ();

            sharedPrefs = GetSharedPreferences("data", FileCreationMode.Private);

            var vind = FindViewById<LinearLayout> (Resource.Id.vind);
            vind.Click += VindTotem;

            bottomBar = FindViewById<RelativeLayout> (Resource.Id.bottomBar);

            search.Visibility = ViewStates.Visible;
            search.Click += (sender, e) => ToggleSearch ();

            //hide keyboard when enter is pressed
            query.EditorAction += (sender, e) => {
                if (e.ActionId == ImeAction.Search)
                    KeyboardHelper.HideKeyboard(this);
                else
                    e.Handled = false;
            };
        }