//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override public android.view.View onCreateView(android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup container, @Nullable android.os.Bundle savedInstanceState) public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_pos_printer_bitmap, container, false); bitmapPathTextView = (TextView) view.findViewById(R.id.textViewBitmapPath); widthEditText = (EditText) view.findViewById(R.id.editTextWidth); alignmentSpinner = (Spinner) view.findViewById(R.id.spinnerAlignment); view.findViewById(R.id.buttonGallery).OnClickListener = this; view.findViewById(R.id.buttonPrintBitmap).OnClickListener = this; deviceMessagesTextView = (TextView) view.findViewById(R.id.textViewDeviceMessages); deviceMessagesTextView.MovementMethod = new ScrollingMovementMethod(); deviceMessagesTextView.VerticalScrollBarEnabled = true; brightnessTextView = (TextView) view.findViewById(R.id.textViewBrightness); brightnessSeekBar = (SeekBar) view.findViewById(R.id.seekBarBrightness); brightnessSeekBar.OnSeekBarChangeListener = this; return view; }
public void OnStopTrackingTouch(SeekBar seekBar) { }
public void OnProgressChanged(SeekBar seekBar, int progress, bool fromUser) { context.TipPercent.Text = progress.ToString(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); configCodes = Resources.GetStringArray(Resource.Array.ConfigCodes); ModeList = FindViewById <ListView>(Resource.Id.ModeListView); colorView = FindViewById <View>(Resource.Id.ColorExampleView); ArrayAdapter <String> lvAdapter = new ArrayAdapter <String>(this, Android.Resource.Layout.SimpleListItemSingleChoice, configCodes); seekBarHue = FindViewById <SeekBar>(Resource.Id.seekBar1); seekBarSat = FindViewById <SeekBar>(Resource.Id.seekBar2); seekBarVal = FindViewById <SeekBar>(Resource.Id.seekBar3); seekBarHue.Max = 360; seekBarSat.Max = 255; seekBarVal.Max = 255; seekBarHue.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { if (e.FromUser) { ColorDrawable color = (ColorDrawable)colorView.Background; uint colorCode = 0; double Hue = e.Progress; int r, g, b; double h, s, v; h = seekBarHue.Progress; s = (float)seekBarSat.Progress / 255; v = (float)seekBarVal.Progress / 255; HsvToRgb(h, s, v, out r, out g, out b); colorCode += (uint)r; colorCode += (uint)g * 0x100; colorCode += (uint)b * 0x10000; colorCode += (uint)color.Color.A * 0x1000000; String colorString = "#" + colorCode.ToString("X"); Color ccolor = Color.ParseColor(colorString); colorView.SetBackgroundColor(ccolor); TextView HueText = FindViewById <TextView>(Resource.Id.textView1); HueText.Text = "Тон: " + e.Progress; } }; seekBarSat.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { if (e.FromUser) { ColorDrawable color = (ColorDrawable)colorView.Background; uint colorCode = 0; int r, g, b; double h, s, v; h = seekBarHue.Progress; s = (float)seekBarSat.Progress / 255; v = (float)seekBarVal.Progress / 255; HsvToRgb(h, s, v, out r, out g, out b); colorCode += (uint)r; colorCode += (uint)g * 0x100; colorCode += (uint)b * 0x10000; colorCode += (uint)color.Color.A * 0x1000000; String colorString = "#" + colorCode.ToString("X"); Color ccolor = Color.ParseColor(colorString); colorView.SetBackgroundColor(ccolor); TextView SatText = FindViewById <TextView>(Resource.Id.textView2); SatText.Text = "Насыщенность: " + e.Progress; } }; seekBarVal.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { if (e.FromUser) { ColorDrawable color = (ColorDrawable)colorView.Background; uint colorCode = 0; int r, g, b; double h, s, v; h = seekBarHue.Progress; s = (float)seekBarSat.Progress / 255; v = (float)seekBarVal.Progress / 255; HsvToRgb(h, s, v, out r, out g, out b); colorCode += (uint)r; colorCode += (uint)g * 0x100; colorCode += (uint)b * 0x10000; colorCode += (uint)color.Color.A * 0x1000000; String colorString = "#" + colorCode.ToString("X"); Color ccolor = Color.ParseColor(colorString); colorView.SetBackgroundColor(ccolor); TextView ValText = FindViewById <TextView>(Resource.Id.textView3); ValText.Text = "Яркость: " + e.Progress; } }; ModeList.Adapter = lvAdapter; ModeList.ChoiceMode = ChoiceMode.Single; ModeList.SetSelection(0); ModeList.SetItemChecked(0, true); AcceptButton = FindViewById <Button>(Resource.Id.button1); AcceptButton.Click += delegate { AcceptButtonClick(); }; BluetoothAdapter btAdapter = BluetoothAdapter.DefaultAdapter; if (btAdapter == null) { throw new Exception("No Bluetooth adapter found."); } if (!btAdapter.IsEnabled) { throw new Exception("Bluetooth adapter is not enabled."); } BluetoothDevice device = (from bd in btAdapter.BondedDevices where bd.Name == "ColorMusic" select bd).FirstOrDefault(); if (device == null) { throw new Exception("Named device not found."); } btSocket = device.CreateInsecureRfcommSocketToServiceRecord(UUID.FromString(btUUID)); try { btSocket.Connect(); } catch (IOException e) { btSocket.Close(); throw new Exception("Can't Connect"); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); RequestWindowFeature(Android.Views.WindowFeatures.NoTitle); SetContentView(Resource.Layout.activity_custom); _progressBar = (Castorflex.SmoothProgressBar.SmoothProgressBar)FindViewById(Resource.Id.progressbar); _checkBoxMirror = FindViewById <CheckBox>(Resource.Id.checkbox_mirror); _checkBoxReversed = FindViewById <CheckBox>(Resource.Id.checkbox_reversed); _spinnerInterpolators = FindViewById <Spinner>(Resource.Id.spinner_interpolator); _seekBarSectionsCount = FindViewById <SeekBar>(Resource.Id.seekbar_sections_count); _seekBarStrokeWidth = FindViewById <SeekBar>(Resource.Id.seekbar_stroke_width); _seekBarSeparatorLength = FindViewById <SeekBar>(Resource.Id.seekbar_separator_length); _seekBarSpeed = FindViewById <SeekBar>(Resource.Id.seekbar_speed); _seekBarFactor = FindViewById <SeekBar>(Resource.Id.seekbar_factor); _textViewSpeed = FindViewById <TextView>(Resource.Id.textview_speed); _textViewSectionsCount = FindViewById <TextView>(Resource.Id.textview_sections_count); _textViewSeparatorLength = FindViewById <TextView>(Resource.Id.textview_separator_length); _textViewStrokeWidth = FindViewById <TextView>(Resource.Id.textview_stroke_width); _textViewFactor = FindViewById <TextView>(Resource.Id.textview_factor); FindViewById(Resource.Id.button_start).Click += (object sender, System.EventArgs e) => { _progressBar.ProgressiveStart(); }; FindViewById(Resource.Id.button_stop).Click += (object sender, System.EventArgs e) => { _progressBar.ProgressiveStop(); }; _seekBarFactor.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { _factor = (e.Progress + 1) / 10f; _textViewFactor.Text = "Factor: " + _factor; SetInterpolator(_spinnerInterpolators.SelectedItemPosition); }; _seekBarSpeed.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { _speed = ((float)e.Progress + 1) / 10; _textViewSpeed.Text = "Speed: " + _speed; _progressBar.SetSmoothProgressDrawableSpeed(_speed); _progressBar.SetSmoothProgressDrawableProgressiveStartSpeed(_speed); _progressBar.SetSmoothProgressDrawableProgressiveStopSpeed(_speed); }; _seekBarSectionsCount.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { _sectionsCount = e.Progress + 1; _textViewSectionsCount.Text = "Sections count: " + _sectionsCount; _progressBar.SetSmoothProgressDrawableSectionsCount(_sectionsCount); }; _seekBarSeparatorLength.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { _separatorLength = e.Progress; _textViewSeparatorLength.Text = string.Format("Separator length: {0}dp", _separatorLength); _progressBar.SetSmoothProgressDrawableSeparatorLength(DpToPx(_separatorLength)); }; _seekBarStrokeWidth.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { _strokeWidth = e.Progress; _textViewStrokeWidth.Text = string.Format("Stroke width: {0}dp", _strokeWidth); _progressBar.SetSmoothProgressDrawableStrokeWidth(DpToPx(_strokeWidth)); }; _checkBoxMirror.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => { _progressBar.SetSmoothProgressDrawableMirrorMode(e.IsChecked); }; _checkBoxReversed.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => { _progressBar.SetSmoothProgressDrawableReversed(e.IsChecked); }; _seekBarSeparatorLength.Progress = 4; _seekBarSectionsCount.Progress = 4; _seekBarStrokeWidth.Progress = 4; _seekBarSpeed.Progress = 9; _seekBarFactor.Progress = 9; _spinnerInterpolators.Adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, Resources.GetStringArray(Resource.Array.interpolators)); _spinnerInterpolators.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => { SetInterpolator(e.Position); }; _spinnerInterpolators.SetSelection(0); }
/// <summary> /// Includes the specified seekBar. /// </summary> /// <param name="seekBar">The seekBar.</param> public void Include(SeekBar seekBar) { seekBar.ProgressChanged += (sender, args) => seekBar.Progress = seekBar.Progress + 1; }
public override void onStopTrackingTouch(SeekBar seekBar) { // Seeks to requested position. int position = seekBar.Progress; mPlayerController.seek(position); mState.mPosition = position; // Re-enables current position refreshing. mUpdateEventHandler.sendEmptyMessage(PositionUpdater.START_POLLING); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_advanced); EditText baseVol = FindViewById <EditText>(Resource.Id.editText1); EditText baseConc = FindViewById <EditText>(Resource.Id.editText2); EditText finalConc = FindViewById <EditText>(Resource.Id.editText3); TextView finalVol = FindViewById <TextView>(Resource.Id.textView1); TextView txtRatio = FindViewById <TextView>(Resource.Id.textView2); SeekBar seekBar = FindViewById <SeekBar>(Resource.Id.seekBar1); Button calcButton = FindViewById <Button>(Resource.Id.button1); Button switchModeButton = FindViewById <Button>(Resource.Id.button2); baseVol.SetHintTextColor(new Color(255, 255, 255, 128)); baseConc.SetHintTextColor(new Color(255, 255, 255, 128)); finalConc.SetHintTextColor(new Color(255, 255, 255, 128)); seekBar.Progress = 50; seekBar.ProgressChanged += (sender, e) => { int vgRatio = 100 - seekBar.Progress; int pgRatio = seekBar.Progress; txtRatio.Text = $" PG/VG Ratio {pgRatio}/{vgRatio}"; }; calcButton.Click += (sender, e) => { string baseVolStr = baseVol.Text; string baseConcStr = baseConc.Text; string finalConcStr = finalConc.Text; try { double baseVolNum = double.Parse(baseVolStr); double baseConcNum = double.Parse(baseConcStr); double finalConcNum = double.Parse(finalConcStr); double finalVolNum = Core.Calculate.Calc(baseVolNum, baseConcNum, finalConcNum); string finalVolStr = finalVolNum.ToString(); double pgRatio = double.Parse(seekBar.Progress.ToString()); double pgPerc = (pgRatio / finalVolNum) * 100; finalVol.Text = $"PG Volume: {pgPerc}\nVG Volume: {100 - pgPerc}\nTotal Volume: {finalVolStr}"; } catch (Exception exception) { Toast.MakeText(this.ApplicationContext, "Please fill in all fields with numbers only", ToastLength.Long).Show(); } }; switchModeButton.Click += (sender, e) => { var intent = new Intent(this, typeof(MainActivity)); this.StartActivity(intent); }; }
public void OnStartTrackingTouch(SeekBar seekBar) { // Nothing }
//GoogleMap _googleMap; protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_box); StaticMenu.id_page = 1; btn_save_parameters = FindViewById <Button>(Resource.Id.btn_save_parameters); btn_cause_alarm = FindViewById <Button>(Resource.Id.BtnCauseAlarmBox); SmullWeight = FindViewById <TextView>(Resource.Id.SmullWeight); SmullTemperature = FindViewById <TextView>(Resource.Id.SmullTemperature); SmullLight = FindViewById <TextView>(Resource.Id.SmullLight); SmullHumidity = FindViewById <TextView>(Resource.Id.SmullHumidity); TextNameBox = FindViewById <TextView>(Resource.Id.TextNameBox); SmullBattery = FindViewById <TextView>(Resource.Id.SmullBattery); SmullNetworkSignal = FindViewById <TextView>(Resource.Id.SmullNetworkSignal); s_weight = FindViewById <SeekBar>(Resource.Id.s_weight); s_temperature = FindViewById <SeekBar>(Resource.Id.TemperatureEdit); s_light = FindViewById <SeekBar>(Resource.Id.s_light); s_humidity = FindViewById <SeekBar>(Resource.Id.s_humidity); s_battery = FindViewById <SeekBar>(Resource.Id.s_battery); s_signal_strength_1 = FindViewById <SeekBar>(Resource.Id.s_signal_strength_1); GetInfoAboutBox(); var value = CrossSettings.Current.GetValueOrDefault("AlermId", ""); if (value == "1" || value == "2" || value == "3") { btn_cause_alarm.Text = "Отменить тревогу"; } s_weight.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { if (StaticBox.Sensors["Состояние контейнера"] == "0") { s_weight.Progress = 0; } else { if (e.FromUser) { SmullWeight.Text = string.Format("{0}", e.Progress); } } }; s_temperature.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { if (e.FromUser) { SmullTemperature.Text = (e.Progress - 40).ToString(); } }; s_light.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { if (e.FromUser) { SmullLight.Text = string.Format("{0}", e.Progress); } }; s_humidity.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { if (e.FromUser) { SmullHumidity.Text = string.Format("{0}", e.Progress); } }; s_battery.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { if (e.FromUser) { SmullBattery.Text = string.Format("{0}", e.Progress); } }; s_signal_strength_1.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { if (e.FromUser) { SmullNetworkSignal.Text = (e.Progress - 110).ToString(); } }; btn_cause_alarm.Click += delegate { var value = CrossSettings.Current.GetValueOrDefault("AlermId", ""); try { if (value == "1" || value == "2" || value == "3") { CancelAlarm(); } else { Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this); LayoutInflater layoutInflater = LayoutInflater.From(this); View dialogView = layoutInflater.Inflate(Resource.Layout.CauseAlarmCardView, null); alert.SetView(dialogView); var Fluid_Leakage = dialogView.FindViewById <RadioButton>(Resource.Id.BtnFluidLeakage); var Excess_Weight = dialogView.FindViewById <RadioButton>(Resource.Id.BtnExcessWeight); var Door_Sensor_Operation = dialogView.FindViewById <RadioButton>(Resource.Id.BtnDoorSensorOperation); alert.SetPositiveButton("Выбрать", (senderAlert, args) => { if (Fluid_Leakage.Checked == true) { CrossSettings.Current.AddOrUpdateValue("AlermId", "1"); } if (Excess_Weight.Checked == true) { CrossSettings.Current.AddOrUpdateValue("AlermId", "2"); } if (Door_Sensor_Operation.Checked == true) { CrossSettings.Current.AddOrUpdateValue("AlermId", "3"); } MakeRequestAlarm(); }); alert.SetNegativeButton("Отмена", (senderAlert, args) => { }); Dialog dialog1 = alert.Create(); dialog1.Show(); } } catch (Exception ex) { Toast.MakeText(this, "" + ex.Message, ToastLength.Long).Show(); } }; //редактирование данных контейнера btn_save_parameters.Click += async delegate { var data = await EditSensors(); if (data.Status == "1") { Toast.MakeText(this, data.Message, ToastLength.Long).Show(); GetInfoAboutBox(); } else { Toast.MakeText(this, data.Message, ToastLength.Long).Show(); StaticBox.CameraOpenOrNo = 1; Intent authActivity = new Intent(this, typeof(Auth.SensorsDataActivity)); StartActivity(authActivity); } }; }
private void SetControlsIO() { btnPrev = (Button)FindViewById(Resource.Id.btnPrev); btnNext = (Button)FindViewById(Resource.Id.btnNext); btnPlay = (Button)FindViewById(Resource.Id.btnPlay); Button btnFoldersList = (Button)FindViewById(Resource.Id.btnFoldersList); Button btnSongsList = (Button)FindViewById(Resource.Id.btnSongsList); Button btnSongsSearch = (Button)FindViewById(Resource.Id.btnSongsSearch); //mediaPlayer = (MediaPlayer)FindViewById(Resource.Id.mediaControllerMain); barSeek = (SeekBar)FindViewById(Resource.Id.barSeek); barSeek.BringToFront(); barSeek.ProgressChanged += barSeek_OnProgressChanged; barVolume = (SeekBar)FindViewById(Resource.Id.barVolume); barVolume.ProgressChanged += barVolume_OnChanged; barVolume.BringToFront(); try { //barVolume.Min = 0; // 0.0f; //barVolume.Max = 15; // 1.0f } catch { } lblSongName = (TextView)FindViewById(Resource.Id.lblSongName); scrHorizonSongName = (HorizontalScrollView)FindViewById(Resource.Id.scrHorizonSongName); lblSongArtist = (TextView)FindViewById(Resource.Id.lblSongArtist); lblAlbum = (TextView)FindViewById(Resource.Id.lblAlbum); lblPosNow = (TextView)FindViewById(Resource.Id.lblPosNow); lblPosEnd = (TextView)FindViewById(Resource.Id.lblPosEnd); lblSongsListCaption = (TextView)FindViewById(Resource.Id.lblSongsListCaption); lblVolumePos = (TextView)FindViewById(Resource.Id.lblVolumePos); imgSongArtist1 = (ImageView)FindViewById(Resource.Id.imgSongArtist1); imgSongArtist2 = (ImageView)FindViewById(Resource.Id.imgSongArtist2); imgSongArtist3 = (ImageView)FindViewById(Resource.Id.imgSongArtist3); scrHorizonPics = (HorizontalScrollView)FindViewById(Resource.Id.scrHorizonPics); PICS_TIMER_SCROLL_END_POINT = 1000; // (imgSongArtist1.Width * 3) - 500; //layFolderList = (RelativeLayout)FindViewById(Resource.Id.layFolderList); //layFolderList.Visibility = ViewStates.Invisible; cardFilesList = (Android.Support.V7.Widget.CardView)FindViewById(Resource.Id.cardFilesList); cardFilesList.Visibility = ViewStates.Invisible; lstFiles = (ListView)FindViewById(Resource.Id.lstFiles); //lstFiles.ItemClick += ListSongOrFolder_ItemClick; //lstFiles.FocusedByDefault = true; //string folderNameMusic = Android.OS.Environment.DirectoryMusic; //string folderMusic = Android.OS.Environment.GetExternalStoragePublicDirectory(folderNameMusic).AbsolutePath; //string songPath = folderMusic + "/Dizzy - Bleachers.mp3"; //songPath = externalPath + "/ProjTaskReminder"; //, FileCreationMode.Append).AbsolutePath; //Java.IO.File externalPath = Android.OS.Environment.ExternalStorageDirectory; //string externalPathFile = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath; //KeyValuePair<string, List<string>> songKeys = new KeyValuePair<string, List<string>>(folderMusic + "/Dizzy - Bleachers.mp3", new List<string>()); //ListItemsPath = new List<KeyValuePair<string, List<string>>>(); //ListItemsPath.Add(songKeys); //KeyValuePair<string, string> songKeys = new KeyValuePair<string, string>("love_the_one.mp3", songPath); //ListItemsPath.Add(songKeys); //ListItemSong song = new ListItemSong("Dizzy - Bleachers", "Dizzy", "Album"); //KeyValuePair<string, ListItemSong> songItem = new KeyValuePair<string, ListItemSong>("love_the_one", song); //ListItemsRecycler.Add(songItem); //mediaPlayer = new MediaPlayer(); //mediaPlayer.Completion += OnSongFinish; imgSongArtist1.Click += ScrollPictures_OnClick; imgSongArtist2.Click += ScrollPictures_OnClick; imgSongArtist3.Click += ScrollPictures_OnClick; scrHorizonPics.Click += ScrollPictures_OnClick; btnPrev.Click += PlaySongPrev; btnNext.Click += PlaySongNext; btnPlay.Click += OnPlayButton; btnFoldersList.Click += btnFoldersList_OnListItem; btnSongsList.Click += btnSongsList_OnListItem; btnSongsSearch.Click += btnSongsSearch_Click; ScrollPictures = new MH_Scroll(scrHorizonPics); ScrollPictures.SCROLL_INTERVAL = 200; ScrollPictures.SCROLL_DELTA = 20; ScrollPictures.SCROLL_END_POINT = 2300; // (imgSongArtist1.Width * 3) - 500; //ScrollPictures.OnScrolling += ScrollPictures_OnScrolling; ScrollSongName = new MH_Scroll(scrHorizonSongName); ScrollSongName.SCROLL_INTERVAL = 200; ScrollSongName.SCROLL_DELTA = 8; ScrollSongName.SCROLL_END_POINT = 220; // (imgSongArtist1.Width * 3) - 500; ScrollSongName.IsScrollRightToLeft = false; //ScrollSongName.OnScrolling += ScrollSongName_OnScrolling; isPlayingNow = false; IsTimerWork = false; IsHaveToScroll = true; IsFirstPlay = true; audioManager = (AudioManager)GetSystemService(Context.AudioService); int actualVolume = audioManager.GetStreamVolume(Android.Media.Stream.Music); barVolume.Progress = actualVolume; }
public void button_init() { msgText = FindViewById <TextView>(Resource.Id.msgText); debugText = FindViewById <TextView>(Resource.Id.debugText); DNSeditText = FindViewById <EditText>(Resource.Id.DNSeditText); IPeditText = FindViewById <EditText>(Resource.Id.IPeditText); Button alarmviewButton = FindViewById <Button>(Resource.Id.alarmviewButton); alarmviewButton.Click += delegate { Publish("get", "gpio/alarm/time_get"); StartActivity(typeof(alarm)); }; Button settingsviewButton = FindViewById <Button>(Resource.Id.settingsviewButton); settingsviewButton.Click += delegate { };//StartActivity(typeof(alarm)); }; Button button1_0 = FindViewById <Button>(Resource.Id.button1_0); button1_0.Click += delegate { button1_0_click(); }; Button button1_1 = FindViewById <Button>(Resource.Id.button1_1); button1_1.Click += delegate { button1_1_click(); }; Button button2_0 = FindViewById <Button>(Resource.Id.button2_0); button2_0.Click += delegate { button2_0_click(); }; Button button2_1 = FindViewById <Button>(Resource.Id.button2_1); button2_1.Click += delegate { button2_1_click(); }; Button button1 = FindViewById <Button>(Resource.Id.button1); button1.Click += delegate { button1_click(); }; Button button2 = FindViewById <Button>(Resource.Id.button2); button2.Click += delegate { button2_click(); }; Button button3 = FindViewById <Button>(Resource.Id.button3); button3.Click += delegate { button3_click(); }; Button button4 = FindViewById <Button>(Resource.Id.button4); button4.Click += delegate { button4_click(); }; Button button5 = FindViewById <Button>(Resource.Id.button5); button5.Click += delegate { button5_click(); }; Button button6 = FindViewById <Button>(Resource.Id.button6); button6.Click += delegate { button6_click(); }; Button button_resolve = FindViewById <Button>(Resource.Id.button_resolve); button_resolve.Click += delegate { button_resolve_click(); }; button_connect = FindViewById <Button>(Resource.Id.button_connect); button_connect.Click += delegate { button_connect_click(); }; seekBar1 = FindViewById <SeekBar>(Resource.Id.seekBar1); seekBar1.ProgressChanged += delegate { seekbar1_changed(); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.settings); easy = FindViewById <RadioButton>(Resource.Id.radioEasy); normal = FindViewById <RadioButton>(Resource.Id.radioNormal); hard = FindViewById <RadioButton>(Resource.Id.radioHard); redBar = FindViewById <SeekBar>(Resource.Id.seekBarRed); greenBar = FindViewById <SeekBar>(Resource.Id.seekBarGreen); blueBar = FindViewById <SeekBar>(Resource.Id.seekBlue); imgPreview = FindViewById <ImageView>(Resource.Id.imgThemePreview); playerSelect = FindViewById <SeekBar>(Resource.Id.seekBarPlayer); ballSelect = FindViewById <SeekBar>(Resource.Id.seekBarBall); txtPlayerSelect = FindViewById <TextView>(Resource.Id.txtPlayerSelect); txtBallSelect = FindViewById <TextView>(Resource.Id.txtBallSelect); sensivityBar = FindViewById <SeekBar>(Resource.Id.seekBarSensivity); maxScore = FindViewById <SeekBar>(Resource.Id.seekBarMaxScore); txtMaxScore = FindViewById <TextView>(Resource.Id.txtMaxScore); paddleToggle = FindViewById <ToggleButton>(Resource.Id.togglePaddle); debugToggle = FindViewById <ToggleButton>(Resource.Id.toggleDebug); //Preserve settings after switching screens loadSettings(); easy.CheckedChange += (e, o) => { if (easy.Checked) { Settings.Difficulty = 1; } }; normal.CheckedChange += (e, o) => { if (normal.Checked) { Settings.Difficulty = 2; } }; hard.CheckedChange += (e, o) => { if (hard.Checked) { Settings.Difficulty = 3; } }; paddleToggle.CheckedChange += (e, o) => { Settings.RightPaddle = paddleToggle.Checked; }; debugToggle.CheckedChange += (e, o) => { Settings.DebugMode = debugToggle.Checked == false ? 0 : 1; }; redBar.ProgressChanged += (e, o) => { Settings.R = redBar.Progress; imgPreview.SetColorFilter(new Color(redBar.Progress, greenBar.Progress, blueBar.Progress)); }; greenBar.ProgressChanged += (e, o) => { Settings.G = greenBar.Progress; imgPreview.SetColorFilter(new Color(redBar.Progress, greenBar.Progress, blueBar.Progress)); }; blueBar.ProgressChanged += (e, o) => { Settings.B = blueBar.Progress; imgPreview.SetColorFilter(new Color(redBar.Progress, greenBar.Progress, blueBar.Progress)); }; sensivityBar.ProgressChanged += (e, o) => { Settings.Sensivity = sensivityBar.Progress; }; playerSelect.ProgressChanged += (e, o) => { Settings.player = playerSelect.Progress; switch (playerSelect.Progress) { case 0: { Settings.player = 0; txtPlayerSelect.Text = "Player model: Metallic"; } break; case 1: { Settings.player = 1; txtPlayerSelect.Text = "Player model: Laser"; } break; case 2: { Settings.player = 2; txtPlayerSelect.Text = "Player model: Plank"; } break; default: { Settings.player = 0; txtPlayerSelect.Text = "Player model: Metallic"; } break; } }; ballSelect.ProgressChanged += (e, o) => { Settings.ball = ballSelect.Progress; switch (ballSelect.Progress) { case 0: { Settings.ball = 0; txtBallSelect.Text = "Ball model: Meteor"; } break; case 1: { Settings.ball = 1; txtBallSelect.Text = "Ball model: Football"; } break; case 2: { Settings.ball = 2; txtBallSelect.Text = "Ball model: Cannonball"; } break; default: { Settings.ball = 0; txtBallSelect.Text = "Ball model: Meteor"; } break; } }; maxScore.ProgressChanged += (e, o) => { Settings.maxScore = maxScore.Progress; txtMaxScore.Text = "Max game points: " + maxScore.Progress; }; }
public override void onStopTrackingTouch(SeekBar seekBar) { // TODO Auto-generated method stub }
private void CreateLayout() { // Create a stack layout for the entire page LinearLayout mainLayout = new LinearLayout(this) { Orientation = Orientation.Vertical }; // Create a button to show the available slope types for the user to choose from _slopeTypeButton = new Button(this) { Text = "Slope type: " + _slopeType.ToString() }; // Show a popup menu of available slope types when the button is clicked _slopeTypeButton.Click += (s, e) => { // Get the button that raised the event Button slopeChoiceButton = s as Button; // Create menu to show slope options PopupMenu slopeTypeMenu = new PopupMenu(this, slopeChoiceButton); slopeTypeMenu.MenuItemClick += (sndr, evt) => { // Get the name of the selected slope type string selectedSlope = evt.Item.TitleCondensedFormatted.ToString(); // Find and store the corresponding slope type enum foreach (SlopeType slope in Enum.GetValues(typeof(SlopeType))) { if (slope.ToString() == selectedSlope) { _slopeType = slope; _slopeTypeButton.Text = "Slope type: " + selectedSlope; } } }; // Create menu options foreach (SlopeType slope in Enum.GetValues(typeof(SlopeType))) { slopeTypeMenu.Menu.Add(slope.ToString()); } // Show menu in the view slopeTypeMenu.Show(); }; // Create a slider (SeekBar) control for selecting an azimuth angle SeekBar azimuthSlider = new SeekBar(this) { // Set the slider width and height LayoutParameters = new ViewGroup.LayoutParams(350, 60), // Set a maximum slider value of 360 (minimum is 0) Max = 360 }; // When the slider changes, show the new value in the label azimuthSlider.ProgressChanged += (s, e) => { _azimuthTextView.Text = e.Progress.ToString(); }; // Create a slider (SeekBar) control for selecting an altitude angle SeekBar altitudeSlider = new SeekBar(this) { // Set the slider width and height LayoutParameters = new ViewGroup.LayoutParams(350, 60), // Set a maximum slider value of 90 (minimum is 0) Max = 90 }; // When the slider changes, show the new value in the label altitudeSlider.ProgressChanged += (s, e) => { _altitudeTextView.Text = e.Progress.ToString(); }; // Create labels (TextViews) to show the selected altitude and azimuth values _altitudeTextView = new TextView(this); _azimuthTextView = new TextView(this); // Create a horizontal layout for the altitude slider and text LinearLayout altitudeControls = new LinearLayout(this); altitudeControls.SetGravity(GravityFlags.Center); // Add the altitude selection controls altitudeControls.AddView(new TextView(this) { Text = "Altitude:" }); altitudeControls.AddView(altitudeSlider); altitudeControls.AddView(_altitudeTextView); // Create a horizontal layout for the azimuth slider and text LinearLayout azimuthControls = new LinearLayout(this); azimuthControls.SetGravity(GravityFlags.Center); // Add the azimuth selection controls azimuthControls.AddView(new TextView(this) { Text = "Azimuth:" }); azimuthControls.AddView(azimuthSlider); azimuthControls.AddView(_azimuthTextView); // Create a button to create and apply a hillshade renderer to the raster layer _applyHillshadeButton = new Button(this) { Text = "Apply hillshade" }; // Handle the click event to apply the hillshade renderer _applyHillshadeButton.Click += ApplyHillshadeButton_Click; // Add the slope type button to the layout mainLayout.AddView(_slopeTypeButton); // Add the slider controls to the layout mainLayout.AddView(altitudeControls); mainLayout.AddView(azimuthControls); // Set the default values for the azimuth and altitude altitudeSlider.Progress = 45; azimuthSlider.Progress = 270; // Add the apply hillshade renderer button mainLayout.AddView(_applyHillshadeButton); // Create the map view _myMapView = new MapView(this); // Add the map view to the layout mainLayout.AddView(_myMapView); // Set the layout as the sample view SetContentView(mainLayout); }
public static string BindProgress(this SeekBar seekBar) => MvxAndroidPropertyBinding.SeekBar_Progress;
public void OnStopTrackingTouch(SeekBar seekBar) { OnProgressChangedByUser?.Invoke(this, new EventArgs()); }
public override void onProgressChanged(SeekBar seekBar, int progress, bool fromUser) { brightnessTextView.Text = Convert.ToString(progress); }
void SeekBar.IOnSeekBarChangeListener.OnProgressChanged(SeekBar seekBar, int progress, bool fromUser) { _value = _minValue + progress; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); // Set a dialog title. Dialog.SetTitle("Define a symbol"); // Get the context for creating the dialog controls. Android.Content.Context ctx = Activity.ApplicationContext; // The container for the dialog is a vertical linear layout. LinearLayout dialogView = new LinearLayout(ctx) { Orientation = Orientation.Vertical }; dialogView.SetPadding(10, 0, 10, 10); try { // Create a list box for showing each category of symbol: eyes, mouth, hat. _eyesList = new ListView(ctx); _mouthList = new ListView(ctx); _hatList = new ListView(ctx); // Create a new list adapter to show the eye symbols in a list view. SymbolListAdapter eyesAdapter = new SymbolListAdapter(Activity, _eyeSymbolInfos); // Handle selection change events for the eyes symbol adapter. eyesAdapter.OnSymbolSelectionChanged += async(sender, e) => { // Get the key for the selected eyes (if any) then update the symbol. if (eyesAdapter.SelectedSymbolInfo != null) { _selectedEyesKey = eyesAdapter.SelectedSymbolInfo?.Key; await UpdateSymbol(); } }; // Assign the adapter to the list view. _eyesList.Adapter = eyesAdapter; // Create a label to for the "eyes" symbol list. TextView eyesLabel = new TextView(ctx); eyesLabel.SetText("Eyes", TextView.BufferType.Normal); eyesLabel.Gravity = GravityFlags.Center; eyesLabel.TextSize = 15.0f; eyesLabel.SetTextColor(Android.Graphics.Color.Black); // Add the eyes label and list to the dialog. dialogView.AddView(eyesLabel); dialogView.AddView(_eyesList); // Create a new list adapter to show the mouth symbols in a list view. SymbolListAdapter mouthAdapter = new SymbolListAdapter(Activity, _mouthSymbolInfos); // Handle selection change events for the eyes symbol adapter. mouthAdapter.OnSymbolSelectionChanged += async(sender, e) => { // Get the key for the selected mouth (if any) then update the symbol. if (mouthAdapter.SelectedSymbolInfo != null) { _selectedMouthKey = mouthAdapter.SelectedSymbolInfo?.Key; await UpdateSymbol(); } }; // Assign the adapter to the list view. _mouthList.Adapter = mouthAdapter; // Create a label to for the "mouth" symbol list. TextView mouthLabel = new TextView(ctx); mouthLabel.SetText("Mouth", TextView.BufferType.Normal); mouthLabel.Gravity = GravityFlags.Center; mouthLabel.TextSize = 15.0f; mouthLabel.SetTextColor(Android.Graphics.Color.Black); // Add the mouth label and list to the dialog. dialogView.AddView(mouthLabel); dialogView.AddView(_mouthList); // Create a new list adapter to show the hat symbols in a list view. SymbolListAdapter hatAdapter = new SymbolListAdapter(Activity, _hatSymbolInfos); // Handle selection change events for the hat symbol adapter. hatAdapter.OnSymbolSelectionChanged += async(sender, e) => { // Get the key for the selected hat (if any) then update the symbol. if (hatAdapter.SelectedSymbolInfo != null) { _selectedHatKey = hatAdapter.SelectedSymbolInfo?.Key; await UpdateSymbol(); } }; // Assign the adapter to the list view. _hatList.Adapter = hatAdapter; // Create a label to for the "hat" symbol list. TextView hatLabel = new TextView(ctx); hatLabel.SetText("Hat", TextView.BufferType.Normal); hatLabel.Gravity = GravityFlags.Center; hatLabel.TextSize = 15.0f; hatLabel.SetTextColor(Android.Graphics.Color.Black); // Add the hat label and list to the dialog. dialogView.AddView(hatLabel); dialogView.AddView(_hatList); // Add a preview image for the symbol. _symbolPreviewImage = new ImageView(ctx); dialogView.AddView(_symbolPreviewImage); // A button to set a yellow symbol color. Button yellowButton = new Button(ctx); yellowButton.SetBackgroundColor(Color.Yellow); // Handle the button click event to set the current color and update the symbol. yellowButton.Click += async(sender, e) => { _faceColor = Color.Yellow; await UpdateSymbol(); }; // A button to set a green symbol color. Button greenButton = new Button(ctx); greenButton.SetBackgroundColor(Color.Green); // Handle the button click event to set the current color and update the symbol. greenButton.Click += async(sender, e) => { _faceColor = Color.Green; await UpdateSymbol(); }; // A button to set a pink symbol color. Button pinkButton = new Button(ctx); pinkButton.SetBackgroundColor(Color.Pink); // Handle the button click event to set the current color and update the symbol. pinkButton.Click += async(sender, e) => { _faceColor = Color.Pink; await UpdateSymbol(); }; // Add the color selection buttons to a horizontal layout. LinearLayout colorLayout = new LinearLayout(ctx) { Orientation = Orientation.Horizontal }; colorLayout.SetPadding(10, 20, 10, 20); colorLayout.AddView(yellowButton); colorLayout.AddView(greenButton); colorLayout.AddView(pinkButton); // Add the color selection buttons to the dialog. dialogView.AddView(colorLayout); // Create a slider (SeekBar) to adjust the symbol size. SeekBar sizeSlider = new SeekBar(ctx) { // Set a maximum slider value of 60 and a current value of 20. Max = 60, Progress = 20 }; // Create a label to show the selected symbol size (preview size won't change). TextView sizeLabel = new TextView(ctx) { Gravity = GravityFlags.Right, TextSize = 10.0f, Text = $"Size:{_symbolSize:0}" }; sizeLabel.SetTextColor(Color.Black); // When the slider value (Progress) changes, update the symbol with the new size. sizeSlider.ProgressChanged += (s, e) => { // Read the slider value and limit the minimum size to 8. _symbolSize = (e.Progress < 8) ? 8 : e.Progress; // Show the selected size in the label. sizeLabel.Text = $"Size:{_symbolSize:0}"; }; // Create a horizontal layout to show the slider and label. LinearLayout sliderLayout = new LinearLayout(ctx) { Orientation = Orientation.Horizontal }; sliderLayout.SetPadding(10, 10, 10, 10); sizeSlider.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, 1.0f); // Add the size slider and label to the layout. sliderLayout.AddView(sizeSlider); sliderLayout.AddView(sizeLabel); // Add the size controls to the dialog layout. dialogView.AddView(sliderLayout); // Add a button to close the dialog and use the current symbol. Button selectSymbolButton = new Button(ctx) { Text = "OK" }; // Handle the button click to dismiss the dialog and pass back the symbol. selectSymbolButton.Click += SelectSymbolButtonClick; // Add the button to the dialog. dialogView.AddView(selectSymbolButton); } catch (Exception ex) { // Show the exception message. AlertDialog.Builder alertBuilder = new AlertDialog.Builder(Activity); alertBuilder.SetTitle("Error"); alertBuilder.SetMessage(ex.Message); alertBuilder.Show(); } // Show a preview of the current symbol (created previously or the default face). UpdateSymbol(); // Return the new view for display. return(dialogView); }
void SeekBar.IOnSeekBarChangeListener.OnStopTrackingTouch(SeekBar seekBar) { }
public void OnStartTrackingTouch(SeekBar seekBar) { System.Diagnostics.Debug.WriteLine("Tracking changes."); // Console.WriteLine(seekBar.Progress); }
private void InitComponent(View view) { try { MainLayout = view.FindViewById <RelativeLayout>(Resource.Id.mainLayout); IconLocation = view.FindViewById <TextView>(Resource.Id.IconLocation); LocationTextView = view.FindViewById <TextView>(Resource.Id.LocationTextView); LocationPlace = view.FindViewById <TextView>(Resource.Id.LocationPlace); LocationMoreIcon = view.FindViewById <TextView>(Resource.Id.LocationMoreIcon); GenderTextView = view.FindViewById <TextView>(Resource.Id.GenderTextView); IconFire = view.FindViewById <TextView>(Resource.Id.IconFire); IconAge = view.FindViewById <TextView>(Resource.Id.IconAge); AgeTextView = view.FindViewById <TextView>(Resource.Id.AgeTextView); AgeNumberTextView = view.FindViewById <TextView>(Resource.Id.Agenumber); OnlineTextView = view.FindViewById <TextView>(Resource.Id.OnlineTextView); IconOnline = view.FindViewById <TextView>(Resource.Id.Icononline); ResetTextView = view.FindViewById <TextView>(Resource.Id.Resetbutton); LocationLayout = view.FindViewById <RelativeLayout>(Resource.Id.LayoutLocation); ButtonMan = view.FindViewById <Button>(Resource.Id.ManButton); ButtonGirls = view.FindViewById <Button>(Resource.Id.GirlsButton); ButtonBoth = view.FindViewById <Button>(Resource.Id.BothButton); ButtonApply = view.FindViewById <Button>(Resource.Id.ApplyButton); AgeSeekBar = view.FindViewById <RangeSliderControl>(Resource.Id.seekbar); OnlineSwitch = view.FindViewById <Switch>(Resource.Id.togglebutton); IconDistance = view.FindViewById <TextView>(Resource.Id.IconDistance); TxtDistanceCount = view.FindViewById <TextView>(Resource.Id.Distancenumber); DistanceBar = view.FindViewById <SeekBar>(Resource.Id.distanceSeeker); ResetTextView.Visibility = ViewStates.Gone; ButtonApply.Visibility = ViewStates.Gone; MainLayout.Visibility = ViewStates.Gone; FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconLocation, IonIconsFonts.IosLocationOutline); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, LocationMoreIcon, IonIconsFonts.ChevronRight); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconFire, IonIconsFonts.IosPersonOutline); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconAge, IonIconsFonts.Calendar); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconOnline, IonIconsFonts.Ionic); FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, IconDistance, FontAwesomeIcon.StreetView); FontUtils.SetFont(LocationTextView, Fonts.SfRegular); FontUtils.SetFont(LocationPlace, Fonts.SfRegular); FontUtils.SetFont(GenderTextView, Fonts.SfRegular); FontUtils.SetFont(AgeTextView, Fonts.SfRegular); FontUtils.SetFont(OnlineTextView, Fonts.SfRegular); FontUtils.SetFont(TxtDistanceCount, Fonts.SfRegular); DistanceBar.Max = 50; DistanceBar.SetOnSeekBarChangeListener(this); AgeSeekBar.SetSelectedMinValue(18); AgeSeekBar.SetSelectedMaxValue(75); OnlineSwitch.Checked = false; ButtonGirls.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends); ButtonGirls.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#ffffff") : Color.ParseColor("#444444")); ButtonBoth.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends_pressed); ButtonBoth.SetTextColor(Color.ParseColor("#ffffff")); ButtonMan.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends); ButtonMan.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#ffffff") : Color.ParseColor("#444444")); MAdView = view.FindViewById <AdView>(Resource.Id.adView); AdsGoogle.InitAdView(MAdView, null); SetLocalData(); var dataUser = ListUtils.MyUserInfo.FirstOrDefault(); if (!AppSettings.EnableAppFree && dataUser?.IsPro == "0") { LocationLayout.Visibility = ViewStates.Gone; } else { LocationLayout.Visibility = ViewStates.Visible; } } catch (Exception e) { Console.WriteLine(e); } }
public override View GetPropertyWindowLayout(Android.Content.Context context) { int width = (context.Resources.DisplayMetrics.WidthPixels) / 2; LinearLayout propertylayout = new LinearLayout(context); propertylayout.Orientation = Android.Widget.Orientation.Vertical; LinearLayout.LayoutParams layoutParams1 = new LinearLayout.LayoutParams( width * 2, 5); layoutParams1.SetMargins(0, 20, 0, 0); type = new TextView(context); type.Text = "Error Bar Type"; type.SetPadding(5, 20, 0, 20); mode = new TextView(context); mode.Text = "Drawing Mode"; mode.SetPadding(5, 30, 0, 20); horizontalDirection = new TextView(context); horizontalDirection.Text = "Horizontal Direction"; horizontalDirection.SetPadding(5, 30, 0, 20); verticalDirection = new TextView(context); verticalDirection.Text = "Vertical Direction"; verticalDirection.SetPadding(5, 30, 0, 20); horizontalValue = new TextView(context); horizontalValue.Text = "Horizontal Error : 3.0"; horizontalValue.SetPadding(5, 30, 0, 20); verticalValue = new TextView(context); verticalValue.Text = "Vertical Error : 3.0"; verticalValue.SetPadding(5, 20, 0, 20); Spinner errorBarType = new Spinner(context, SpinnerMode.Dialog); Spinner errorBarDrawingMode = new Spinner(context, SpinnerMode.Dialog); errorBarDrawingMode.SetSelection(2); SeekBar errorBarHorizontalError = new SeekBar(context); errorBarHorizontalError.Max = 3; errorBarHorizontalError.Progress = 3; SeekBar errorBarVerticalError = new SeekBar(context); errorBarVerticalError.Max = 3; errorBarVerticalError.Progress = 3; Spinner errorBarHorizontalDirection = new Spinner(context, SpinnerMode.Dialog); Spinner errorBarVerticalDirection = new Spinner(context, SpinnerMode.Dialog); types = new List <string>() { "Fixed", "Custom", "percentage", "StandardDeviation", "StandardErrors" }; modes = new List <string>() { "Both", "Horizontal", "Vertical" }; horizonatalDirections = new List <string> { "Both", "Minus", "Plus" }; verticalDirections = new List <string> { "Both", "Minus", "Plus" }; ArrayAdapter <string> dataAdapter = new ArrayAdapter <string> (context, Android.Resource.Layout.SimpleSpinnerItem, types); dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line); errorBarType.Adapter = dataAdapter; ArrayAdapter <string> dataAdapter1 = new ArrayAdapter <string> (context, Android.Resource.Layout.SimpleSpinnerItem, modes); dataAdapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line); errorBarDrawingMode.Adapter = dataAdapter1; ArrayAdapter <string> dataAdapter2 = new ArrayAdapter <string> (context, Android.Resource.Layout.SimpleSpinnerItem, horizonatalDirections); dataAdapter2.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line); errorBarHorizontalDirection.Adapter = dataAdapter2; ArrayAdapter <string> dataAdapter3 = new ArrayAdapter <string> (context, Android.Resource.Layout.SimpleSpinnerItem, verticalDirections); dataAdapter3.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line); errorBarVerticalDirection.Adapter = dataAdapter3; errorBarType.ItemSelected += Type_ItemSelected; errorBarDrawingMode.ItemSelected += Mode_ItemSelected; errorBarHorizontalError.ProgressChanged += HorizontalError_ProgressChanged; errorBarVerticalError.ProgressChanged += VerticalError_ProgressChanged; errorBarHorizontalDirection.ItemSelected += HorizontalDirection_ItemSelected; errorBarVerticalDirection.ItemSelected += VerticalDirection_ItemSelected; propertylayout.AddView(type); propertylayout.AddView(errorBarType); propertylayout.AddView(mode); propertylayout.AddView(errorBarDrawingMode); propertylayout.AddView(horizontalValue); propertylayout.AddView(errorBarHorizontalError); propertylayout.AddView(verticalValue); propertylayout.AddView(errorBarVerticalError); propertylayout.AddView(horizontalDirection); propertylayout.AddView(errorBarHorizontalDirection); propertylayout.AddView(verticalDirection); propertylayout.AddView(errorBarVerticalDirection); SeparatorView separate = new SeparatorView(context, width * 2); separate.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5); propertylayout.AddView(separate, layoutParams1); return(propertylayout); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); try { SetContentView(Resource.Layout.Filter); expert_data = Application.Context.GetSharedPreferences("experts", FileCreationMode.Private); edit_expert = expert_data.Edit(); recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false); findBn = FindViewById <Button>(Resource.Id.findBn); resetBn = FindViewById <Button>(Resource.Id.resetBn); backRelativeLayout = FindViewById <RelativeLayout>(Resource.Id.backRelativeLayout); distanceRL = FindViewById <RelativeLayout>(Resource.Id.distanceRL); back_button = FindViewById <ImageButton>(Resource.Id.back_button); cancellationBn = FindViewById <Button>(Resource.Id.cancellationBn); city_value = FindViewById <TextView>(Resource.Id.city_value); distance_value = FindViewById <TextView>(Resource.Id.distance_value); inform_processTV = FindViewById <TextView>(Resource.Id.inform_processTV); distanceSB = FindViewById <SeekBar>(Resource.Id.distanceSB); onlyWithReviewsS = FindViewById <Switch>(Resource.Id.onlyWithReviewsS); activityIndicator = FindViewById <ProgressBar>(Resource.Id.activityIndicator); city_chooseLL = FindViewById <LinearLayout>(Resource.Id.city_chooseLL); activityIndicator.IndeterminateDrawable.SetColorFilter(Resources.GetColor(Resource.Color.buttonBackgroundColor), Android.Graphics.PorterDuff.Mode.Multiply); SpecializationMethods specializationMethods = new SpecializationMethods(); recyclerView.SetLayoutManager(layoutManager); Typeface tf = Typeface.CreateFromAsset(Assets, "Roboto-Regular.ttf"); FindViewById <TextView>(Resource.Id.headerTV).SetTypeface(tf, TypefaceStyle.Bold); resetBn.SetTypeface(tf, TypefaceStyle.Normal); FindViewById <TextView>(Resource.Id.textView1).SetTypeface(tf, TypefaceStyle.Normal); city_value.SetTypeface(tf, TypefaceStyle.Normal); FindViewById <TextView>(Resource.Id.textViesw1).SetTypeface(tf, TypefaceStyle.Normal); distance_value.SetTypeface(tf, TypefaceStyle.Normal); FindViewById <TextView>(Resource.Id.textVsiew1).SetTypeface(tf, TypefaceStyle.Normal); inform_processTV.SetTypeface(tf, TypefaceStyle.Normal); findBn.SetTypeface(tf, TypefaceStyle.Normal); cancellationBn.SetTypeface(tf, TypefaceStyle.Normal); backRelativeLayout.Click += (s, e) => { OnBackPressed(); }; back_button.Click += (s, e) => { OnBackPressed(); }; if (String.IsNullOrEmpty(expert_data.GetString("expert_city_name", String.Empty))) { city_value.Text = GetString(Resource.String.not_chosen); } else { city_value.Text = expert_data.GetString("expert_city_name", String.Empty); resetBn.Enabled = true; resetBn.SetTextColor(Android.Graphics.Color.White); } if (String.IsNullOrEmpty(expert_data.GetString("distance_radius", String.Empty))) { distance_value.Text = "100 " + GetString(Resource.String.km); distanceSB.Progress = 100; } else { distance_value.Text = expert_data.GetString("distance_radius", String.Empty); distanceSB.Progress = Convert.ToInt32(expert_data.GetString("distance_radius", String.Empty)); resetBn.Enabled = true; resetBn.SetTextColor(Android.Graphics.Color.White); } if (expert_data.GetBoolean("has_reviews", false) == false) { onlyWithReviewsS.Checked = false; } else { onlyWithReviewsS.Checked = true; resetBn.Enabled = true; resetBn.SetTextColor(Android.Graphics.Color.White); } distanceSB.ProgressChanged += async(s, e) => { if (!reset_pressed) { resetBn.Enabled = true; resetBn.SetTextColor(Android.Graphics.Color.White); } if (e.Progress == 0) { distance_value.Text = "0.5" + " " + GetString(Resource.String.km); } else { distance_value.Text = e.Progress.ToString() + " " + GetString(Resource.String.km); } if (e.Progress == 0) { edit_expert.PutString("distance_radius", "0.5"); } else { edit_expert.PutString("distance_radius", e.Progress.ToString()); } edit_expert.Apply(); findBn.Visibility = ViewStates.Gone; activityIndicator.Visibility = ViewStates.Visible; inform_processTV.Visibility = ViewStates.Visible; inform_processTV.Text = "Получение количества специалистов"; var filtered = await specializationMethods.ExpertCount( expert_data.GetString("spec_id", String.Empty), expert_data.GetString("expert_city_id", String.Empty), expert_data.GetString("distance_radius", String.Empty), expert_data.GetBoolean("has_reviews", false), pref.GetString("latitude", String.Empty), pref.GetString("longitude", String.Empty)); var deserialized_value = JsonConvert.DeserializeObject <ExpertCount>(filtered.ToString()); activityIndicator.Visibility = ViewStates.Gone; findBn.Visibility = ViewStates.Visible; inform_processTV.Visibility = ViewStates.Gone; findBn.Text = "Показать " + deserialized_value.count.ToString() + " специалистов"; reset_pressed = false; }; onlyWithReviewsS.CheckedChange += async(s, e) => { if (!reset_pressed) { resetBn.Enabled = true; resetBn.SetTextColor(Android.Graphics.Color.White); } if (onlyWithReviewsS.Checked) { edit_expert.PutBoolean("has_reviews", true); } else { edit_expert.PutBoolean("has_reviews", false); } edit_expert.Apply(); findBn.Visibility = ViewStates.Gone; activityIndicator.Visibility = ViewStates.Visible; inform_processTV.Visibility = ViewStates.Visible; inform_processTV.Text = "Получение количества специалитов"; var filtered = await specializationMethods.ExpertCount( expert_data.GetString("spec_id", String.Empty), expert_data.GetString("expert_city_id", String.Empty), expert_data.GetString("distance_radius", String.Empty), expert_data.GetBoolean("has_reviews", false), pref.GetString("latitude", String.Empty), pref.GetString("longitude", String.Empty) ); var deserialized_value = JsonConvert.DeserializeObject <ExpertCount>(filtered.ToString()); activityIndicator.Visibility = ViewStates.Gone; findBn.Visibility = ViewStates.Visible; inform_processTV.Visibility = ViewStates.Gone; findBn.Text = "Показать " + deserialized_value.count.ToString() + " специалистов"; reset_pressed = false; }; city_value.Click += async(s, e) => { findBn.Visibility = ViewStates.Gone; activityIndicator.Visibility = ViewStates.Visible; inform_processTV.Visibility = ViewStates.Visible; inform_processTV.Text = GetString(Resource.String.getting_cities); var cities = await specializationMethods.GetCities(); city_chooseLL.Visibility = ViewStates.Visible; var deserialized_cities = JsonConvert.DeserializeObject <List <City> >(cities.ToString()); var listOfCitiesAdapter = new CityAdapter(deserialized_cities, this, tf); recyclerView.SetAdapter(listOfCitiesAdapter); }; cancellationBn.Click += (s, e) => { city_chooseLL.Visibility = ViewStates.Gone; inform_processTV.Visibility = ViewStates.Gone; findBn.Visibility = ViewStates.Visible; }; findBn.Click += (s, e) => { StartActivity(typeof(ListOfSpecialistsActivity)); }; resetBn.Click += (s, e) => { city_chooseLL.Visibility = ViewStates.Gone; reset_pressed = true; resetBn.Enabled = false; resetBn.SetTextColor(new Color(ContextCompat.GetColor(this, Resource.Color.lightBlueColor))); distanceRL.Visibility = ViewStates.Visible; distance_value.Text = "100 " + GetString(Resource.String.km); distanceSB.Progress = 100; //setting values to default edit_expert.PutString("expert_city_id", ""); edit_expert.PutString("expert_city_name", ""); edit_expert.PutString("distance_radius", ""); edit_expert.PutBoolean("has_reviews", false); edit_expert.Apply(); city_value.Text = GetString(Resource.String.not_chosen); onlyWithReviewsS.Checked = false; }; } catch { StartActivity(typeof(MainActivity)); } }
public static View LoadFloatElementLayout(Context context, View convertView, ViewGroup parent, int layoutId, out TextView label, out SeekBar slider, out ImageView left, out ImageView right) { var layout = convertView ?? LoadLayout(context, parent, layoutId); if (layout != null) { label = layout.FindViewById <TextView>(context.Resources.GetIdentifier("dialog_LabelField", "id", context.PackageName)); slider = layout.FindViewById <SeekBar>(context.Resources.GetIdentifier("dialog_SliderField", "id", context.PackageName)); left = layout.FindViewById <ImageView>(context.Resources.GetIdentifier("dialog_ImageLeft", "id", context.PackageName)); right = layout.FindViewById <ImageView>(context.Resources.GetIdentifier("dialog_ImageRight", "id", context.PackageName)); } else { label = null; slider = null; left = right = null; } return(layout); }
public override View GetPropertyWindowLayout(Android.Content.Context context) { TextView startAngle = new TextView(context); startAngle.Text = "Change StartAngle"; startAngle.Typeface = Typeface.DefaultBold; startAngle.SetTextColor(Color.ParseColor("#262626")); startAngle.TextSize = 20; TextView sweepAngle = new TextView(context); sweepAngle.Text = "Change SweepAngle"; sweepAngle.Typeface = Typeface.DefaultBold; sweepAngle.SetTextColor(Color.ParseColor("#262626")); sweepAngle.TextSize = 20; TextView startAngle1 = new TextView(context); startAngle1.Text = "Change StartAngle"; startAngle1.Typeface = Typeface.DefaultBold; startAngle1.SetTextColor(Color.ParseColor("#262626")); startAngle1.TextSize = 20; TextView sweepAngle1 = new TextView(context); sweepAngle1.Text = "Change SweepAngle"; sweepAngle1.Typeface = Typeface.DefaultBold; sweepAngle1.SetTextColor(Color.ParseColor("#262626")); sweepAngle1.TextSize = 20; SeekBar pointerSeek = new SeekBar(context); pointerSeek.Max = 350; pointerSeek.Progress = 135; pointerSeek.ProgressChanged += pointerSeek_ProgressChanged; SeekBar pointerSeek1 = new SeekBar(context); pointerSeek1.Max = 350; pointerSeek1.Progress = 270; pointerSeek1.ProgressChanged += pointerSeek_ProgressChanged1; SeekBar pointerSeek2 = new SeekBar(context); pointerSeek2.Max = 350; pointerSeek2.Progress = 135; pointerSeek2.ProgressChanged += pointerSeek_ProgressChanged2; SeekBar pointerSeek3 = new SeekBar(context); pointerSeek3.Max = 350; pointerSeek3.Progress = 270; pointerSeek3.ProgressChanged += pointerSeek_ProgressChanged3; LinearLayout optionsPage = new LinearLayout(context); optionsPage.Orientation = Orientation.Vertical; optionsPage.AddView(startAngle); optionsPage.AddView(pointerSeek); optionsPage.AddView(sweepAngle); optionsPage.AddView(pointerSeek1); optionsPage.AddView(startAngle1); optionsPage.AddView(pointerSeek2); optionsPage.AddView(sweepAngle1); optionsPage.AddView(pointerSeek3); optionsPage.SetPadding(10, 10, 10, 10); optionsPage.SetBackgroundColor(Color.White); return(optionsPage); }
public void OnProgressChanged(SeekBar seekBar, int progress, bool fromUser) { txtMode.Text = getPlayMode().ToUpper(); }
public void OnStopTrackingTouch(SeekBar seekBar) { // see http://developer.android.com/reference/android/widget/SeekBar.OnSeekBarChangeListener.html#onStopTrackingTouch(android.widget.SeekBar) // for details about this method System.Diagnostics.Debug.WriteLine("Stopped tracking changes."); }
public void recording() { View view = LayoutInflater.Inflate(Resource.Layout.audio_recorder, null); Android.App.AlertDialog builder = new Android.App.AlertDialog.Builder(Activity).Create(); builder.SetView(view); builder.Window.SetLayout(600, 600); builder.SetCanceledOnTouchOutside(false); recordbtn = view.FindViewById <Button>(Resource.Id.recordbtn); stopbtn = view.FindViewById <ImageView>(Resource.Id.stopbtn); playbtn = view.FindViewById <ImageView>(Resource.Id.playbtn); Timer = view.FindViewById <TextView>(Resource.Id.timerbtn); seekBar = view.FindViewById <SeekBar>(Resource.Id.seek_bar); Done_Btn = view.FindViewById <Button>(Resource.Id.donebtn); Done_Btn.Click += delegate { long size3 = fileaudioPath.Length() / 1024; string audiosize = size3.ToString(); Comp_AttachmentModel attachmentModel = new Comp_AttachmentModel(); attachmentModel.localPath = AudioSavePathInDevice; attachmentModel.file_type = "Audio"; attachmentModel.FileName = audioname; attachmentModel.taskId = task_id_to_send; attachmentModel.GeoLocation = geolocation; attachmentModel.FileSize = audiosize; attachmentModel.file_format = ".mp3"; // attachmentModel.max_numbers = audio_max.ToString(); db.InsertAttachmentData(attachmentModel, "no"); //comp_AttachmentModels.Add(attachmentModel); //imagelist.AddRange(comp_AttachmentModels.Where(p => p.Attachment_Type == "Image" )); audio_comp_lst.AddRange(db.GetAttachmentData(audioname)); // postattachmentcomplianceAsync(attachmentModel); adapter3 = new GridViewAdapter_Audio(Activity, audio_comp_lst, FragmentManager); Gridview3.Adapter = adapter3; if (ic.connectivity()) { postattachmentcomplianceAsync(attachmentModel); // db.updateComplianceattachmentstatus("yes"); } builder.Dismiss(); }; recordbtn.Click += delegate { MediaRecorderReady(); try { timer = new Timer(); timer.Interval = 1000; // 1 second timer.Elapsed += Timer_Elapsed; timer.Start(); mediaRecorder.Stop(); mediaRecorder.Prepare(); mediaRecorder.Start(); } catch (Exception e) { // TODO Auto-generated catch block //e.printStackTrace(); } Toast.MakeText(Activity, "Recording started", ToastLength.Long).Show(); }; stopbtn.Click += delegate { try { mediaRecorder.Stop(); Timer.Text = "00:00:00"; timer.Stop(); timer = null; } catch (Exception ex) { } //stoprecorder(); //btn2.Enabled=false; //buttonPlayLastRecordAudio.setEnabled(true); //buttonStart.setEnabled(true); //buttonStopPlayingRecording.setEnabled(false); Toast.MakeText(Activity, "Recording completed", ToastLength.Long).Show(); }; //pausebtn.Click += delegate //{ // //OnPause(); // mediaRecorder.Pause(); // timer.Dispose(); //}; playbtn.Click += delegate { mediaPlayer = new MediaPlayer(); mediaPlayer.SetDataSource(AudioSavePathInDevice); mediaPlayer.Prepare(); mediaPlayer.Start(); //mediaPlayer = MediaPlayer.Create(this, Resource.Raw.AudioSavePathInDevice); seekBar.Max = mediaPlayer.Duration; run(); }; builder.Show(); }
public void onProgressChanged(SeekBar seekBar, int progress, bool fromUser) { if (fromUser) { mWebview.postDelayed(new Runnable() { @Override
public void Include(SeekBar sb) { sb.ProgressChanged += (sender, args) => sb.Progress = sb.Progress + 1; }
/// <summary> /// Sets the global references to UI elements and event handlers for those elements. /// </summary> private void setupViewElements() { mVideoView = (SurfaceView) findViewById(R.id.video); mTitleText = (TextView) findViewById(R.id.titleText); mPositionText = (TextView) findViewById(R.id.positionText); mDurationText = (TextView) findViewById(R.id.durationText); mSubtitlesText = (TextView) findViewById(R.id.subtitlesText); mSeekBar = (SeekBar) findViewById(R.id.videoPosition); mPlayButton = (ImageButton) findViewById(R.id.playPause); mMuteButton = (ImageButton) findViewById(R.id.mute); mSeekBar.OnSeekBarChangeListener = this; mPlayButton.OnClickListener = this; mPositionText.Text = "00:00"; mProgressDialog = new ProgressDialog(this); mProgressDialog.Message = "Buffering..."; mProgressDialog.Cancelable = true; mProgressDialog.OnCancelListener = new OnCancelListenerAnonymousInnerClassHelper(this); View stopButton = findViewById(R.id.stop); stopButton.OnClickListener = this; mMuteButton.OnClickListener = this; mDevicePicker = (DevicePicker) FragmentManager.findFragmentById(R.id.playerPicker); mDevicePicker.DeviceType = SmcDevice.TYPE_AVPLAYER; mDevicePicker.DeviceSelectedListener = this; }
public override View GetPropertyWindowLayout(Android.Content.Context context) { TextView pointervalue = new TextView(context); pointervalue.Text = "Change Pointer Value"; pointervalue.Typeface = Typeface.DefaultBold; pointervalue.SetTextColor(Color.ParseColor("#262626")); pointervalue.TextSize = 20; SeekBar pointerSeek = new SeekBar(context); pointerSeek.Max = 1000; pointerSeek.Progress = 800; pointerSeek.ProgressChanged += pointerSeek_ProgressChanged; TextView pointervalue1 = new TextView(context); pointervalue1.Text = "RangePointer Color"; pointervalue1.Typeface = Typeface.DefaultBold; pointervalue1.SetTextColor(Color.ParseColor("#262626")); pointervalue1.TextSize = 20; Spinner selectLabelMode = new Spinner(context, SpinnerMode.Dialog); adapter = new List <String>() { "Yellow", "Green", "Pink" }; ArrayAdapter <String> dataAdapter = new ArrayAdapter <String> (context, Android.Resource.Layout.SimpleSpinnerItem, adapter); dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line); selectLabelMode.Adapter = dataAdapter; selectLabelMode.ItemSelected += SelectLabelMode_ItemSelected; TextView pointervalue2 = new TextView(context); pointervalue2.Text = "NeedlePointer Color"; pointervalue2.Typeface = Typeface.DefaultBold; pointervalue2.SetTextColor(Color.ParseColor("#262626")); pointervalue2.TextSize = 20; Spinner selectLabelModel1 = new Spinner(context, SpinnerMode.Dialog); adapter1 = new List <String>() { "Black", "Violet", "Brown" }; ArrayAdapter <String> dataAdapter1 = new ArrayAdapter <String> (context, Android.Resource.Layout.SimpleSpinnerItem, adapter1); dataAdapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line); selectLabelModel1.Adapter = dataAdapter1; selectLabelModel1.ItemSelected += SelectLabelMode_ItemSelected1; TextView pointervalue3 = new TextView(context); pointervalue3.Text = "Range Color"; pointervalue3.Typeface = Typeface.DefaultBold; pointervalue3.SetTextColor(Color.ParseColor("#262626")); pointervalue3.TextSize = 20; Spinner selectLabelModel2 = new Spinner(context, SpinnerMode.Dialog); adapter2 = new List <String>() { "LightGray", "Blue", "Orange" }; ArrayAdapter <String> dataAdapter2 = new ArrayAdapter <String> (context, Android.Resource.Layout.SimpleSpinnerItem, adapter2); dataAdapter2.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line); selectLabelModel2.Adapter = dataAdapter2; selectLabelModel2.ItemSelected += SelectLabelMode_ItemSelected2; optionsPage = new LinearLayout(context); optionsPage.Orientation = Orientation.Vertical; optionsPage.AddView(pointervalue); optionsPage.AddView(pointerSeek); optionsPage.AddView(pointervalue1); optionsPage.AddView(selectLabelMode); optionsPage.AddView(pointervalue2); optionsPage.AddView(selectLabelModel1); optionsPage.AddView(pointervalue3); optionsPage.AddView(selectLabelModel2); optionsPage.SetPadding(10, 10, 10, 10); optionsPage.SetBackgroundColor(Color.White); return(optionsPage); }
// //////////////////////////////////////////////////////////////////////// // These methods handle the seek bar events. // //////////////////////////////////////////////////////////////////////// public override void onProgressChanged(SeekBar seekBar, int progress, bool fromUser) { // Do nothing. }
public static void UpdateMaximum(this SeekBar seekBar, ISlider slider) => UpdateValue(seekBar, slider);
public override void onStartTrackingTouch(SeekBar seekBar) { // Blocks seek bar refreshing to avoid flickering. mUpdateEventHandler.sendEmptyMessage(PositionUpdater.STOP_POLLING); }