private void OnCheckedChangeRadioGroup(object sender, RadioGroup.CheckedChangeEventArgs e) { //If you do not need to simulate a location, set mode to false. Otherwise, other applications cannot use the positioning function of Huawei location service. RadioButton radioButton = radioGroup.FindViewById <RadioButton>(e.CheckedId); if (radioButton.Text == "True") { mockFlag = true; } else { mockFlag = false; } }
protected int getSelectedElement(RadioGroup aRadioGroup) { int radioButtonID = aRadioGroup.CheckedRadioButtonId; View radioButton = aRadioGroup.FindViewById(radioButtonID); if (radioButton != null) { return((int)radioButton.Tag); } else { return(0); }; }
public void OnClick(View v) { //string folder = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath; var dataPath = System.Environment.SpecialFolder.ApplicationData; string path = Path.Combine(System.Environment.GetFolderPath(dataPath).Split("files")[0] + @"files", FileName); //File.Create(path + "newFile.png"); //File.Delete(path); if (!File.Exists(path)) { File.Create(path); } switch (v.Id) { case Resource.Id.btn_view: StringBuilder stringBuilder = new StringBuilder(); List <string> storage = File.ReadAllLines(path).ToList(); foreach (var item in storage) { string[] temp = item.Split(';'); stringBuilder.Append($"{temp[0]} ({temp[1]})\n"); } DependFragment showFragment = DependFragment.newInstance(stringBuilder.ToString()); FragmentTransaction transaction = this.FragmentManager.BeginTransaction(); transaction.Replace(Resource.Id.container, showFragment); etQuestion.Text = ""; transaction.AddToBackStack(null); transaction.Commit(); break; case Resource.Id.btn_continue: int selectedIdColor = radioGroupColor.CheckedRadioButtonId; int selectedIdPrice = radioGroupPrice.CheckedRadioButtonId; RadioButton radioButtonColor = radioGroupColor.FindViewById <RadioButton>(selectedIdColor); RadioButton radioButtonPrice = radioGroupPrice.FindViewById <RadioButton>(selectedIdPrice); string text = radioButtonColor.Text + " flower, which costs " + radioButtonPrice.Text; string question = etQuestion.Text.ToString(); File.AppendAllText(path, $"{question};{text};\n"); etQuestion.Text = ""; //etQuestion.ClearFocus(); Toast.MakeText(v.Context, "Message saved successfully!", ToastLength.Long).Show(); break; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Tab); _index = 0; PrepareChildFragment(); _radioGroup = this.FindViewById <RadioGroup> (Resource.Id.TabItemSelect); _radioGroup.CheckedChange += (sender, e) => { var radioButton = _radioGroup.FindViewById(e.CheckedId); _index = _radioGroup.IndexOfChild(radioButton); ShowFragmentOfIndex(_index); }; ShowFragmentOfIndex(_index); }
public void OnClick(View v) { switch (v.Id) { case Resource.Id.btn_continue: int selectedId = radioGroup.CheckedRadioButtonId; RadioButton radioButton = radioGroup.FindViewById <RadioButton>(selectedId); string text = radioButton.Text; ShowFragment showFragment = ShowFragment.newInstance($"{etQuestion.Text.ToString()} ({text})"); FragmentTransaction transaction = this.FragmentManager.BeginTransaction(); transaction.Replace(Resource.Id.container, showFragment); etQuestion.Text = ""; transaction.AddToBackStack(null); transaction.Commit(); break; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); for (int i = 0; i < Game.PlayersCount; i++) { if (Application.GameScoreSubmitScoreData[i].OwnedCharacterTheWiseMan) { ChosePlayerNumber = i + 1; break; } } FindViewById <TextView>(Resource.Id.playerName).Text = Game.GetPlayer(ChosePlayerNumber).Name; Dictionary <BuildingType, RadioButton> radioButtons = new Dictionary <BuildingType, RadioButton>() { [BuildingType.Pavilion] = FindViewById <RadioButton>(Resource.Id.buttonPavilion), [BuildingType.Seraglio] = FindViewById <RadioButton>(Resource.Id.buttonSeraglio), [BuildingType.Arcades] = FindViewById <RadioButton>(Resource.Id.buttonArcades), [BuildingType.Chambers] = FindViewById <RadioButton>(Resource.Id.buttonChambers), [BuildingType.Garden] = FindViewById <RadioButton>(Resource.Id.buttonGarden), [BuildingType.Tower] = FindViewById <RadioButton>(Resource.Id.buttonTower), }; foreach (KeyValuePair <BuildingType, RadioButton> radioButtonPair in radioButtons) { StringBuilder radioButtonText = new StringBuilder(); SetTheWiseManBuildingType(null); int pointsNotUsingBonus = 0; Dictionary <int, int> opponentsPoints = new Dictionary <int, int>(); for (int i = 0; i < Game.PlayersCount; i++) { int points = Game.GetBuildingScore(Application.GameScoreSubmitScoreData, radioButtonPair.Key, i + 1); if (i == ChosePlayerNumber - 1) { pointsNotUsingBonus = points; } else { opponentsPoints[i] = points; } } SetTheWiseManBuildingType(radioButtonPair.Key); int pointsUsingBonus = 0; for (int i = 0; i < Game.PlayersCount; i++) { int points = Game.GetBuildingScore(Application.GameScoreSubmitScoreData, radioButtonPair.Key, i + 1); if (i == ChosePlayerNumber - 1) { pointsUsingBonus = points; } else { int opponentPoints = opponentsPoints[i]; opponentsPoints[i] = opponentPoints - points; } } SetTheWiseManBuildingType(null); radioButtonText.Append($"{radioButtonPair.Key.GetEnumDescription(Resources)} (+{pointsUsingBonus - pointsNotUsingBonus})"); for (int i = 0; i < Game.PlayersCount; i++) { if (i != ChosePlayerNumber - 1) { if (opponentsPoints[i] != 0) { radioButtonText.Append($" ({Game.GetPlayer(i + 1).Name}: -{opponentsPoints[i]})"); } } } radioButtonPair.Value.Text = radioButtonText.ToString(); if (radioButtonPair.Value.CurrentTextColor == -658699) { radioButtonPair.Value.SetShadowLayer(1, 1, 1, Android.Graphics.Color.Black); } } Button confirmButton = FindViewById <Button>(Resource.Id.confirmButton); confirmButton.Click += new EventHandler((object sender, EventArgs e) => { RadioGroup radioButtonGroup = FindViewById <RadioGroup>(Resource.Id.buttonGroup); int radioButtonID = radioButtonGroup.CheckedRadioButtonId; if (radioButtonID != -1) { BuildingType buildingType; RadioButton radioButton = radioButtonGroup.FindViewById <RadioButton>(radioButtonID); switch (radioButtonGroup.IndexOfChild(radioButton)) { case 0: buildingType = BuildingType.Pavilion; break; case 1: buildingType = BuildingType.Seraglio; break; case 2: buildingType = BuildingType.Arcades; break; case 3: buildingType = BuildingType.Chambers; break; case 4: buildingType = BuildingType.Garden; break; case 5: buildingType = BuildingType.Tower; break; default: throw new NotSupportedException(); } Application.ConfirmTheWiseManChose(this, buildingType); } }); }
protected override void OnResume() { base.OnResume(); Console.WriteLine("Resume"); // Find selected data _show = TwitApi.Instance.Shows.FirstOrDefault(s => s.Selected == true); if (_show == null) { Android.Widget.Toast.MakeText(this, "Error finding show", Android.Widget.ToastLength.Short).Show(); Intent i = new Intent(this.ApplicationContext, typeof(MainActivity)); StartActivity(i); return; } _episode = _show.Episodes.FirstOrDefault(e => e.Selected == true); if (_episode == null) { Android.Widget.Toast.MakeText(this, "Error finding episode", Android.Widget.ToastLength.Short).Show(); Intent i = new Intent(this.ApplicationContext, typeof(MainActivity)); StartActivity(i); return; } // Setup UI elements Window.SetTitle(_show.Show.Label + " - " + _episode.Episode.Label); TextView titleTextView = FindViewById <TextView>(Resource.Id.txtvwEpisodeTitle); TextView descriptionTextView = FindViewById <TextView>(Resource.Id.txtvwEpisodeDescription); TextView episodeLengthTextView = FindViewById <TextView>(Resource.Id.txtvwEpisodeLength); titleTextView.Text = _episode.Episode.EpisodeNumber + " - " + _episode.Episode.Label; descriptionTextView.Text = _episode.Episode.Teaser; episodeLengthTextView.Text = _episode.Episode.AudioDetails.RunningTime.ToString() + " - " + _episode.Episode.AiringDate.ToLocalTime().ToString("M/d/yyyy"); _mediaTypeList = FindViewById <RadioGroup>(Resource.Id.mediaTypeList); _mediaTypeList.RemoveAllViews(); RadioButton audioButton = new RadioButton(this.ApplicationContext); RadioButton smallVideoButton = new RadioButton(this.ApplicationContext); RadioButton largeVideoButton = new RadioButton(this.ApplicationContext); RadioButton hdVideoButton = new RadioButton(this.ApplicationContext); audioButton.Text = "Audio"; audioButton.SetPadding(5, 5, 0, 20); smallVideoButton.Text = "Small Video"; smallVideoButton.SetPadding(5, 5, 0, 20); largeVideoButton.Text = "Large Video"; largeVideoButton.SetPadding(5, 5, 0, 20); hdVideoButton.Text = "HD Video"; hdVideoButton.SetPadding(5, 5, 0, 20); _mediaTypeList.AddView(audioButton); _mediaTypeList.AddView(smallVideoButton); _mediaTypeList.AddView(largeVideoButton); _mediaTypeList.AddView(hdVideoButton); // Setup button delegates Button play = FindViewById <Button>(Resource.Id.btnPlayEpisode); play.Click += delegate { // If an episode is already playing in a background, check to make sure the episode we clicked on is different, if it is, stop // the current episode, saving its position, and start playing the new episode. if (PlayingService.ServiceInstance != null) { if (PlayingService.ServiceInstance.Player != null) { if (PlayingService.ServiceInstance.Player.IsPlaying || PlayingService.ServiceInstance.Paused) { if (PlayingService.ServiceInstance.ShowId == _show.Show.Id) { if (PlayingService.ServiceInstance.EpisodeId != _episode.Episode.Id) { PlayingService.ServiceInstance.Stop(); } } else // Show id is not equal, stop because it has to be a different episode even if episode id matches { PlayingService.ServiceInstance.Stop(); } } } } // Start playing episode int radioButtonID = _mediaTypeList.CheckedRadioButtonId; View radioButton = _mediaTypeList.FindViewById(radioButtonID); string videoUrl = ""; int idx = _mediaTypeList.IndexOfChild(radioButton); Type activityToStart = typeof(PlayBackActivity); if (idx > 0) { activityToStart = typeof(VideoViewerActivity); if (idx == 1) { videoUrl = _episode.Episode.SmallVideoDetails.MediaUrl; } else if (idx == 2) { videoUrl = _episode.Episode.LargeVideoDetails.MediaUrl; } else if (idx == 3) { videoUrl = _episode.Episode.HdVideoDetails.MediaUrl; } } Intent i = new Intent(this.ApplicationContext, activityToStart); if (videoUrl != "") { i.PutExtra("VideoUrl", videoUrl); } StartActivity(i); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.RideInformatioin); //pickup location m_txtPickupLocation = (TextView)FindViewById(Resource.Id.txtPickupLocation); m_txtPickupLocation.Touch += PopupPickupLocation; m_txtPickupLocation.SetBinding( () => Facade.Instance.CurrentRide.PickUpLocation, () => m_txtPickupLocation.Text, BindingMode.TwoWay) .UpdateSourceTrigger("DropOffLocationChanges"); //dropoff location m_txtDropoffLocation = (TextView)FindViewById(Resource.Id.txtDropoffLocation); m_txtDropoffLocation.Touch += PopupDropoffLocation; m_txtDropoffLocation.SetBinding( () => Facade.Instance.CurrentRide.DropOffLocation, () => m_txtDropoffLocation.Text, BindingMode.TwoWay) .UpdateSourceTrigger("DropOffLocationChanges"); //passengers or hours m_switchPH = (Switch)FindViewById(Resource.Id.switchPorH); m_switchPH.CheckedChange += delegate(object sender, CompoundButton.CheckedChangeEventArgs e) { Facade.Instance.CurrentRide.ReservationType = e.IsChecked; m_spinnerHours.Enabled = e.IsChecked; GetFares(); }; //number of passengers/hours m_spinnerPassengers = (Spinner)FindViewById(Resource.Id.spPassengers); m_spinnerHours = (Spinner)FindViewById(Resource.Id.spHours); var adapter = new ArrayAdapter(this, global::Android.Resource.Layout.SimpleSpinnerItem); m_spinnerPassengers.Adapter = adapter; m_spinnerHours.Adapter = adapter; for (var i = 1; i <= 100; i++) { adapter.Add(i); } m_spinnerPassengers.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(OnPassengerChanged); m_spinnerHours.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(OnHourChanged); //upto of vehicle m_rgUpto = (RadioGroup)FindViewById(Resource.Id.rgUpto); m_rgUpto.CheckedChange += (s, e) => { var indexView = m_rgUpto.FindViewById(e.CheckedId); var selectedIndex = m_rgUpto.IndexOfChild(indexView); m_selectedRideTypeValue = selectedIndex; SetFare(); }; //type of vehicle m_rgVehicle = (RadioGroup)FindViewById(Resource.Id.rgVehicle); m_rgVehicle.CheckedChange += (s, e) => { var indexView = m_rgVehicle.FindViewById(e.CheckedId); var selectedIndex = m_rgVehicle.IndexOfChild(indexView); SetRideType(selectedIndex); }; m_txtComment = (TextView)FindViewById(Resource.Id.txtComment); m_txtComment.Text = "Complete all fields above"; var btnGotoLocation = (Button)FindViewById(Resource.Id.btn_GoToLocation); btnGotoLocation.SetCommand("Click", Facade.Instance.CurrentRide.GoToTheFlightInformation); var btnBack = (ImageButton)FindViewById(Resource.Id.btn_back); btnBack.Click += delegate(object sender, EventArgs e) { OnBack(); }; if (IsFirstTime) { IsFirstTime = false; SetBindingsOnce(); } GetFares(); }
public async void AddSummonToSummonSession() { if (summonSession != null) { Summon summon = new Summon(); //SessionID summon.SummonSessionID = summonSession.ID; //Scroll Type #region scrollType //I used this method instead of just getting the index and assigning //that because I thought this was a lot more clear. But it is a lot more //effort. Also, if I ever added another option above other, that //wouldn't work. int scrollRadioButtonID = scrollTypeRadioGroup.CheckedRadioButtonId; if (mysticScrollRadioButton.Checked) { summon.SummonTypeID = 1; } else if (summoningStonesRadioButton.Checked) { summon.SummonTypeID = 2; } else if (lightDarkScrollRadioButton.Checked) { summon.SummonTypeID = 3; } else if (lengendaryScrollRadioButton.Checked) { summon.SummonTypeID = 4; } //Other else { summon.SummonTypeID = 5; } #endregion //Star Number #region starNumber //Unlike above, this is immutable, so I thought an index approach //was acceptable int starRadioButtonID = starNumberRadioGroup.CheckedRadioButtonId; View selectedStarRadioButton = starNumberRadioGroup.FindViewById(starRadioButtonID); summon.Stars = starNumberRadioGroup.IndexOfChild(selectedStarRadioButton); #endregion //Name if (!String.IsNullOrEmpty(monsterNameEditText.Text)) { summon.Name = monsterNameEditText.Text; } else { summon.Name = ""; } //Insert await db.insertUpdateData <Summon>(summon, this.GetDatabasePath("Summons.db").AbsolutePath); //Calculate Summon Rates calculateRates(); } else { if (summonSessionID != null) { getSummonSessionFromDB(); AddSummonToSummonSession(); } else { SummonSession newSummonSession = new SummonSession(); newSummonSession.Date = DateTime.Now; await db.insertUpdateData(newSummonSession, this.GetDatabasePath("Summons.db").AbsolutePath); summonSession = newSummonSession; AddSummonToSummonSession(); } } }
/// <summary> /// Get the index of the selected RadioButton in a RadioGroup /// </summary> /// <param name="group"></param> /// <returns></returns> private int GetIndexOfSelectedChild(RadioGroup group) => group.IndexOfChild(group.FindViewById <RadioButton>(group.CheckedRadioButtonId));
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { TaskViewHolder vh; Type thisType = holder.GetType(); OnBind = true; if (Curator) { if (position == 0) { return; } } if (position == 0 || (Curator && position == 1)) { // Activity description + entered names (if required) vh = holder as TaskViewHolderName; if (vh == null) { return; } vh.Title.Text = description; vh.Description.Text = context.Resources.GetString(Resource.String.TasksTitle); ((TaskViewHolderName)vh).NameSection.Visibility = (reqName) ? ViewStates.Visible : ViewStates.Gone; ((TaskViewHolderName)vh).EnteredNames.Text = names; return; } if (position == Items.Count - 1) { // Finish button if (holder is ButtonViewHolder bvh) { bvh.Button.Enabled = true; } return; } string taskType = Items[position].TaskType.IdName; if (thisType == typeof(TaskViewHolderInfo)) { AdditionalInfoData taskInfo = JsonConvert.DeserializeObject <AdditionalInfoData>(Items[position].JsonData); vh = holder as TaskViewHolderInfo; Items[position].IsCompleted = true; if (!string.IsNullOrWhiteSpace(taskInfo.ImageUrl)) { Items[position].ImageUrl = taskInfo.ImageUrl; } TaskViewHolderInfo taskViewHolderInfo = (TaskViewHolderInfo)vh; if (taskViewHolderInfo != null) { taskViewHolderInfo.Button.Visibility = (string.IsNullOrWhiteSpace(taskInfo.ExternalUrl)) ? ViewStates.Gone : ViewStates.Visible; } } else if (thisType == typeof(TaskViewHolderRecordAudio)) { vh = holder as TaskViewHolderRecordAudio; if (vh != null) { ((TaskViewHolderRecordAudio)vh).StartTaskButton.Text = context.Resources.GetString(Resource.String.StartBtn); if (!string.IsNullOrWhiteSpace(Items[position].CompletionData.JsonData)) { List <string> audioPaths = JsonConvert.DeserializeObject <List <string> >(Items[position].CompletionData.JsonData); ((TaskViewHolderRecordAudio)vh).ShowResults(audioPaths, context); Items[position].IsCompleted = true; } else { Items[position].IsCompleted = false; ((TaskViewHolderRecordAudio)vh).ClearResults(); } } } else if (thisType == typeof(TaskViewHolderRecordVideo)) { vh = holder as TaskViewHolderRecordVideo; if (vh != null) { ((TaskViewHolderRecordVideo)vh).StartTaskButton.Text = context.Resources.GetString(Resource.String.RecBtn); if (!string.IsNullOrWhiteSpace(Items[position].CompletionData.JsonData)) { List <string> videoPaths = JsonConvert.DeserializeObject <List <string> >(Items[position].CompletionData.JsonData); ((TaskViewHolderRecordVideo)vh).ShowResults(videoPaths, context); Items[position].IsCompleted = true; } else { Items[position].IsCompleted = false; ((TaskViewHolderRecordVideo)vh).ClearResults(); } } } else if (thisType == typeof(TaskViewHolderResultList)) { vh = holder as TaskViewHolderResultList; bool btnEnabled = true; string btnText; if (taskType == "DRAW" || taskType == "DRAW_PHOTO") { btnText = context.Resources.GetString(Resource.String.StartDrawBtn); if (taskType == "DRAW_PHOTO") { btnEnabled = !int.TryParse(Items[position].JsonData, out var idResult) || GetTaskWithId(idResult).IsCompleted; if (!btnEnabled) { btnText = context.Resources.GetString(Resource.String.TaskBtnNotReady); } } } else { btnText = context.Resources.GetString(Resource.String.TakePhotoBtn); } if (vh != null) { ((TaskViewHolderResultList)vh).StartTaskButton.Text = btnText; ((TaskViewHolderResultList)vh).StartTaskButton.Enabled = btnEnabled; if (!string.IsNullOrWhiteSpace(Items[position].CompletionData.JsonData)) { List <string> photoPaths = JsonConvert.DeserializeObject <List <string> >(Items[position].CompletionData.JsonData); ((TaskViewHolderResultList)vh).ShowResults(photoPaths, context); Items[position].IsCompleted = true; } else { Items[position].IsCompleted = false; ((TaskViewHolderResultList)vh).ClearResults(); } } } else if (thisType == typeof(TaskViewHolderBtn)) { vh = holder as TaskViewHolderBtn; string btnText = context.Resources.GetString(Resource.String.TaskBtn); if (taskType == "LISTEN_AUDIO") { btnText = context.Resources.GetString(Resource.String.ListenBtn); } TaskViewHolderBtn viewHolderBtn = (TaskViewHolderBtn)vh; if (viewHolderBtn != null) { viewHolderBtn.Button.Text = btnText; } } else if (thisType == typeof(TaskViewHolderTextEntry)) { vh = holder as TaskViewHolderTextEntry; if (vh != null) { ((TaskViewHolderTextEntry)vh).TextField.Text = Items[position].CompletionData.JsonData; Items[position].IsCompleted = !string.IsNullOrWhiteSpace(((TaskViewHolderTextEntry)vh).TextField.Text); } } else { if (thisType == typeof(TaskViewHolderMultipleChoice)) { vh = holder as TaskViewHolderMultipleChoice; RadioGroup radios = ((TaskViewHolderMultipleChoice)vh)?.RadioGroup; string[] choices = JsonConvert.DeserializeObject <string[]>(Items[position].JsonData); int.TryParse(Items[position].CompletionData.JsonData, out var answeredInd); if (radios != null && radios.ChildCount == 0) { int index = 0; foreach (string option in choices) { RadioButton rad = new RadioButton(context) { Text = option }; rad.SetPadding(0, 0, 0, 5); rad.TextSize = 16; radios.AddView(rad); if (Items[position].IsCompleted && answeredInd == index) { ((RadioButton)radios.GetChildAt(answeredInd)).Checked = true; } index++; } } if (answeredInd == -1) { Items[position].IsCompleted = false; } if (radios != null) { radios.CheckedChange += (sender, e) => { Items[position].IsCompleted = true; int radioButtonId = radios.CheckedRadioButtonId; View radioButton = radios.FindViewById(radioButtonId); int idx = radios.IndexOfChild(radioButton); Items[position].CompletionData.JsonData = idx.ToString(); NotifyItemChanged(Items.Count - 1); }; } } else if (thisType == typeof(TaskViewHolderMap)) { vh = holder as TaskViewHolderMap; TaskViewHolderMap mapHolder = ((TaskViewHolderMap)vh); if (taskType == "MAP_MARK") { List <Map_Location> points = JsonConvert.DeserializeObject <List <Map_Location> >(Items[position].CompletionData.JsonData); if (points != null && points.Count > 0) { if (mapHolder != null) { mapHolder.EnteredLocationsView.Visibility = ViewStates.Visible; mapHolder.EnteredLocationsView.Text = string.Format( context.Resources.GetString(Resource.String.ChosenLocations), points.Count, (points.Count > 1) ? "s" : ""); } Items[position].IsCompleted = true; } else { if (mapHolder != null) { mapHolder.EnteredLocationsView.Visibility = ViewStates.Gone; } Items[position].IsCompleted = false; } } } else { vh = holder as TaskViewHolder; } } // These apply to all task types: AndroidUtils.LoadTaskTypeIcon(Items[position].TaskType, ((TaskViewHolder)holder).TaskTypeIcon); if (!string.IsNullOrWhiteSpace(Items[position].ImageUrl)) { AndroidUtils.LoadActivityImageIntoView(vh.TaskImage, Items[position].ImageUrl, activityId, 350); } else { if (vh != null) { vh.TaskImage.Visibility = ViewStates.Gone; } } vh.Description.Text = Items[position].Description; vh.Title.Text = Items[position].TaskType.DisplayName; bool hasChildren = Items[position].ChildTasks != null && Items[position].ChildTasks.Any(); if (Items[position].TaskType.IdName == "ENTER_TEXT") { vh.LockedChildrenTease.Visibility = ViewStates.Gone; } else if (hasChildren && !Items[position].IsCompleted) { vh.LockedChildrenTease.Visibility = ViewStates.Visible; int childCount = Items[position].ChildTasks.Count(); vh.LockedChildrenTease.Text = string.Format( context.GetString(Resource.String.taskLockedParent), childCount, (childCount > 1) ? "s" : ""); } else if (hasChildren && Items[position].IsCompleted) { vh.LockedChildrenTease.Visibility = ViewStates.Visible; vh.LockedChildrenTease.Text = context.GetString(Resource.String.taskUnlockedParent); } else { vh.LockedChildrenTease.Visibility = ViewStates.Gone; } OnBind = false; }