public bool OnScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { float dist = MathF.Sqrt(MathF.Pow(distanceX, 2) + MathF.Pow(distanceY, 2)); int count = (int)Math.Ceiling(dist / 10f); if (count < 0) { count = 1; } else if (count > 5) { count = 5; } Logger.Log(count.ToString()); int curProgress = seekBar.Progress; if (distanceX > 0) { presenter.MoveTo(curProgress + count); seekBar.SetProgress(curProgress + count, true); } else { presenter.MoveTo(curProgress - count); seekBar.SetProgress(curProgress - count, true); } return(true); }
private void LoadSongIntoPlayer(int listPositionIndex, bool withPlay = true) { try { // Release song sources MusicStop(); if (ListPositionIndex >= ListItemsRecycler.Count || ListPositionIndex < 0) { return; } //int resourceID = Resource.Raw.love_the_one; //int resourceID = ListItemsRecycler.get(listPositionIndex).getResourceID(); //string folderNameMusic = Android.OS.Environment.DirectoryMusic; //string folderMusic = Android.OS.Environment.GetExternalStoragePublicDirectory(folderNameMusic).AbsolutePath; //string songPath = folderMusic + "/Brad.mp3"; string songPath = ListItemsRecycler[listPositionIndex].Key; //string songPath = ListItemsPath[listPositionIndex].Key; Android.Net.Uri uri = Android.Net.Uri.Parse(songPath); mediaPlayer = MediaPlayer.Create(this, uri); //mediaPlayer = MediaPlayer.Create(this, resourceID); if (mediaPlayer != null) { mediaPlayer.SeekTo(0); barSeek.Max = mediaPlayer.Duration; barSeek.SetProgress(0, false); //mediaPlayer.SetScreenOnWhilePlaying(true); } CurrentSongPosition = 0; // Set the Song props - Name, Artist, Album, Duration SetSongControls(listPositionIndex); if (withPlay) { MusicPlay(); } //ScrollSongName.StartPosstion(); } catch (Exception ex) { MH_Utils.Utils.WriteToLog("Error while load a song into Media player.. \n" + ex.Message); } }
private void SkbSeekSongTime_StopTrackingTouch(object sender, SeekBar.StopTrackingTouchEventArgs e) { //When user stop dragging then seek to the position previously saved in ProgressChangedEvent Jukebox.SeekTo(e.SeekBar.Progress * 1000); if (Build.VERSION.SdkInt > BuildVersionCodes.LollipopMr1) { skbSeekSongTime.SetProgress(e.SeekBar.Progress, true); } else { skbSeekSongTime.Progress = e.SeekBar.Progress; } }
private void InitComponent(View view) { try { IconBack = view.FindViewById <TextView>(Resource.Id.IconBack); IconDistance = view.FindViewById <TextView>(Resource.Id.IconDistance); TxtDistanceCount = view.FindViewById <TextView>(Resource.Id.Distancenumber); LayoutJobType = view.FindViewById <RelativeLayout>(Resource.Id.LayoutJobType); LayoutCategories = view.FindViewById <RelativeLayout>(Resource.Id.LayoutCategories); DistanceBar = view.FindViewById <SeekBar>(Resource.Id.distanceSeeker); DistanceBar.Max = 300; DistanceBar.SetOnSeekBarChangeListener(this); IconJobType = view.FindViewById <TextView>(Resource.Id.IconJobType); TxtJobType = view.FindViewById <TextView>(Resource.Id.textJobType); JobTypeMoreIcon = view.FindViewById <TextView>(Resource.Id.JobTypeMoreIcon); IconCategories = view.FindViewById <TextView>(Resource.Id.IconCategories); TxtCategories = view.FindViewById <TextView>(Resource.Id.textCategories); CategoriesMoreIcon = view.FindViewById <TextView>(Resource.Id.CategoriesMoreIcon); BtnApply = view.FindViewById <Button>(Resource.Id.ApplyButton); FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, IconDistance, FontAwesomeIcon.StreetView); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconBack, AppSettings.FlowDirectionRightToLeft ? IonIconsFonts.IosArrowDropright : IonIconsFonts.IosArrowDropleft); FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeBrands, IconCategories, FontAwesomeIcon.Buromobelexperte); FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, IconJobType, FontAwesomeIcon.Briefcase); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, JobTypeMoreIcon, AppSettings.FlowDirectionRightToLeft ? IonIconsFonts.IosArrowDropleft : IonIconsFonts.IosArrowDropright); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, CategoriesMoreIcon, AppSettings.FlowDirectionRightToLeft ? IonIconsFonts.IosArrowDropleft : IonIconsFonts.IosArrowDropright); switch (Build.VERSION.SdkInt) { case >= BuildVersionCodes.N: DistanceBar.SetProgress(string.IsNullOrEmpty(UserDetails.FilterJobLocation) ? 300 : Convert.ToInt32(UserDetails.FilterJobLocation), true); break; // For API < 24 default: DistanceBar.Progress = string.IsNullOrEmpty(UserDetails.FilterJobLocation) ? 300 : Convert.ToInt32(UserDetails.FilterJobLocation); break; } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
//public void seekUpdation() //{ // seekbar.SetProgress(player.CurrentPosition, true); // //seekHandler.PostDelayed( 1000); //} public void run() { action = () => { if (player != null) { int mCurrentPosition = player.CurrentPosition / 1000; // seekbar.Progress = mCurrentPosition; seekbar.SetProgress(player.CurrentPosition, true); seekbar.Max = player.Duration; } mHandler.PostDelayed(action, 1000); }; mHandler.Post(action); }
private void InitComponent(View view) { try { IconBack = view.FindViewById <TextView>(Resource.Id.IconBack); IconDistance = view.FindViewById <TextView>(Resource.Id.IconDistance); TxtDistanceCount = view.FindViewById <TextView>(Resource.Id.Distancenumber); LayoutJobType = view.FindViewById <RelativeLayout>(Resource.Id.LayoutJobType); LayoutCategories = view.FindViewById <RelativeLayout>(Resource.Id.LayoutCategories); DistanceBar = view.FindViewById <SeekBar>(Resource.Id.distanceSeeker); DistanceBar.Max = 300; DistanceBar.SetOnSeekBarChangeListener(this); IconJobType = view.FindViewById <TextView>(Resource.Id.IconJobType); TxtJobType = view.FindViewById <TextView>(Resource.Id.textJobType); JobTypeMoreIcon = view.FindViewById <TextView>(Resource.Id.JobTypeMoreIcon); IconCategories = view.FindViewById <TextView>(Resource.Id.IconCategories); TxtCategories = view.FindViewById <TextView>(Resource.Id.textCategories); CategoriesMoreIcon = view.FindViewById <TextView>(Resource.Id.CategoriesMoreIcon); BtnApply = view.FindViewById <Button>(Resource.Id.ApplyButton); FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, IconDistance, FontAwesomeIcon.StreetView); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconBack, IonIconsFonts.ChevronLeft); FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeBrands, IconCategories, FontAwesomeIcon.Buromobelexperte); FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, IconJobType, FontAwesomeIcon.Briefcase); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, JobTypeMoreIcon, IonIconsFonts.ChevronRight); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, CategoriesMoreIcon, IonIconsFonts.ChevronRight); if (Build.VERSION.SdkInt >= BuildVersionCodes.N) { DistanceBar.SetProgress(string.IsNullOrEmpty(UserDetails.FilterJobLocation) ? 300 : int.Parse(UserDetails.FilterJobLocation), true); } else // For API < 24 { DistanceBar.Progress = string.IsNullOrEmpty(UserDetails.FilterJobLocation) ? 300 : int.Parse(UserDetails.FilterJobLocation); } } catch (Exception e) { Console.WriteLine(e); } }
private void InitComponent(View view) { try { IconBack = view.FindViewById <TextView>(Resource.Id.IconBack); GenderRecycler = view.FindViewById <RecyclerView>(Resource.Id.GenderRecyler); TxtDistanceCount = view.FindViewById <TextView>(Resource.Id.Distancenumber); DistanceBar = view.FindViewById <SeekBar>(Resource.Id.distanceSeeker); ButtonOffline = view.FindViewById <Button>(Resource.Id.OfflineButton); ButtonOnline = view.FindViewById <Button>(Resource.Id.OnlineButton); BothStatusButton = view.FindViewById <Button>(Resource.Id.BothStatusButton); BtnApply = view.FindViewById <Button>(Resource.Id.ApplyButton); ResetTextView = view.FindViewById <TextView>(Resource.Id.Resetbutton); LayoutRelationship = view.FindViewById <RelativeLayout>(Resource.Id.LayoutRelationship); TxtRelationship = view.FindViewById <TextView>(Resource.Id.textRelationship); RelationshipMoreIcon = view.FindViewById <TextView>(Resource.Id.RelationshipMoreIcon); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconBack, AppSettings.FlowDirectionRightToLeft ? IonIconsFonts.IosArrowDropright : IonIconsFonts.IosArrowDropleft); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, RelationshipMoreIcon, AppSettings.FlowDirectionRightToLeft ? IonIconsFonts.IosArrowDropleft : IonIconsFonts.IosArrowDropright); DistanceBar.Max = 300; DistanceBar.SetOnSeekBarChangeListener(this); switch (Build.VERSION.SdkInt) { case >= BuildVersionCodes.N: DistanceBar.SetProgress(string.IsNullOrEmpty(UserDetails.NearByDistanceCount) ? 300 : Convert.ToInt32(UserDetails.NearByDistanceCount), true); break; // For API < 24 default: DistanceBar.Progress = string.IsNullOrEmpty(UserDetails.NearByDistanceCount) ? 300 : Convert.ToInt32(UserDetails.NearByDistanceCount); break; } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void InitComponent(View view) { try { IconBack = view.FindViewById <TextView>(Resource.Id.IconBack); GenderRecycler = view.FindViewById <RecyclerView>(Resource.Id.GenderRecyler); TxtDistanceCount = view.FindViewById <TextView>(Resource.Id.Distancenumber); DistanceBar = view.FindViewById <SeekBar>(Resource.Id.distanceSeeker); ButtonOffline = view.FindViewById <Button>(Resource.Id.OfflineButton); ButtonOnline = view.FindViewById <Button>(Resource.Id.OnlineButton); BothStatusButton = view.FindViewById <Button>(Resource.Id.BothStatusButton); BtnApply = view.FindViewById <Button>(Resource.Id.ApplyButton); ResetTextView = view.FindViewById <TextView>(Resource.Id.Resetbutton); LayoutRelationship = view.FindViewById <RelativeLayout>(Resource.Id.LayoutRelationship); TxtRelationship = view.FindViewById <TextView>(Resource.Id.textRelationship); RelationshipMoreIcon = view.FindViewById <TextView>(Resource.Id.RelationshipMoreIcon); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconBack, AppSettings.FlowDirectionRightToLeft ? IonIconsFonts.ChevronRight : IonIconsFonts.ChevronLeft); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, RelationshipMoreIcon, AppSettings.FlowDirectionRightToLeft ? IonIconsFonts.ChevronLeft : IonIconsFonts.ChevronRight); DistanceBar.Max = 300; DistanceBar.SetOnSeekBarChangeListener(this); if (Build.VERSION.SdkInt >= BuildVersionCodes.N) { DistanceBar.SetProgress(string.IsNullOrEmpty(UserDetails.NearByDistanceCount) ? 300 : int.Parse(UserDetails.NearByDistanceCount), true); } else // For API < 24 { DistanceBar.Progress = string.IsNullOrEmpty(UserDetails.NearByDistanceCount) ? 300 : int.Parse(UserDetails.NearByDistanceCount); } } catch (Exception e) { Console.WriteLine(e); } }
private void SeekBarOnProgressChanged(object sender, SeekBar.ProgressChangedEventArgs e) { const int step = 5; var progress = e.Progress; progress = progress / step; progress = progress * step; _textView.Text = $"Master volume: {progress}"; _seekBar.SetProgress(progress, true); Log.Info("Setting master volume to {Value} FromUser: {FromUser}", progress, e.FromUser); if (e.FromUser) { Debouncer.Debounce(nameof(AudioFragment) + nameof(SeekBarOnProgressChanged), async() => { await _agent.DesktopClient.SetMasterVolumeAsync(TimeSpan.FromSeconds(5), progress); ToastHelper.Display("Volume updated", ToastLength.Short); }, TimeSpan.FromSeconds(2)); } }
private void MoveSeekbar() { Activity?.RunOnUiThread(() => { if (Build.VERSION.SdkInt > BuildVersionCodes.M) { if (skbSeekSongTime != null) { skbSeekSongTime?.SetProgress(skbSeekSongTime.Progress + 1, true); } } else { if (skbSeekSongTime != null) { skbSeekSongTime.Progress += 1; } } }); handler.PostDelayed(runnable, 1000); }
public override async void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); _seekBar = view.FindViewById <SeekBar>(Resource.Id.seekBar1); _textView = view.FindViewById <TextView>(Resource.Id.textView1); _imageViewMasterToggle = view.FindViewById <ImageView>(Resource.Id.button1); _recyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView1); _swipeRefreshLayout = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout1); _agent?.Dispose(); _agent = this.GetAgent(); _imageViewMasterToggle.Clickable = true; _swipeRefreshLayout.Refresh += SwipeRefreshLayoutOnRefresh; var dataSource = new AudioApplicationDataSource(_agent); dataSource.UpdateRequired += DataSourceOnUpdateRequired; _recyclerView.SetAdapter(dataSource); _imageViewMasterToggle.Click += ToggleMuteClicked; _seekBar.ProgressChanged += SeekBarOnProgressChanged; _seekBar.SetProgress(await _agent.DesktopClient.GetMasterVolumeAsync(TimeSpan.FromSeconds(5), 45), false); }
private void GetFilter() { try { var dbDatabase = new SqLiteDatabase(); var data = dbDatabase.GetNearByFilterById(); if (data != null) { Gender = data.Gender; DistanceCount = data.DistanceValue; Status = data.Status; RelationshipId = data.Relationship; //////////////////////////// Gender ////////////////////////////// Gender = data.Gender; var check1 = GenderAdapter.GenderList.Where(a => a.GenderSelect).ToList(); if (check1.Count > 0) { foreach (var all in check1) { all.GenderSelect = false; } } var check2 = GenderAdapter.GenderList.FirstOrDefault(a => a.GenderId == data.Gender); if (check2 != null) { check2.GenderSelect = true; Gender = check2.GenderId; } GenderAdapter.NotifyDataSetChanged(); TxtDistanceCount.Text = DistanceCount + " " + GetText(Resource.String.Lbl_km); if (Build.VERSION.SdkInt >= BuildVersionCodes.N) { DistanceBar.SetProgress(DistanceCount == 0 ? 300 : DistanceCount, true); } else // For API < 24 { DistanceBar.Progress = DistanceCount == 0 ? 300 : DistanceCount; } //////////////////////////// Status ////////////////////////////// //Select Status >> Both (2) //Select Status >> Online (1) //Select Status >> Offline (0) switch (data.Status) { case 0: ButtonOffline.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends_pressed); ButtonOffline.SetTextColor(Color.ParseColor("#ffffff")); BothStatusButton.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends); BothStatusButton.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#ffffff") : Color.ParseColor("#444444")); ButtonOnline.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends); ButtonOnline.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#ffffff") : Color.ParseColor("#444444")); Status = 0; break; case 1: ButtonOnline.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends_pressed); ButtonOnline.SetTextColor(Color.ParseColor("#ffffff")); BothStatusButton.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends); BothStatusButton.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#ffffff") : Color.ParseColor("#444444")); ButtonOffline.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends); ButtonOffline.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#ffffff") : Color.ParseColor("#444444")); Status = 1; break; case 2: BothStatusButton.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends_pressed); BothStatusButton.SetTextColor(Color.ParseColor("#ffffff")); ButtonOnline.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends); ButtonOnline.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#ffffff") : Color.ParseColor("#444444")); ButtonOffline.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends); ButtonOffline.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#ffffff") : Color.ParseColor("#444444")); Status = 2; break; } switch (RelationshipId) { case "1": TxtRelationship.Text = GetText(Resource.String.Lbl_Single); break; case "2": TxtRelationship.Text = GetText(Resource.String.Lbl_InRelationship); break; case "3": TxtRelationship.Text = GetText(Resource.String.Lbl_Married); break; case "4": TxtRelationship.Text = GetText(Resource.String.Lbl_Engaged); break; case "5": TxtRelationship.Text = GetText(Resource.String.Lbl_All); break; default: TxtRelationship.Text = GetText(Resource.String.Lbl_All); break; } } else { var newSettingsFilter = new DataTables.NearByFilterTb { DistanceValue = 0, Gender = "all", Status = 2, Relationship = "5", }; dbDatabase.InsertOrUpdate_NearByFilter(newSettingsFilter); Gender = "all"; DistanceCount = 0; Status = 2; RelationshipId = "5"; //////////////////////////// Gender ////////////////////////////// var check = GenderAdapter.GenderList.FirstOrDefault(a => a.GenderId == "all"); if (check != null) { check.GenderSelect = true; Gender = check.GenderId; GenderAdapter.NotifyDataSetChanged(); } //////////////////////////// Status ////////////////////////////// BothStatusButton.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends_pressed); BothStatusButton.SetTextColor(Color.ParseColor("#ffffff")); ButtonOnline.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends); ButtonOnline.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#ffffff") : Color.ParseColor("#444444")); ButtonOffline.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends); ButtonOffline.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#ffffff") : Color.ParseColor("#444444")); if (Build.VERSION.SdkInt >= BuildVersionCodes.N) { DistanceBar.SetProgress(300, true); } else // For API < 24 { DistanceBar.Progress = 300; } TxtDistanceCount.Text = DistanceCount + " " + GetText(Resource.String.Lbl_km); switch (RelationshipId) { case "5": TxtRelationship.Text = GetText(Resource.String.Lbl_All); break; case "1": TxtRelationship.Text = GetText(Resource.String.Lbl_Single); break; case "2": TxtRelationship.Text = GetText(Resource.String.Lbl_InRelationship); break; case "3": TxtRelationship.Text = GetText(Resource.String.Lbl_Married); break; case "4": TxtRelationship.Text = GetText(Resource.String.Lbl_Engaged); break; default: TxtRelationship.Text = GetText(Resource.String.Lbl_All); break; } } dbDatabase.Dispose(); } catch (Exception e) { Console.WriteLine(e); } }
//Reset Value private void ResetTextViewOnClick(object sender, EventArgs e) { try { var dbDatabase = new SqLiteDatabase(); var newSettingsFilter = new DataTables.NearByFilterTb { DistanceValue = 0, Gender = "all", Status = 2, Relationship = "5", }; dbDatabase.InsertOrUpdate_NearByFilter(newSettingsFilter); dbDatabase.Dispose(); Gender = "all"; DistanceCount = 0; Status = 2; RelationshipId = "5"; UserDetails.NearByGender = Gender; UserDetails.NearByDistanceCount = DistanceCount.ToString(); UserDetails.NearByStatus = Status.ToString(); UserDetails.NearByRelationship = RelationshipId; //////////////////////////// Gender ////////////////////////////// var check1 = GenderAdapter.GenderList.Where(a => a.GenderSelect).ToList(); if (check1.Count > 0) { foreach (var all in check1) { all.GenderSelect = false; } } var check2 = GenderAdapter.GenderList.FirstOrDefault(a => a.GenderId == "all"); if (check2 != null) { check2.GenderSelect = true; Gender = check2.GenderId; GenderAdapter.NotifyDataSetChanged(); } //////////////////////////// Status ////////////////////////////// BothStatusButton.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends_pressed); BothStatusButton.SetTextColor(Color.ParseColor("#ffffff")); ButtonOnline.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends); ButtonOnline.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#ffffff") : Color.ParseColor("#444444")); ButtonOffline.SetBackgroundResource(Resource.Drawable.follow_button_profile_friends); ButtonOffline.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#ffffff") : Color.ParseColor("#444444")); if (Build.VERSION.SdkInt >= BuildVersionCodes.N) { DistanceBar.SetProgress(300, true); } else // For API < 24 { DistanceBar.Progress = 300; } TxtDistanceCount.Text = DistanceCount + " " + GetText(Resource.String.Lbl_km); switch (RelationshipId) { case "5": TxtRelationship.Text = GetText(Resource.String.Lbl_All); break; case "1": TxtRelationship.Text = GetText(Resource.String.Lbl_Single); break; case "2": TxtRelationship.Text = GetText(Resource.String.Lbl_InRelationship); break; case "3": TxtRelationship.Text = GetText(Resource.String.Lbl_Married); break; case "4": TxtRelationship.Text = GetText(Resource.String.Lbl_Engaged); break; default: TxtRelationship.Text = GetText(Resource.String.Lbl_All); break; } } catch (Exception exception) { Console.WriteLine(exception); } }
private RelativeLayout SettingsLayoutSetup() { RelativeLayout layout = (RelativeLayout)((LayoutInflater)BaseContext.GetSystemService(Context.LayoutInflaterService)).Inflate(Resource.Layout.settings_layout, null); SeekBar radiusSB = layout.FindViewById <SeekBar>(Resource.Id.radius_seek_bar); Button loginButton = layout.FindViewById <Button>(Resource.Id.loginButton); TextView accountText = layout.FindViewById <TextView>(Resource.Id.setting_account); TextView radiusSBValue = layout.FindViewById <TextView>(Resource.Id.seekbar_value); NumberPicker maxHourPicker = layout.FindViewById <NumberPicker>(Resource.Id.max_hour_picker); EditText maxWeeklyEdit = layout.FindViewById <EditText>(Resource.Id.max_weekly_edit_text); Switch switchBoxShowCircle = layout.FindViewById <Switch>(Resource.Id.show_circle_checkbox); Switch switchShowAverage = layout.FindViewById <Switch>(Resource.Id.show_average_hour); Switch lockParams = layout.FindViewById <Switch>(Resource.Id.lock_params); lockParams.CheckedChange += delegate { loginButton.Enabled = areSettingsUnlocked; areSettingsUnlocked = !lockParams.Checked; radiusSB.Enabled = areSettingsUnlocked; switchShowAverage.Enabled = areSettingsUnlocked; switchBoxShowCircle.Enabled = areSettingsUnlocked; maxHourPicker.Enabled = areSettingsUnlocked; maxWeeklyEdit.Enabled = areSettingsUnlocked; }; loginButton.Click += delegate { //SignOrLogInStopwatchUser(true); loginButton.Text = "Change"; }; switchShowAverage.Checked = showAverageHour; switchShowAverage.CheckedChange += delegate { showAverageHour = switchShowAverage.Checked; }; maxWeeklyEdit.Text = maxHourWeekly.ToString(); maxWeeklyEdit.TextChanged += delegate { try { maxHourWeekly = int.Parse(maxWeeklyEdit.Text); } catch (Exception) { return; } }; maxHourPicker.MinValue = 1; maxHourPicker.MaxValue = 8; maxHourPicker.Value = maxHour; maxHourPicker.ValueChanged += delegate { maxHour = maxHourPicker.Value; }; radiusSB.SetProgress(bitmapLength, true); radiusSBValue.Text = radiusSB.Progress.ToString() + "px"; radiusSB.ProgressChanged += delegate { radiusSBValue.Text = radiusSB.Progress.ToString() + "px"; bitmapLength = radiusSB.Progress; secOffset = bitmapLength / 5f; minOffset = bitmapLength / 10f; }; switchBoxShowCircle.TextOff = "Off"; switchBoxShowCircle.TextOn = "On"; switchBoxShowCircle.Checked = showCircle; switchBoxShowCircle.CheckedChange += delegate { showCircle = switchBoxShowCircle.Checked; }; lockParams.Checked = !areSettingsUnlocked; radiusSB.Enabled = areSettingsUnlocked; switchBoxShowCircle.Enabled = areSettingsUnlocked; maxHourPicker.Enabled = areSettingsUnlocked; maxWeeklyEdit.Enabled = areSettingsUnlocked; loginButton.Enabled = false;//areSettingsUnlocked; switchShowAverage.Enabled = areSettingsUnlocked; return(layout); }
private void SkbSeekSongTime_StopTrackingTouch(object sender, SeekBar.StopTrackingTouchEventArgs e) { //When user stop dragging then seek to the position previously saved in ProgressChangedEvent Jukebox.SeekTo(e.SeekBar.Progress); skbSeekSongTime.SetProgress(e.SeekBar.Progress, true); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Second); string a, b, c; modelGelen = JsonConvert.DeserializeObject <Model3D>(Intent.GetStringExtra("3D_Model")); a = modelGelen.Boy.ToString(); b = modelGelen.Karin.ToString(); c = modelGelen.Kilo.ToString(); //Tanımlamış olduğun elemanları initialize etmeyi unutma. txtViewBoy = FindViewById <TextView>(Resource.Id.textView2); txtViewKilo = FindViewById <TextView>(Resource.Id.textView4); txtViewKarin = FindViewById <TextView>(Resource.Id.textView6); txtViewGogus = FindViewById <TextView>(Resource.Id.textView8); txtViewOmuz = FindViewById <TextView>(Resource.Id.textView10); txtViewBoyKontrol = FindViewById <TextView>(Resource.Id.textView12); seekbarBoyTut = FindViewById <SeekBar>(Resource.Id.seekBarBoy); seekbarKarin = FindViewById <SeekBar>(Resource.Id.seekBar2); seekbarKilo = FindViewById <SeekBar>(Resource.Id.seekBar3); seekbarGogus = FindViewById <SeekBar>(Resource.Id.seekBar4); seekbarOmuz = FindViewById <SeekBar>(Resource.Id.seekBar5); veriAnalizButonu = FindViewById <Button>(Resource.Id.btnVeriAnaliz); blogGitButton = FindViewById <Button>(Resource.Id.btnBlogGit); blogGitButton.Click += BlogGitButton_Click; routingPage = FindViewById <Button>(Resource.Id.btnRoutingButton); routingPage.Click += RoutingPage_Click; veriAnalizButonu.Click += VeriAnalizButonu_Click; seekbarBoyTut.Progress = Convert.ToInt16(modelGelen.Boy.ToString()); seekbarBoyTut.Max = 270; seekbarBoyTut.ProgressChanged += SeekbarBoyTut_ProgressChanged; // seekbarControlBoy = FindViewById <SeekBar>(Resource.Id.seekBar6); seekbarControlBoy.Progress = Convert.ToInt16(modelGelen.Boy.ToString()); seekbarControlBoy.SetProgress(Convert.ToInt32(modelGelen.Karin.ToString()), false); seekbarControlBoy.Max = 300; seekbarControlBoy.ProgressChanged += SeekbarControlBoy_ProgressChanged; seekbarKarin.Progress = Convert.ToInt16(modelGelen.Karin.ToString()); //seekbarKarin.SetProgress(Convert.ToInt32(modelGelen.Karin.ToString()), false); seekbarKarin.Max = 100; seekbarKarin.ProgressChanged += SeekbarKarin_ProgressChanged; seekbarKilo.Progress = Convert.ToInt16(modelGelen.Kilo.ToString()); seekbarKilo.Max = 300; seekbarKilo.ProgressChanged += SeekbarKilo_ProgressChanged; seekbarGogus.Progress = Convert.ToInt16(modelGelen.Chest.ToString()); seekbarGogus.Max = 300; seekbarGogus.ProgressChanged += SeekbarGogus_ProgressChanged; seekbarOmuz.Progress = Convert.ToInt16(modelGelen.Omuz.ToString()); seekbarOmuz.Max = 100; seekbarOmuz.ProgressChanged += SeekbarOmuz_ProgressChanged; txtViewBoy.Text = modelGelen.Boy.ToString(); txtViewKarin.Text = modelGelen.Karin.ToString(); txtViewKilo.Text = modelGelen.Kilo.ToString(); txtViewOmuz.Text = modelGelen.Omuz.ToString(); txtViewGogus.Text = modelGelen.Chest.ToString(); txtViewBoyKontrol.Text = modelGelen.Boy.ToString(); }
private void Wallpaperbeingsetted_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e) { //This call is necessary because when this event handler is attached, for some reason is being called //Like if the user had clicked a item. why? idk. //if this method is called before the user has the ReadStorage permission the app will crash. //in that case simply do nothing. if (Checkers.ThisAppHasReadStoragePermission()) { currentSpinnerOptionSelected = (int)e.Id; switch (currentSpinnerOptionSelected) { case WallpaperConfig: if (pickwallpaper.Enabled == false) { pickwallpaper.Enabled = true; } switch (configurationManager.RetrieveAValue(ConfigurationParameters.ChangeWallpaper, "0")) { case "0": wallpaperPreview.SetBackgroundColor(Color.Black); blur.Enabled = false; opacity.Enabled = false; appliesToMusicWidget.Enabled = false; break; case "1": ThreadPool.QueueUserWorkItem(m => { wallpaperManager.ForgetLoadedWallpaper(); Bitmap bitmap = ((BitmapDrawable)wallpaperManager.Drawable).Bitmap; BlurImage blurImage = new BlurImage(Application.Context); blurImage.Load(bitmap).Intensity(defaultBlurLevel); Drawable drawable = new BitmapDrawable(Resources, blurImage.GetImageBlur()); RunOnUiThread(() => { wallpaperPreview.Background = drawable; wallpaperPreview.Background.Alpha = defaultOpacityLevel; } ); }); blur.Enabled = true; blur.SetProgress(defaultBlurLevel, true); opacity.Enabled = true; opacity.SetProgress(defaultOpacityLevel, true); appliesToMusicWidget.Enabled = true; //If the user tries to set the album artwork opacity and blur break; case "2": ThreadPool.QueueUserWorkItem(m => { var imagePath = configurationManager.RetrieveAValue(ConfigurationParameters.ImagePath, ""); using (var backgroundcopy = BitmapFactory.DecodeFile(configurationManager.RetrieveAValue(ConfigurationParameters.ImagePath, imagePath))) { BlurImage blurImage = new BlurImage(Application.Context); blurImage.Load(backgroundcopy).Intensity(defaultBlurLevel); var drawable = new BitmapDrawable(Resources, blurImage.GetImageBlur()); RunOnUiThread(() => { wallpaperPreview.Background = drawable; wallpaperPreview.Background.Alpha = defaultOpacityLevel; }); } }); blur.Enabled = true; blur.SetProgress(defaultBlurLevel, true); opacity.Enabled = true; opacity.SetProgress(defaultOpacityLevel, true); appliesToMusicWidget.Enabled = true; //If the user tries to set the album artwork opacity and blur break; } blur.Progress = defaultBlurLevel; opacity.Progress = defaultOpacityLevel; break; case AlbumArtConfig: pickwallpaper.Enabled = false; appliesToMusicWidget.Enabled = false; blur.Enabled = true; opacity.Enabled = true; if (appliesToMusicWidget.Checked == true) { //If the user tries to set the album artwork opacity and blur //then this checkbox is not anymore valid. blur.Enabled = false; //As well as the Seekbars for blur and opacity, because opacity.Enabled = false; //the Default wallpaper config. also applies to the AlbumArt config. //So the user can't slide the seekbars. } currentSpinnerOptionSelected = (int)e.Id; if (appliesToMusicWidget.Checked == true) { albumArtBlurLevel = defaultBlurLevel; albumArtOpacityLevel = defaultOpacityLevel; } ThreadPool.QueueUserWorkItem(m => { Bitmap bitmap = null; if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) { bitmap = ((BitmapDrawable)Application.Context.GetDrawable(Resource.Drawable.album_artwork)).Bitmap; } else { bitmap = ((BitmapDrawable)Application.Context.Resources.GetDrawable(Resource.Drawable.album_artwork)).Bitmap; } BlurImage blurImage = new BlurImage(Application.Context); blurImage.Load(bitmap).Intensity(albumArtBlurLevel); Drawable drawable = new BitmapDrawable(Resources, blurImage.GetImageBlur()); RunOnUiThread(() => { wallpaperPreview.Background = drawable; wallpaperPreview.Background.Alpha = albumArtOpacityLevel; } ); } ); blur.Progress = albumArtBlurLevel; opacity.Progress = albumArtOpacityLevel; break; } } }
private void InitComponent(View view) { try { IconBack = view.FindViewById <TextView>(Resource.Id.IconBack); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconBack, AppSettings.FlowDirectionRightToLeft ? IonIconsFonts.IosArrowDropright : IonIconsFonts.IosArrowDropleft); IconBack.Click += IconBackOnClick; IconDistance = view.FindViewById <TextView>(Resource.Id.IconDistance); TxtDistanceCount = view.FindViewById <TextView>(Resource.Id.Distancenumber); FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, IconDistance, FontAwesomeIcon.StreetView); DistanceBar = view.FindViewById <SeekBar>(Resource.Id.distanceSeeker); DistanceBar.SetOnSeekBarChangeListener(this); switch (TypeFilter) { case "Market": { DistanceBar.Max = 300; switch (Build.VERSION.SdkInt) { case >= BuildVersionCodes.N: DistanceBar.SetProgress(string.IsNullOrEmpty(UserDetails.MarketDistanceCount) ? 300 : Convert.ToInt32(UserDetails.MarketDistanceCount), true); break; // For API < 24 default: DistanceBar.Progress = string.IsNullOrEmpty(UserDetails.MarketDistanceCount) ? 300 : Convert.ToInt32(UserDetails.MarketDistanceCount); break; } break; } case "NearbyShops": { DistanceBar.Max = 1000; switch (Build.VERSION.SdkInt) { case >= BuildVersionCodes.N: DistanceBar.SetProgress(string.IsNullOrEmpty(UserDetails.NearbyShopsDistanceCount) ? 1000 : Convert.ToInt32(UserDetails.NearbyShopsDistanceCount), true); break; // For API < 24 default: DistanceBar.Progress = string.IsNullOrEmpty(UserDetails.NearbyShopsDistanceCount) ? 1000 : Convert.ToInt32(UserDetails.NearbyShopsDistanceCount); break; } break; } case "NearbyBusiness": { DistanceBar.Max = 1000; switch (Build.VERSION.SdkInt) { case >= BuildVersionCodes.N: DistanceBar.SetProgress(string.IsNullOrEmpty(UserDetails.NearbyBusinessDistanceCount) ? 1000 : Convert.ToInt32(UserDetails.NearbyBusinessDistanceCount), true); break; // For API < 24 default: DistanceBar.Progress = string.IsNullOrEmpty(UserDetails.NearbyBusinessDistanceCount) ? 1000 : Convert.ToInt32(UserDetails.NearbyBusinessDistanceCount); break; } break; } } BtnApply = view.FindViewById <Button>(Resource.Id.ApplyButton); BtnApply.Click += BtnApplyOnClick; } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void InitComponent(View view) { try { IconBack = view.FindViewById <TextView>(Resource.Id.IconBack); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconBack, IonIconsFonts.ChevronLeft); IconBack.Click += IconBackOnClick; IconDistance = view.FindViewById <TextView>(Resource.Id.IconDistance); TxtDistanceCount = view.FindViewById <TextView>(Resource.Id.Distancenumber); FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, IconDistance, FontAwesomeIcon.StreetView); DistanceBar = view.FindViewById <SeekBar>(Resource.Id.distanceSeeker); DistanceBar.SetOnSeekBarChangeListener(this); if (TypeFilter == "Market") { DistanceBar.Max = 300; if (Build.VERSION.SdkInt >= BuildVersionCodes.N) { DistanceBar.SetProgress(string.IsNullOrEmpty(UserDetails.MarketDistanceCount) ? 300 : int.Parse(UserDetails.MarketDistanceCount), true); } else // For API < 24 { DistanceBar.Progress = string.IsNullOrEmpty(UserDetails.MarketDistanceCount) ? 300 : int.Parse(UserDetails.MarketDistanceCount); } } else if (TypeFilter == "NearbyShops") { DistanceBar.Max = 1000; if (Build.VERSION.SdkInt >= BuildVersionCodes.N) { DistanceBar.SetProgress(string.IsNullOrEmpty(UserDetails.NearbyShopsDistanceCount) ? 1000 : int.Parse(UserDetails.NearbyShopsDistanceCount), true); } else // For API < 24 { DistanceBar.Progress = string.IsNullOrEmpty(UserDetails.NearbyShopsDistanceCount) ? 1000 : int.Parse(UserDetails.NearbyShopsDistanceCount); } } else if (TypeFilter == "NearbyBusiness") { DistanceBar.Max = 1000; if (Build.VERSION.SdkInt >= BuildVersionCodes.N) { DistanceBar.SetProgress(string.IsNullOrEmpty(UserDetails.NearbyBusinessDistanceCount) ? 1000 : int.Parse(UserDetails.NearbyBusinessDistanceCount), true); } else // For API < 24 { DistanceBar.Progress = string.IsNullOrEmpty(UserDetails.NearbyBusinessDistanceCount) ? 1000 : int.Parse(UserDetails.NearbyBusinessDistanceCount); } } BtnApply = view.FindViewById <Button>(Resource.Id.ApplyButton); BtnApply.Click += BtnApplyOnClick; } catch (Exception e) { Console.WriteLine(e); } }
protected override void OnCreate(Bundle savedInstance) { base.OnCreate(savedInstance); SetContentView(R.Layout.SettingActivityLayout); ActionBar actionBar = GetActionBar(); // To enable the icon for up navigation (which displays the "up" indicator next to the icon) actionBar.SetDisplayHomeAsUpEnabled(true); gamePreferences = new Preferences(); gamePreferences.RetrievePreferences(GetSharedPreferences("GamePreferences", MODE_MULTI_PROCESS)); txtV = FindViewById <TextView>(R.Id.tableChoosen); txtV1 = FindViewById <TextView>(R.Id.tableChoosenTxt); seekbar = FindViewById <SeekBar>(R.Id.seekbar); seekbar.ProgressChanged += new EventHandler <ProgressChangedEventArgs>(seekbar_ProgressChanged); seekbar.SetProgress(gamePreferences.TableOf); var btn = FindViewById <Button>(R.Id.Ok); btn.Click += new EventHandler(btn_ClickOk); btn = FindViewById <Button>(R.Id.Cancel); btn.Click += new EventHandler(btn_ClickCancel); swV = FindViewById <Switch>(R.Id.isRandom); swV.CheckedChanged += new EventHandler <CheckedChangedEventArgs>(swV_CheckedChanged); swV.SetChecked(!gamePreferences.RandomQuestions); rbtnTo10 = FindViewById <RadioButton>(R.Id.To10); if (gamePreferences.UpperLimit == 10) { rbtnTo10.SetChecked(true); } rbtnTo50 = FindViewById <RadioButton>(R.Id.To50); if (gamePreferences.UpperLimit == 50) { rbtnTo50.SetChecked(true); } rbtnTo100 = FindViewById <RadioButton>(R.Id.To100); if (gamePreferences.UpperLimit == 100) { rbtnTo100.SetChecked(true); } rbtnTo500 = FindViewById <RadioButton>(R.Id.To500); if (gamePreferences.UpperLimit == 500) { rbtnTo500.SetChecked(true); } rbtnTo1000 = FindViewById <RadioButton>(R.Id.To1000); if (gamePreferences.UpperLimit == 1000) { rbtnTo1000.SetChecked(true); } rbtnTo10.CheckedChanged += new EventHandler <CheckedChangedEventArgs>(rbtnTo_CheckedChanged); rbtnTo50.CheckedChanged += new EventHandler <CheckedChangedEventArgs>(rbtnTo_CheckedChanged); rbtnTo100.CheckedChanged += new EventHandler <CheckedChangedEventArgs>(rbtnTo_CheckedChanged); rbtnTo500.CheckedChanged += new EventHandler <CheckedChangedEventArgs>(rbtnTo_CheckedChanged); rbtnTo1000.CheckedChanged += new EventHandler <CheckedChangedEventArgs>(rbtnTo_CheckedChanged); rbtn0To10 = FindViewById <RadioButton>(R.Id.With0To10); if (gamePreferences.CounterMin == 0) { rbtn0To10.SetChecked(true); } rbtn10To20 = FindViewById <RadioButton>(R.Id.With10To20); if (gamePreferences.CounterMin == 10) { rbtn10To20.SetChecked(true); } rbtn20To50 = FindViewById <RadioButton>(R.Id.With20To50); if (gamePreferences.CounterMin == 20) { rbtn20To50.SetChecked(true); } rbtn50To100 = FindViewById <RadioButton>(R.Id.With50To100); if (gamePreferences.CounterMin == 50) { rbtn50To100.SetChecked(true); } EnabledButtons(); }