コード例 #1
0
        private void ConfigureVibrationSpinner()
        {
            Log.Debug(TAG, "ConfigureVibrationSpinner");
            var spinner = FindViewById <Spinner>(Resource.Id.vibrationEnable);

            spinner.Prompt = "Enable/Disable vibration on button press";

            var           set_vibration        = SwSettings.GetVibrationEnable();
            var           set_vibration_string = "";
            List <string> inputNames           = new List <string>();

            foreach (var vib_str in SwSettings.VIBRATION_TO_STRING_MAP.Keys)
            {
                inputNames.Add(vib_str);
                if (set_vibration == SwSettings.VIBRATION_TO_STRING_MAP[vib_str])
                {
                    set_vibration_string = vib_str;
                }
            }
            var adapter = new ArrayAdapter <string>(this, Resource.Layout.spinner_item, inputNames);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinner.Adapter = adapter;

            spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(VibrationSpinnerItemSelected);
            ignore_spinner_count++;

            int spinner_position = adapter.GetPosition(set_vibration_string);

            spinner.SetSelection(spinner_position);

            spinner.Invalidate();
        }
コード例 #2
0
        private void SetInputListener(View vin, SwSettings.ControlId cid)
        {
            var motion  = SwSettings.GetControlMotion(cid);
            var vibrate = SwSettings.GetVibrationEnable();

            vin.SetOnTouchListener(new SwButtonListener(vin, motion, vibrate));
        }