Ejemplo n.º 1
0
        private void InitControl()
        {
            userDateTime = DateTime.Now;
            detector     = new GestureDetectorCompat(view.Context, new GestureListener()
            {
                GoNextMonth     = () => GoNextMonth(),
                GoPreviousMonth = () => GoPreviousMonth()
            });

            btnPrev        = view.FindViewById <ImageView>(Resource.Id.calendar_prev_button);
            btnNext        = view.FindViewById <ImageView>(Resource.Id.calendar_next_button);
            txtDateDay     = view.FindViewById <TextView>(Resource.Id.date_display_day);
            txtDateYear    = view.FindViewById <TextView>(Resource.Id.date_display_year);
            txtDisplayDate = view.FindViewById <TextView>(Resource.Id.date_display_date);
            txtInfo        = view.FindViewById <TextView>(Resource.Id.txtInfo);
            btnSelection   = view.FindViewById <Button>(Resource.Id.date_selection);
            btnToday       = view.FindViewById <Button>(Resource.Id.date_display_today);
            gridView       = view.FindViewById <ExpandableHeightGridView>(Resource.Id.calendar_grid);

            btnPrev.Click      += BtnPrev_Click;
            btnNext.Click      += BtnNext_Click;
            btnToday.Click     += BtnToday_Click;
            btnSelection.Click += BtnSelection_Click;
            gridView.IsExpanded = true;
            gridView.SetOnTouchListener(new TouchListener(detector));
        }
Ejemplo n.º 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);
            View view = inflater.Inflate(Resource.Layout.save_task_reference_layout, null);

            taskname            = view.FindViewById <TextView>(Resource.Id.task_name);
            taskdescription     = view.FindViewById <TextView>(Resource.Id.taskdescription_saved);
            taskdeadlinedate    = view.FindViewById <TextView>(Resource.Id.taskdeadlinedate_saved);
            taskdeadlinetime    = view.FindViewById <TextView>(Resource.Id.taskdeadlinetime_saved);
            complianceslistview = view.FindViewById <ExpandableHeightGridView>(Resource.Id.grid_compliance);
            Linear1             = view.FindViewById <LinearLayout>(Resource.Id.linear1_saved);
            Linear2             = view.FindViewById <LinearLayout>(Resource.Id.linear2_saved);
            Linear3             = view.FindViewById <LinearLayout>(Resource.Id.linear3_saved);
            assignbtn           = view.FindViewById <Button>(Resource.Id.assignbtn);
            // tasklist = dB.GetFileMappingModel(taskid);
            pos           = Arguments.GetInt("pos");
            prefs         = PreferenceManager.GetDefaultSharedPreferences(Activity);
            designationid = prefs.GetString("DesignationId", "");
            temp_task_id  = Arguments.GetString("taskid");
            //  task_id_list = SavedTaskFrag.initialTasks;
            // temp_task_id = task_id_list[pos].task_id;
            //temp_task_id = task_id_list[pos].localtaskid;
            tasklist = dB.GetinitialTasks(temp_task_id);
            referencedata();
            assignbtn.Click += Assignbtn_Click;
            return(view);
        }
Ejemplo n.º 3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.reference_attach_layout, null);

            imagetext            = view.FindViewById <TextView>(Resource.Id.image_no);
            audiotext            = view.FindViewById <TextView>(Resource.Id.audio_no);
            videotext            = view.FindViewById <TextView>(Resource.Id.video_no);
            grid1                = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView1);
            grid2                = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView2);
            grid3                = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView3);
            taskmappinglist      = new List <TaskFilemappingModel2>();
            taskmappingimagelist = new List <TaskFilemappingModel2>();
            taskmappingaudiolist = new List <TaskFilemappingModel2>();
            taskmappingvideolist = new List <TaskFilemappingModel2>();
            // taskid = Intent.GetStringExtra("TaskId");
            db     = new DbHelper();
            taskid = Arguments.GetString("TaskId") ?? string.Empty;
            getdataofattachment();
            grid1.setExpanded(true);
            //grid1.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.MultipleModal;


            grid2.setExpanded(true);

            grid3.setExpanded(true);
            return(view);
        }
Ejemplo n.º 4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.create_layout2, null);

            db                  = new DbHelper();
            geolocation         = geo.GetGeoLocation(Activity);
            HasOptionsMenu      = true;
            isRecording         = false;
            prefs               = PreferenceManager.GetDefaultSharedPreferences(Activity);
            licenceId           = prefs.GetString("LicenceId", "");
            tempId              = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + licenceId;
            _dateSelectButton   = view.FindViewById <ImageView>(Resource.Id.imageView);
            timeSelectButton    = view.FindViewById <ImageView>(Resource.Id.imageView2);
            max_number          = view.FindViewById <EditText>(Resource.Id.maxnumberedit);
            task_name           = view.FindViewById <EditText>(Resource.Id.ed1);
            task_comment        = view.FindViewById <EditText>(Resource.Id.ed2);
            createbutton        = view.FindViewById <Button>(Resource.Id.btn);
            Saveforlater        = view.FindViewById <Button>(Resource.Id.saveforlater);
            Addtolist           = view.FindViewById <Button>(Resource.Id.btn_addtolist);
            createbutton.Click += CreateButton_OnClick;
            _dateDisplay        = view.FindViewById <TextView>(Resource.Id.textView1);
            timeDisplay         = view.FindViewById <TextView>(Resource.Id.textView2);
            title               = view.FindViewById <ImageView>(Resource.Id.imageView1);
            desc                = view.FindViewById <ImageView>(Resource.Id.imageView3);
            camera              = view.FindViewById <ImageButton>(Resource.Id.camera_btn);
            video               = view.FindViewById <ImageButton>(Resource.Id.video_btn);
            microphone          = view.FindViewById <ImageButton>(Resource.Id.micro_btn);
            cardView            = view.FindViewById <CardView>(Resource.Id.cardView_addcomp);
            attachment_btn      = view.FindViewById <ImageButton>(Resource.Id.attachment);
            cardviewref         = view.FindViewById <CardView>(Resource.Id.cardView_addref);
            /// attachment_btn = view.FindViewById<ImageButton>(Resource.Id.attachment);
            cardviewref.Click += delegate
            {
                CreateRefAddFragment createRefAdd = new CreateRefAddFragment();
                createRefAdd.Show(FragmentManager, "CreateRefAddFragment");
                //FragmentTransaction ft = FragmentManager.BeginTransaction();
                //ft.Replace(Resource.Id.container, createRefAdd);
                ////ft.Hide(FragmentManager.FindFragmentByTag("CreateTaskFrag"));
                ////ft.Add(Resource.Id.container, createRefAdd);
                //ft.AddToBackStack(null);
                //ft.SetTransition(FragmentTransaction.TransitFragmentOpen);
                //ft.Commit();
            };
            //attachment_btn.Click += delegate
            //{
            //    attachmentClick();
            //};
            cardView.Click += delegate
            {
                AddComplianceInCreate nextFrag = new AddComplianceInCreate();
                nextFrag.Show(FragmentManager, "AddComplianceInCreate");

                //FragmentTransaction ft = FragmentManager.BeginTransaction();
                //ft.Replace(Resource.Id.container, nextFrag);
                ////ft.Hide(FragmentManager.FindFragmentByTag("CreateTaskFrag"));
                ////ft.Add(Resource.Id.container, nextFrag);
                //ft.AddToBackStack(null);
                //ft.SetTransition(FragmentTransaction.TransitFragmentOpen);
                //ft.Commit();



                // fragment.BeginTransaction().Replace(Resource.Id.container, nextFrag).Commit();
                //Bundle bundle = new Bundle();
                ////bundle.PutString("task_id", id);
                //nextFrag.Arguments = bundle;
            };
            //checkBox1 = view.FindViewById<RadioButton>(Resource.Id.mandatory);
            //checkBox2 = view.FindViewById<RadioButton>(Resource.Id.not);
            //spinnerextension = view.FindViewById<Spinner>(Resource.Id.spiner_format);
            //spinnertype = view.FindViewById<Spinner>(Resource.Id.spinner_type);
            // complianceGridview = view.FindViewById<ExpandableHeightGridView>(Resource.Id.grid_compliance);
            Gridview_1  = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView1);
            Grid_attach = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridattachment);
            Gridview_2  = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView2);
            Gridview_3  = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView3);
            //checkBox1.Click += RadioButtonClick;
            //checkBox2.Click += RadioButtonClick;
            Saveforlater.Click += Saveforlater_Click;
            //max_num = max_number.Text;
            //max_numbers = Convert.ToInt32(max_num);
            //Addtolist.Click += delegate
            //{
            //    addtolistcompliance();
            //};
            //    microphone.Click += delegate
            //{
            //    recording();
            //};
            _dateSelectButton.Click += (sender, e) =>
            {
                DateSelect_OnClick(sender, e);
            };

            //camera.Click += delegate
            //{
            //    //Click_Type = "Camera";
            //    //CheckForShapeData_Camera();
            //    BtnCamera_Click();

            //};

            //video.Click += delegate
            //{
            //    //Click_Type = "Video";
            //    //CheckForShapeData_Video();
            //    VideoClick();
            //};

            //_dateSelectButton.Click += DateSelect_OnClick;
            timeSelectButton.Click += TimeSelectOnClick;
            string rec = Android.Content.PM.PackageManager.FeatureMicrophone;

            if (rec != "android.hardware.microphone")
            {
                var alert = new Android.App.AlertDialog.Builder(title.Context);
                alert.SetTitle("You don't seem to have a microphone to record with");
                alert.SetPositiveButton("OK", (sender, e) =>
                {
                    return;
                });

                alert.Show();
            }
            else
            {
                title.Click += delegate
                {
                    isRecording = !isRecording;
                    if (isRecording)
                    {
                        var voiceIntent = new Intent(RecognizerIntent.ActionRecognizeSpeech);
                        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelFreeForm);
                        voiceIntent.PutExtra(RecognizerIntent.ExtraPrompt, Android.App.Application.Context.GetString(Resource.String.messageSpeakNow));
                        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputCompleteSilenceLengthMillis, 1500);
                        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputPossiblyCompleteSilenceLengthMillis, 1500);
                        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputMinimumLengthMillis, 15000);
                        voiceIntent.PutExtra(RecognizerIntent.ExtraMaxResults, 1);

                        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.Default);
                        StartActivityForResult(voiceIntent, VOICE);
                    }
                };
                desc.Click += delegate
                {
                    isRecording = !isRecording;
                    if (isRecording)
                    {
                        // create the intent and start the activity
                        var voiceIntent = new Intent(RecognizerIntent.ActionRecognizeSpeech);
                        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelFreeForm);

                        // put a message on the modal dialog
                        voiceIntent.PutExtra(RecognizerIntent.ExtraPrompt, Android.App.Application.Context.GetString(Resource.String.messageSpeakNow));

                        // if there is more then 1.5s of silence, consider the speech over
                        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputCompleteSilenceLengthMillis, 1500);
                        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputPossiblyCompleteSilenceLengthMillis, 1500);
                        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputMinimumLengthMillis, 15000);
                        voiceIntent.PutExtra(RecognizerIntent.ExtraMaxResults, 1);

                        // you can specify other languages recognised here, for example
                        // voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.German);
                        // if you wish it to recognise the default Locale language and German
                        // if you do use another locale, regional dialects may not be recognised very well

                        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.Default);
                        StartActivityForResult(voiceIntent, DESC);
                    }
                };
            }
            return(view);
        }
Ejemplo n.º 5
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.create_ref_layout, null);

            db             = new DbHelper();
            geo            = new Geolocation();
            geolocation    = geo.GetGeoLocation(Activity);
            HasOptionsMenu = true;
            isRecording    = false;
            prefs          = PreferenceManager.GetDefaultSharedPreferences(Activity);
            licenceId      = prefs.GetString("LicenceId", "");
            tempId         = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + licenceId;
            camera         = view.FindViewById <ImageButton>(Resource.Id.camera_btn);
            video          = view.FindViewById <ImageButton>(Resource.Id.video_btn);
            microphone     = view.FindViewById <ImageButton>(Resource.Id.micro_btn);
            Gridview_1     = view.FindViewById <ExpandableHeightGridView>(Resource.Id.grid);
            Grid_attach    = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridattachment);
            Gridview_2     = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView2);
            Gridview_3     = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView3);
            attachment_btn = view.FindViewById <ImageButton>(Resource.Id.attachment);
            // Gridview_1 = view.FindViewById<ExpandableHeightGridView>(Resource.Id.gridView1);
            //Grid_attach = view.FindViewById<ExpandableHeightGridView>(Resource.Id.gridattachment);
            //Gridview_2 = view.FindViewById<ExpandableHeightGridView>(Resource.Id.gridView2);
            //Gridview_3 = view.FindViewById<ExpandableHeightGridView>(Resource.Id.gridView3);
            //title = view.FindViewById<ImageView>(Resource.Id.imageView1);
            //   listmapping = new List<TaskFileMapping_Model>();
            desc = view.FindViewById <ImageView>(Resource.Id.imageView3);

            if (image_list.Count > 0)
            {
                adapter_1          = new GridImageAdapterCreatetask(Activity, image_list);
                Gridview_1.Adapter = adapter_1;
                Gridview_1.setExpanded(true);
                Gridview_1.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.MultipleModal;
                Gridview_1.SetMultiChoiceModeListener(new MultiChoiceModeListener1(Activity));
            }
            if (video_list.Count > 0)
            {
                adapter_2          = new GridVideoAdapterCreateTask(Activity, video_list);
                Gridview_2.Adapter = adapter_2;
                Gridview_2.setExpanded(true);
                Gridview_2.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.MultipleModal;
                Gridview_2.SetMultiChoiceModeListener(new MultiChoiceModeListener2(Activity));
            }
            if (audio_list.Count > 0)
            {
                adapter_3          = new GridAudioCreateTask(Activity, audio_list);
                Gridview_3.Adapter = adapter_3;
                Gridview_3.setExpanded(true);
                Gridview_3.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.MultipleModal;
                Gridview_3.SetMultiChoiceModeListener(new MultiChoiceModeListener3(Activity));
            }
            if (listmapping.Count > 0)
            {
                forCreate           = new GridAttachmentForCreate(Activity, listmapping);
                Grid_attach.Adapter = forCreate;
                Grid_attach.setExpanded(true);
            }
            attachment_btn.Click += delegate
            {
                attachmentClick();
            };
            camera.Click += delegate
            {
                BtnCamera_Click();
            };

            video.Click += delegate
            {
                VideoClick();
            };
            microphone.Click += delegate
            {
                recording();
            };
            string rec = Android.Content.PM.PackageManager.FeatureMicrophone;

            if (rec != "android.hardware.microphone")
            {
                // no microphone, no recording. Disable the button and output an alert
                var alert = new Android.App.AlertDialog.Builder(title.Context);
                alert.SetTitle("You don't seem to have a microphone to record with");
                alert.SetPositiveButton("OK", (sender, e) =>
                {
                    task_name.Text    = "No microphone present";
                    title.Enabled     = false;
                    task_comment.Text = "No microphone present";
                    desc.Enabled      = false;
                    return;
                });

                alert.Show();
            }
            else
            {
                //title.Click += delegate
                //{
                //    // change the text on the button

                //    isRecording = !isRecording;
                //    if (isRecording)
                //    {
                //        // create the intent and start the activity
                //        var voiceIntent = new Intent(RecognizerIntent.ActionRecognizeSpeech);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelFreeForm);

                //        // put a message on the modal dialog
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraPrompt, Android.App.Application.Context.GetString(Resource.String.messageSpeakNow));

                //        // if there is more then 1.5s of silence, consider the speech over
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputCompleteSilenceLengthMillis, 1500);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputPossiblyCompleteSilenceLengthMillis, 1500);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputMinimumLengthMillis, 15000);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraMaxResults, 1);


                //        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.Default);
                //        StartActivityForResult(voiceIntent, VOICE);
                //    }
                //  };
                //desc.Click += delegate
                //{
                //    isRecording = !isRecording;
                //    if (isRecording)
                //    {
                //        // create the intent and start the activity
                //        var voiceIntent = new Intent(RecognizerIntent.ActionRecognizeSpeech);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelFreeForm);

                //        // put a message on the modal dialog
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraPrompt, Android.App.Application.Context.GetString(Resource.String.messageSpeakNow));

                //        // if there is more then 1.5s of silence, consider the speech over
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputCompleteSilenceLengthMillis, 1500);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputPossiblyCompleteSilenceLengthMillis, 1500);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputMinimumLengthMillis, 15000);
                //        voiceIntent.PutExtra(RecognizerIntent.ExtraMaxResults, 1);

                //        // you can specify other languages recognised here, for example
                //        // voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.German);
                //        // if you wish it to recognise the default Locale language and German
                //        // if you do use another locale, regional dialects may not be recognised very well

                //        voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.Default);
                //        StartActivityForResult(voiceIntent, DESC);
                //    }
                //};
            }
            return(view);
        }
Ejemplo n.º 6
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.layout_complaince, null);

            task_id_to_send = Arguments.GetString("task_id") ?? string.Empty;

            referencecardview = view.FindViewById <CardView>(Resource.Id.referncecardview);
            Description       = view.FindViewById <EditText>(Resource.Id.comment);
            descrip_text      = view.FindViewById <TextView>(Resource.Id.c_descrip);
            name_text         = view.FindViewById <TextView>(Resource.Id.c_name);
            detail_text       = view.FindViewById <TextView>(Resource.Id.c_detail);
            markby_text       = view.FindViewById <TextView>(Resource.Id.c_markby);
            deadline_text     = view.FindViewById <TextView>(Resource.Id.c_deadline);
            createdby_text    = view.FindViewById <TextView>(Resource.Id.c_createdby);
            creationdate_text = view.FindViewById <TextView>(Resource.Id.c_creationdate);
            camera            = view.FindViewById <ImageButton>(Resource.Id.camera_btn);
            video             = view.FindViewById <ImageButton>(Resource.Id.video_btn);
            create_by_call    = view.FindViewById <ImageButton>(Resource.Id.create_by_call);
            mark_by_call      = view.FindViewById <ImageButton>(Resource.Id.mark_by_call);
            microphone        = view.FindViewById <ImageButton>(Resource.Id.micro_btn);
            linear1           = view.FindViewById <LinearLayout>(Resource.Id.ll1);
            linear2           = view.FindViewById <LinearLayout>(Resource.Id.ll2);
            linear3           = view.FindViewById <LinearLayout>(Resource.Id.ll3);
            ll_task_desc      = view.FindViewById <LinearLayout>(Resource.Id.ll_task_desc);
            task_desc         = view.FindViewById <TextView>(Resource.Id.task_desc);
            Image_no          = view.FindViewById <TextView>(Resource.Id.image_no);
            Video_no          = view.FindViewById <TextView>(Resource.Id.video_no);
            Audio_no          = view.FindViewById <TextView>(Resource.Id.audio_no);
            comment_micro     = view.FindViewById <ImageView>(Resource.Id.comment_micro);
            Submit_Btn        = view.FindViewById <Button>(Resource.Id.submit);
            uploadimage       = view.FindViewById <TextView>(Resource.Id.uploaded_no1);
            uploadvideo       = view.FindViewById <TextView>(Resource.Id.uploaded_no2);
            uploadaudio       = view.FindViewById <TextView>(Resource.Id.uploaded_no3);
            Gridview1         = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView1);
            Gridview2         = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView2);
            Gridview3         = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView3);

            progress = new Android.App.ProgressDialog(Activity);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait...");

            referencecardview.Click += delegate
            {
                ReferenceAttachmentActivity reference         = new ReferenceAttachmentActivity();
                Android.Support.V4.App.FragmentTransaction ft = FragmentManager.BeginTransaction();
                //ft.Replace(Resource.Id.container, reference);
                ft.Hide(FragmentManager.FindFragmentByTag("ComplainceFragment"));
                ft.Add(Resource.Id.container, reference);
                ft.AddToBackStack(null);
                ft.SetTransition(FragmentTransaction.TransitFragmentOpen);
                ft.Commit();
                Bundle bundle = new Bundle();
                bundle.PutString("TaskId", task_id_to_send);
                reference.Arguments = bundle;
            };

            create_by_call.Click += delegate
            {
                try
                {
                    var hasTelephony = Activity.PackageManager.HasSystemFeature(PackageManager.FeatureTelephony);
                    if (hasTelephony)
                    {
                        //var uri = Android.Net.Uri.Parse("tel:" +creat_by_num);
                        var uri    = Android.Net.Uri.Parse("tel:" + "9984059984");
                        var intent = new Intent(Intent.ActionDial, uri);
                        Activity.StartActivity(intent);
                    }
                }
                catch (System.Exception e) { }
            };

            mark_by_call.Click += delegate
            {
                try
                {
                    var hasTelephony = Activity.PackageManager.HasSystemFeature(PackageManager.FeatureTelephony);
                    if (hasTelephony)
                    {
                        // var uri = Android.Net.Uri.Parse("tel:" +mark_by_num);
                        var uri    = Android.Net.Uri.Parse("tel:" + "9984059984");
                        var intent = new Intent(Intent.ActionDial, uri);
                        Activity.StartActivity(intent);
                    }
                }
                catch (System.Exception e) { }
            };

            Gridview1.setExpanded(true);
            //Gridview1.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.MultipleModal;
            //Gridview1.SetMultiChoiceModeListener(new MultiChoiceModeListener1(Activity));

            Gridview2.setExpanded(true);
            //Gridview2.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.MultipleModal;
            //Gridview2.SetMultiChoiceModeListener(new MultiChoiceModeListener2(Activity));

            Gridview3.setExpanded(true);
            //Gridview3.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.MultipleModal;
            //Gridview3.SetMultiChoiceModeListener(new MultiChoiceModeListener3(Activity));


            //if (ic.connectivity())
            //{
            getDataFromServer();
            //}
            //else
            // {

            //}
            //attachmentData = db.GetComp_Attachments(task_id_to_send);
            //if (attachmentData != null)
            //{
            //    for (int i = 0; i < attachmentData.Count; i++)
            //    {
            //        if (attachmentData[i].file_type.Equals("Image"))
            //        {
            //            imagelist.Add(attachmentData[i]);

            //        }
            //        else if (attachmentData[i].file_type.Equals("Video"))
            //        {
            //            videolist.Add(attachmentData[i]);
            //        }
            //        else if (attachmentData[i].file_type.Equals("Audio"))
            //        {
            //            audiolist.Add(attachmentData[i]);
            //        }
            //    }
            //    adapter1 = new GridViewAdapter_Image(Activity, imagelist);
            //    Gridview1.Adapter = adapter1;

            //    adapter2 = new GridViewAdapter_Video(Activity, videolist);
            //    Gridview2.Adapter = adapter2;

            //    adapter3 = new GridViewAdapter_Audio(Activity, audiolist);
            //    Gridview3.Adapter = adapter3;

            //}



            camera.Click += delegate
            {
                Click_Type = "Camera";
                CheckForShapeData_Camera();
            };

            video.Click += delegate
            {
                Click_Type = "Video";
                CheckForShapeData_Video();
            };

            microphone.Click += delegate
            {
                if (audio_comp_lst.Count < aud_max)
                {
                    if (shapes1 != null)
                    {
                        if (CheckForShape())
                        {
                            recording();
                        }
                        else
                        {
                            Toast.MakeText(Activity, "you are outside marked area", ToastLength.Long).Show();
                        }
                    }
                    else
                    {
                        recording();
                    }
                }
            };

            Submit_Btn.Click += delegate
            {
                Submit_Method();
            };
            comment_micro.Click += delegate
            {
                CheckMicrophone();
            };

            return(view);
        }
Ejemplo n.º 7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.layout_complaince);
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.SetVmPolicy(builder.Build());
            StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll();
            StrictMode.SetThreadPolicy(builder1.Build());

            restService           = new ServiceHelper();
            geo                   = new Geolocation();
            db                    = new DbHelper();
            ic                    = new InternetConnection();
            comp_AttachmentModels = new List <Comp_AttachmentModel>();

            geolocation = geo.GetGeoLocation(this);
            prefs       = PreferenceManager.GetDefaultSharedPreferences(this);
            isRecording = false;
            //AudioSavePathInDevice = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + "/AudioRecording.mp3";

            task_id_to_send = Intent.GetStringExtra("task_id") ?? string.Empty;
            //task_description = Intent.GetStringExtra("task_descrip") ?? string.Empty;
            //deadline = Intent.GetStringExtra("deadline") ?? string.Empty;
            //task_name = Intent.GetStringExtra("task_name") ?? string.Empty;
            //markby = Intent.GetStringExtra("mark_by") ?? string.Empty;
            //creationdate = Intent.GetStringExtra("creation_date") ?? string.Empty;
            //taskcreatedby = Intent.GetStringExtra("created_by") ?? string.Empty;
            tap = geolocation.Split(",");

            Description       = FindViewById <EditText>(Resource.Id.comment);
            descrip_text      = FindViewById <TextView>(Resource.Id.c_descrip);
            name_text         = FindViewById <TextView>(Resource.Id.c_name);
            detail_text       = FindViewById <TextView>(Resource.Id.c_detail);
            markby_text       = FindViewById <TextView>(Resource.Id.c_markby);
            deadline_text     = FindViewById <TextView>(Resource.Id.c_deadline);
            createdby_text    = FindViewById <TextView>(Resource.Id.c_createdby);
            creationdate_text = FindViewById <TextView>(Resource.Id.c_creationdate);
            camera            = FindViewById <ImageButton>(Resource.Id.camera_btn);
            video             = FindViewById <ImageButton>(Resource.Id.video_btn);
            microphone        = FindViewById <ImageButton>(Resource.Id.micro_btn);
            //holder = FindViewById<ImageButton>(Resource.Id.location_btn);
            linear1       = FindViewById <LinearLayout>(Resource.Id.ll1);
            linear2       = FindViewById <LinearLayout>(Resource.Id.ll2);
            linear3       = FindViewById <LinearLayout>(Resource.Id.ll3);
            Image_no      = FindViewById <TextView>(Resource.Id.image_no);
            Video_no      = FindViewById <TextView>(Resource.Id.video_no);
            Audio_no      = FindViewById <TextView>(Resource.Id.audio_no);
            comment_micro = FindViewById <ImageView>(Resource.Id.comment_micro);
            Submit_Btn    = FindViewById <Button>(Resource.Id.submit);
            Gridview1     = FindViewById <ExpandableHeightGridView>(Resource.Id.gridView1);
            Gridview2     = FindViewById <ExpandableHeightGridView>(Resource.Id.gridView2);
            Gridview3     = FindViewById <ExpandableHeightGridView>(Resource.Id.gridView3);

            getData();
            camera.Click += delegate
            {
                Click_Type = "Camera";
                CheckForShapeData_Camera();
            };

            video.Click += delegate
            {
                Click_Type = "Video";
                CheckForShapeData_Video();
            };

            microphone.Click += delegate
            {
                if (audioCount == audio_max)
                {
                    Toast.MakeText(this, "Reached Maximum Point", ToastLength.Long).Show();
                }
                else
                {
                    recording();
                }
            };

            Submit_Btn.Click += delegate
            {
                Submit_Method();
            };
            comment_micro.Click += delegate
            {
                CheckMicrophone();
            };
            // Create your application here
        }
Ejemplo n.º 8
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.layout_compOutBox, null);

            referencecardview = view.FindViewById <CardView>(Resource.Id.referncecardview);

            descrip_text = view.FindViewById <TextView>(Resource.Id.c_descrip);
            name_text    = view.FindViewById <TextView>(Resource.Id.c_name);
            // detail_text = view.FindViewById<TextView>(Resource.Id.c_detail);
            markby_text       = view.FindViewById <TextView>(Resource.Id.c_markby);
            deadline_text     = view.FindViewById <TextView>(Resource.Id.c_deadline);
            createdby_text    = view.FindViewById <TextView>(Resource.Id.c_createdby);
            creationdate_text = view.FindViewById <TextView>(Resource.Id.c_creationdate);
            imagegrid         = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView1);
            videolistview     = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView2);
            audiolistview     = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView3);
            //holder = FindViewById<ImageButton>(Resource.Id.location_btn);
            linear1        = view.FindViewById <LinearLayout>(Resource.Id.ll1);
            linear2        = view.FindViewById <LinearLayout>(Resource.Id.ll2);
            linear3        = view.FindViewById <LinearLayout>(Resource.Id.ll3);
            Image_no       = view.FindViewById <TextView>(Resource.Id.image_no);
            Video_no       = view.FindViewById <TextView>(Resource.Id.video_no);
            Audio_no       = view.FindViewById <TextView>(Resource.Id.audio_no);
            create_by_call = view.FindViewById <ImageButton>(Resource.Id.create_by_call);
            mark_by_call   = view.FindViewById <ImageButton>(Resource.Id.mark_by_call);

            getData();



            create_by_call.Click += delegate
            {
                try
                {
                    var hasTelephony = Activity.PackageManager.HasSystemFeature(PackageManager.FeatureTelephony);
                    if (hasTelephony)
                    {
                        //var uri = Android.Net.Uri.Parse("tel:" +creat_by_num);
                        var uri    = Android.Net.Uri.Parse("tel:" + "9984059984");
                        var intent = new Intent(Intent.ActionDial, uri);
                        Activity.StartActivity(intent);
                    }
                }
                catch (System.Exception e) { }
            };

            mark_by_call.Click += delegate
            {
                try
                {
                    var hasTelephony = Activity.PackageManager.HasSystemFeature(PackageManager.FeatureTelephony);
                    if (hasTelephony)
                    {
                        // var uri = Android.Net.Uri.Parse("tel:" +mark_by_num);
                        var uri    = Android.Net.Uri.Parse("tel:" + "9984059984");
                        var intent = new Intent(Intent.ActionDial, uri);
                        Activity.StartActivity(intent);
                    }
                }
                catch (System.Exception e) { }
            };
            // settingValues();
            return(view);
        }