예제 #1
0
 void UpdateProgress(ProcessButton button, int progress)
 {
     mProgress += 10;
     button.setProgress(mProgress);
     if (mProgress < 100)
     {
         Console.WriteLine("Progress " + mProgress);
         action = () => UpdateProgress(button, mProgress);
         messageHandler.PostDelayed(action, generateDelay());
     }
     else
     {
         mListener.onComplete();
         Console.WriteLine("Progress Completed " + mProgress);
     }
 }
예제 #2
0
        /// <summary>
        /// </summary>
        public static void DrawProcess(ProcessButton btnProcess)
        {
            if (btnProcess != null)
            {
                GraphicsPath path1 = new GraphicsPath();

                //path1.AddRectangle(DrawUtility.GetNormalRecangle(0, 0));
                //control1.BackColor = SystemColors.Control;
                path1 = CreateRoundedRectanglePath(DrawUtility.GetNormalRecangle(0, 0), a * 2);

                btnProcess.Size   = new Size(Convert.ToInt16((ah + rw - 5) * 1.2 * a), Convert.ToInt16(8 * 1.2 * a));
                btnProcess.Region = new Region(path1);

                double degree = (btnProcess.InArrowDegree % 360 + 360) % 360;
                if (degree <= 45 || degree > 315)
                {
                    //接触点为矩形按钮的左侧中点
                    btnProcess.Left = btnProcess.InPoint.X;
                    btnProcess.Top  = btnProcess.InPoint.Y - btnProcess.Height / 2;
                }
                else if (degree > 45 && degree <= 135)
                {
                    //接触点为矩形按钮的上侧中点
                    btnProcess.Left = btnProcess.InPoint.X - btnProcess.Width / 2;
                    btnProcess.Top  = btnProcess.InPoint.Y;
                }
                else if (degree > 135 && degree <= 225)
                {
                    //接触点为矩形按钮的右侧中点
                    btnProcess.Left = btnProcess.InPoint.X - btnProcess.Width;
                    btnProcess.Top  = btnProcess.InPoint.Y - btnProcess.Height / 2;
                }
                else if (degree > 225 && degree <= 315)
                {
                    //接触点为矩形按钮的下侧中点
                    btnProcess.Left = btnProcess.InPoint.X - btnProcess.Width / 2;
                    btnProcess.Top  = btnProcess.InPoint.Y - btnProcess.Height;
                }
            }
        }
        public void Do_survey()
        {
            var listSurvey = ListSurvey;

            foreach (var survey in listSurvey)
            {
                var surveyRadioButton = new MobileRadioButton(survey);
                surveyRadioButton.TouchNoScroll();
                ProcessButton.TouchNoScroll();

                var listQuestion = ListQuestion;
                foreach (var question in listQuestion)
                {
                    var isRadioButtonQuestion = question.FindElementsByClassName("android.widget.RadioButton").ToList();
                    var isCheckboxQuestion    = question.FindElementsByClassName("android.widget.CheckBox").ToList();
                    if (isRadioButtonQuestion.Count > 0)
                    {
                        var answerRadioButton = new MobileRadioButton(isRadioButtonQuestion.First());
                        answerRadioButton.TouchNoScroll();
                    }
                    else if (isCheckboxQuestion.Count > 0)
                    {
                        var answerCheckbox = new MobileCheckbox(isCheckboxQuestion.First());
                        answerCheckbox.Check();
                    }
                    else
                    {
                        Question = "Test Mobile Sale Order";
                    }
                }

                SaveButton.TouchNoScroll();
                using (var Alert = new AlertPage())
                {
                    Alert.Click_ok_button();
                }
            }

            Base_touch_to_button(Button.Back);
        }