Exemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.PracticeLayout);
                ooService = new OnOffService();

                connectivityPointer    = FindViewById <ImageView>(Resource.Id.ivConnectionPractice);
                txtWeight              = FindViewById <EditText>(Resource.Id.txtWeight);
                txtRepetitions         = FindViewById <EditText>(Resource.Id.txtRepetitions);
                txtNumberOfRepetitions = FindViewById <EditText>(Resource.Id.txtNumberOfRepetitions);
                btnSavePractice        = FindViewById <Button>(Resource.Id.btnSavePractice);
                setConnectivityStatus(OnOffService.Online);
                btnSavePractice.Click += bt_ItemClick;
            }
            catch (ArgumentNullException e)
            {
                Console.WriteLine("Fehler bei der Datenübertragung zwischen den Activities: " + e.StackTrace);
            }
            catch (Exception exc)
            {
                Console.WriteLine("Fehler in der PracticeActivity: " + exc.StackTrace);
            }
        }
Exemplo n.º 2
0
        protected async override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.ScheduleLayout);

                schedules = new List<ScheduleModel>();
                lv = (ListView)FindViewById(Resource.Id.lvSchedule);
                connectivityPointer = FindViewById<ImageView>(Resource.Id.ivConnectionSchedule);
                setConnectivityStatus(OnOffService.Online);

                //Hier die Schedules des Benutzers abholen und in die Liste einfügen
                ooService = new OnOffService();
                userID = Intent.GetStringExtra("User");
                Guid userId = new Guid(userID);
                IEnumerable<ScheduleModel> temp = await ooService.GetAllSchedulesAsync(userId);
                schedules = temp.ToList<ScheduleModel>();

                //ArrayAdapter<string> adapter = new ArrayAdapter<string>(this, Resource.Layout.ScheduleView, Resource.Id.txtScheduleViewDescription, schedules);
                ScheduleListViewAdapter adapter = new ScheduleListViewAdapter(this, schedules);
                lv.Adapter = adapter;


                lv.ItemClick += lv_ItemClick;
            }
            catch(ArgumentNullException ex)
            {
                Console.WriteLine("Keine UserId übergeben: " + ex.StackTrace);
            }
            catch(System.Exception exc)
            {
                Console.WriteLine("Fehler beim Erstellen des ScheduleViews: " + exc.StackTrace);
            }
        }
Exemplo n.º 3
0
        protected override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.PracticeLayout);
                ooService = new OnOffService();

                connectivityPointer = FindViewById<ImageView>(Resource.Id.ivConnectionPractice);
                txtWeight = FindViewById<EditText>(Resource.Id.txtWeight);
                txtRepetitions = FindViewById<EditText>(Resource.Id.txtRepetitions);
                txtNumberOfRepetitions = FindViewById<EditText>(Resource.Id.txtNumberOfRepetitions);
                btnSavePractice = FindViewById<Button>(Resource.Id.btnSavePractice);
                setConnectivityStatus(OnOffService.Online);
                btnSavePractice.Click += bt_ItemClick;
            }
            catch(ArgumentNullException e)
            {
                Console.WriteLine("Fehler bei der Datenübertragung zwischen den Activities: " + e.StackTrace);
            }
            catch(Exception exc)
            {
                Console.WriteLine("Fehler in der PracticeActivity: " + exc.StackTrace);
            }
            
        }
Exemplo n.º 4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            ooService = new OnOffService();

            var view = inflater.Inflate(Resource.Layout.Dialog_sign_in, container, false);

            txtUsername = view.FindViewById<EditText>(Resource.Id.txtUsername);
            txtPassword = view.FindViewById<EditText>(Resource.Id.txtPassword);
            btnSignIn = view.FindViewById<Button>(Resource.Id.btnDialogSignIn);


            btnSignIn.Click += BtnSignIn_Click;

            return view;
        }
Exemplo n.º 5
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            ooService = new OnOffService();

            var view = inflater.Inflate(Resource.Layout.Dialog_sign_in, container, false);

            txtUsername = view.FindViewById <EditText>(Resource.Id.txtUsername);
            txtPassword = view.FindViewById <EditText>(Resource.Id.txtPassword);
            btnSignIn   = view.FindViewById <Button>(Resource.Id.btnDialogSignIn);


            btnSignIn.Click += BtnSignIn_Click;

            return(view);
        }
Exemplo n.º 6
0
        protected async override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.ExerciseLayout);

                List <ExerciseModel> exercises = new List <ExerciseModel>();
                connectivityPointer = FindViewById <ImageView>(Resource.Id.ivConnectionExcercise);
                ListView lv = (ListView)FindViewById(Resource.Id.lvExercise);

                setConnectivityStatus(OnOffService.Online);

                //ScheduleID auslesen und damit die Übungen auslesen
                scheduleId = Intent.GetIntExtra("Schedule", 0);
                userId     = Intent.GetStringExtra("User");
                ooService  = new OnOffService();
                exercises  = await ooService.GetExercisesForSchedule(scheduleId);

                if (exercises != null)
                {
                    SetExercises(exercises);

                    ExerciseListViewAdapter adapter = new ExerciseListViewAdapter(this, exercises, scheduleId);
                    lv.Adapter = adapter;

                    lv.ItemClick     += lv_ItemClick;
                    lv.ItemLongClick += lv_ItemLongClick;
                }
                else
                {
                    new AlertDialog.Builder(this)
                    .SetMessage("Keine Übungen vorhanden")
                    .SetTitle("Warning")
                    .Show();
                    OnBackPressed();
                }
            }
            catch (ArgumentNullException ex)
            {
                Console.WriteLine("Keine UserId übergeben: " + ex.StackTrace);
            }
            catch (System.Exception exc)
            {
                Console.WriteLine("Fehler beim Erstellen des ScheduleViews: " + exc.StackTrace);
            }
        }
Exemplo n.º 7
0
        protected async override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.ExerciseLayout);
                
                List<ExerciseModel> exercises = new List<ExerciseModel>();
                connectivityPointer = FindViewById<ImageView>(Resource.Id.ivConnectionExcercise);
                ListView lv = (ListView)FindViewById(Resource.Id.lvExercise);

                setConnectivityStatus(OnOffService.Online);

                //ScheduleID auslesen und damit die Übungen auslesen
                scheduleId = Intent.GetIntExtra("Schedule", 0);
                userId = Intent.GetStringExtra("User");
                ooService = new OnOffService();
                exercises = await ooService.GetExercisesForSchedule(scheduleId);
                if(exercises != null)
                {
                    SetExercises(exercises);

                    ExerciseListViewAdapter adapter = new ExerciseListViewAdapter(this, exercises, scheduleId);
                    lv.Adapter = adapter;

                    lv.ItemClick += lv_ItemClick;
                    lv.ItemLongClick += lv_ItemLongClick;
                }
                else
                {
                    new AlertDialog.Builder(this)
                            .SetMessage("Keine Übungen vorhanden")
                            .SetTitle("Warning")
                            .Show();
                    OnBackPressed();
                }
            }
            catch(ArgumentNullException ex)
            {
                Console.WriteLine("Keine UserId übergeben: " + ex.StackTrace);
            }
            catch(System.Exception exc)
            {
                Console.WriteLine("Fehler beim Erstellen des ScheduleViews: " + exc.StackTrace);
            }
        }
Exemplo n.º 8
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            ooService = new OnOffService();
            var view = inflater.Inflate(Resource.Layout.Dialog_sign_up, container, false);

            //Alle Eingabeelemente holen
            txtUsername        = view.FindViewById <EditText>(Resource.Id.txtUsername);
            txtEmail           = view.FindViewById <EditText>(Resource.Id.txtEmail);
            txtPassword        = view.FindViewById <EditText>(Resource.Id.txtPassword);
            txtPasswordConfirm = view.FindViewById <EditText>(Resource.Id.txtPasswordConfirm);
            spinGender         = view.FindViewById <Spinner>(Resource.Id.spinGender);
            spinJob            = view.FindViewById <Spinner>(Resource.Id.spinJob);
            spinFitness        = view.FindViewById <Spinner>(Resource.Id.spinFitness);
            txtBirthdate       = view.FindViewById <EditText>(Resource.Id.txtBirthdate);
            btnSignUp          = view.FindViewById <Button>(Resource.Id.btnDialogEmail);

            //Gender-Spinner
            genderItems = Enum.GetValues(typeof(GenderType)).Cast <GenderType>().ToList();
            ArrayAdapter <GenderType> genderAdpater = new ArrayAdapter <GenderType>(this.Activity, Android.Resource.Layout.SimpleSpinnerDropDownItem, genderItems);

            spinGender.Adapter = genderAdpater;

            //Job-Spinner
            jobItems = Enum.GetValues(typeof(JobTypes)).Cast <JobTypes>().ToList();
            ArrayAdapter <JobTypes> jobAdpater = new ArrayAdapter <JobTypes>(this.Activity, Android.Resource.Layout.SimpleSpinnerDropDownItem, jobItems);

            spinJob.Adapter = jobAdpater;

            //Fitness-Spinner
            fitnessItems = Enum.GetValues(typeof(FitnessType)).Cast <FitnessType>().ToList();
            ArrayAdapter <FitnessType> fitnessAdpater = new ArrayAdapter <FitnessType>(this.Activity, Android.Resource.Layout.SimpleSpinnerDropDownItem, fitnessItems);

            spinFitness.Adapter = fitnessAdpater;

            btnSignUp.Click += BtnSignUp_Click;

            return(view);
        }
Exemplo n.º 9
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            ooService = new OnOffService();
            var view = inflater.Inflate(Resource.Layout.Dialog_sign_up, container, false);

            //Alle Eingabeelemente holen
            txtUsername = view.FindViewById<EditText>(Resource.Id.txtUsername);
            txtEmail = view.FindViewById<EditText>(Resource.Id.txtEmail);
            txtPassword = view.FindViewById<EditText>(Resource.Id.txtPassword);
            txtPasswordConfirm = view.FindViewById<EditText>(Resource.Id.txtPasswordConfirm);
            spinGender = view.FindViewById<Spinner>(Resource.Id.spinGender);
            spinJob = view.FindViewById<Spinner>(Resource.Id.spinJob);
            spinFitness = view.FindViewById<Spinner>(Resource.Id.spinFitness);
            txtBirthdate = view.FindViewById<EditText>(Resource.Id.txtBirthdate);
            btnSignUp = view.FindViewById<Button>(Resource.Id.btnDialogEmail);

            //Gender-Spinner
            genderItems = Enum.GetValues(typeof(GenderType)).Cast<GenderType>().ToList();
            ArrayAdapter<GenderType> genderAdpater = new ArrayAdapter<GenderType>(this.Activity, Android.Resource.Layout.SimpleSpinnerDropDownItem, genderItems);
            spinGender.Adapter = genderAdpater;

            //Job-Spinner
            jobItems = Enum.GetValues(typeof(JobTypes)).Cast<JobTypes>().ToList();
            ArrayAdapter<JobTypes> jobAdpater = new ArrayAdapter<JobTypes>(this.Activity, Android.Resource.Layout.SimpleSpinnerDropDownItem, jobItems);
            spinJob.Adapter = jobAdpater;

            //Fitness-Spinner
            fitnessItems = Enum.GetValues(typeof(FitnessType)).Cast<FitnessType>().ToList();
            ArrayAdapter<FitnessType> fitnessAdpater = new ArrayAdapter<FitnessType>(this.Activity, Android.Resource.Layout.SimpleSpinnerDropDownItem, fitnessItems);
            spinFitness.Adapter = fitnessAdpater;

            btnSignUp.Click += BtnSignUp_Click;

            return view;
        }
Exemplo n.º 10
0
        protected async override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.ScheduleLayout);

                schedules           = new List <ScheduleModel>();
                lv                  = (ListView)FindViewById(Resource.Id.lvSchedule);
                connectivityPointer = FindViewById <ImageView>(Resource.Id.ivConnectionSchedule);
                setConnectivityStatus(OnOffService.Online);

                //Hier die Schedules des Benutzers abholen und in die Liste einfügen
                ooService = new OnOffService();
                userID    = Intent.GetStringExtra("User");
                Guid userId = new Guid(userID);
                IEnumerable <ScheduleModel> temp = await ooService.GetAllSchedulesAsync(userId);

                schedules = temp.ToList <ScheduleModel>();

                //ArrayAdapter<string> adapter = new ArrayAdapter<string>(this, Resource.Layout.ScheduleView, Resource.Id.txtScheduleViewDescription, schedules);
                ScheduleListViewAdapter adapter = new ScheduleListViewAdapter(this, schedules);
                lv.Adapter = adapter;


                lv.ItemClick += lv_ItemClick;
            }
            catch (ArgumentNullException ex)
            {
                Console.WriteLine("Keine UserId übergeben: " + ex.StackTrace);
            }
            catch (System.Exception exc)
            {
                Console.WriteLine("Fehler beim Erstellen des ScheduleViews: " + exc.StackTrace);
            }
        }