Пример #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.TestSuite);

            spinner       = FindViewById <Spinner>(Resource.Id.spinner);
            listView      = FindViewById <ListView>(Resource.Id.list);
            resultView    = FindViewById <TextView>(Resource.Id.info);
            stopButton    = FindViewById <Button>(Resource.Id.stop_btn);
            problemButton = FindViewById <Button>(Resource.Id.problem_btn);

            CreateSFXTests();
            CreateSpeechTests();
            CreateSensorTests();
            CreateMiscTests();

            problemButton.Click += ProblemButton_Click;

            categoryAdapter       = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, CategoryNames);
            spinner.ItemSelected += Spinner_ItemSelected;
            spinner.ScaleX        = 1.5f;
            spinner.ScaleY        = 1.5f;
            spinner.TranslationX  = 50;
            spinner.Adapter       = categoryAdapter;
            spinner.SetSelection(0);
            listView.ItemClick += ListView_ItemClick;
        }
Пример #2
0
        protected void SpecialView()
        {
            ListLangugaeSpinner = View.FindViewById <Spinner>(Mirapp.Resource.Id.ListLangugaeSpinner);
            ListCount           = View.FindViewById <TextView>(Mirapp.Resource.Id.ListCount);

            ListLangugaeSpinner.ItemSelected += (sender, args) =>
            {
                LoadList();
            };
            LanguageAdapter             = AdapterBoss.GetLanguageAdapter(this.Activity);
            ListLangugaeSpinner.Adapter = LanguageAdapter;
        }
Пример #3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var v = inflater.Inflate(Resource.Layout.tinting_fragment, null);

            // Set a drawable as the image to display
            image = (ImageView)v.FindViewById(Resource.Id.image);
            image.SetImageResource(Resource.Drawable.btn_default_normal_holo);

            // Get text labels and seekbars for the four color components
            alphaBar  = (SeekBar)v.FindViewById(Resource.Id.alphaSeek);
            alphaText = (TextView)v.FindViewById(Resource.Id.alphaText);
            greenBar  = (SeekBar)v.FindViewById(Resource.Id.greenSeek);
            greenText = (TextView)v.FindViewById(Resource.Id.greenText);
            redBar    = (SeekBar)v.FindViewById(Resource.Id.redSeek);
            redText   = (TextView)v.FindViewById(Resource.Id.redText);
            blueBar   = (SeekBar)v.FindViewById(Resource.Id.blueSeek);
            blueText  = (TextView)v.FindViewById(Resource.Id.blueText);

            // Set a listener to update tinted image when selections have changed
            alphaBar.SetOnSeekBarChangeListener(new MySeekBarChangeListener(this));
            greenBar.SetOnSeekBarChangeListener(new MySeekBarChangeListener(this));
            redBar.SetOnSeekBarChangeListener(new MySeekBarChangeListener(this));
            blueBar.SetOnSeekBarChangeListener(new MySeekBarChangeListener(this));


            // Set up the spinner for blend mode selection from a string array resource
            blendSpinner = (Spinner)v.FindViewById(Resource.Id.blendSpinner);
            ISpinnerAdapter sa = ArrayAdapter.CreateFromResource(Activity,
                                                                 Resource.Array.blend_modes, Android.Resource.Layout.SimpleSpinnerDropDownItem);

            blendSpinner.Adapter = sa;
            // Set a listener to update the tinted image when a blend mode is selected
            blendSpinner.OnItemSelectedListener = new MyBlendListener(this);
            // Select the first item
            blendSpinner.SetSelection(0);
            mode = MODES [0];

            if (savedInstanceState != null)
            {
                // Resore the previous state if this fragment has been restored
                blendSpinner.SetSelection(savedInstanceState.GetInt(STATE_BLEND));
                alphaBar.Progress = savedInstanceState.GetInt(STATE_ALPHA);
                redBar.Progress   = savedInstanceState.GetInt(STATE_RED);
                greenBar.Progress = savedInstanceState.GetInt(STATE_GREEN);
                blueBar.Progress  = savedInstanceState.GetInt(STATE_BLUE);
            }

            // Apply the default blend mode and color
            UpdateTint(GetColor(), GetTintMode());

            return(v);
        }
Пример #4
0
        void swapDirection(object sender, EventArgs e)
        {
            swapping = true;
            int to   = spinnerStationFrom.SelectedItemPosition;
            int from = spinnerStationTo.SelectedItemPosition;

            ISpinnerAdapter temp = spinnerStationFrom.Adapter;

            spinnerStationFrom.Adapter = spinnerStationTo.Adapter;
            spinnerStationTo.Adapter   = temp;

            spinnerStationFrom.SetSelection(from);
            spinnerStationTo.SetSelection(to);
        }
Пример #5
0
 public override void SetListNavigationCallbacks(ISpinnerAdapter adapter, IOnNavigationListener callback)
 {
     throw new NotImplementedException();
 }
Пример #6
0
 public override void SetListNavigationCallbacks(ISpinnerAdapter adapter, IOnNavigationListener callback)
 {
     throw new NotImplementedException();
 }