예제 #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle)
        {
            View view = inflater.Inflate(Resource.Layout.JumpNotes, container, false);

            view.FindViewById <TextView>(Resource.Id.jumpCommentsIntro).Text = string.Join(GetString(Resource.String.JumpSeparator), jump);
            ExpandableListView listOutput = view.FindViewById <ExpandableListView>(Resource.Id.jumpNotesListView);
            var adapter = new FormationsWithNotesAdapter(this.Activity, listOutput, FSNotesHandler.Notes, this.jump, null, true);

            listOutput.SetAdapter(adapter);
            for (int i = 0; i < adapter.GroupCount; i++)
            {
                listOutput.ExpandGroup(i);
            }
            TextView timeLeftField = view.FindViewById <TextView>(Resource.Id.jumpTimeLeft);

            Button jumpTimerOperButton = view.FindViewById <Button>(Resource.Id.jumpTimerOperButton);
            var    timer = new JumpTimer(timeLeftField, context);

            timeLeftField.Text = timer.formatRemainingTime(FSNotesHandler.JUMPTIME_MS / 1000);
            bool isStarted = false;

            //muuta nappi taustaltaa värikkääskis!!!!
            jumpTimerOperButton.Click += delegate
            {
                if (isStarted)
                {
                    timer.Cancel();
                    jumpTimerOperButton.Text = "Start timer";
                    timer.initTime();
                }
                else
                {
                    timer.Start();
                    jumpTimerOperButton.Text = "Stop timer";
                }
                isStarted = !isStarted;
            };
            return(view);
        }
예제 #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle)
        {
            //this.HasOptionsMenu = true;

            View view = inflater.Inflate(Resource.Layout.FSNotes, container, false);

            this.filterList = new List <string>();
            ExpandableListView listOutput = view.FindViewById <ExpandableListView>(Resource.Id.notesListView);

            this.adapter = new FormationsWithNotesAdapter(this.Activity, listOutput, FSNotesHandler.Notes, this.filterList, listener, false);
            listOutput.SetAdapter(this.adapter);
            AppEventHandler.DataUpdated     += this.onDataUpdate;
            AppEventHandler.CategoryUpdated += this.onCategoryUpdate;
            FloatingActionButton addNoteFab = view.FindViewById <FloatingActionButton>(Resource.Id.addNoteFab);

            //Floating action button
            addNoteFab.Click += async(object sender, EventArgs e) =>
            {
                await requestNewComment();
            };
            return(view);
        }