/// <summary> /// Fills data from data model into the view /// </summary> /// <param name="vh">Row view</param> /// <param name="cardModel">Model data for row</param> public void UpdateCardContents(MyViewholder vh, ForecastCard cardModel) { vh.dateLabel.Text = cardModel.DateFormated; vh.locationLabel.Text = cardModel.Location; vh.summaryLabel.Text = cardModel.Summary + "|" + cardModel.Temperature; vh.humidityLabel.Text = cardModel.Humidity; vh.windSpeedLabel.Text = cardModel.WindSpeed; vh.windDirectionLabel.Text = cardModel.WindDirection; vh.tidalLabel.Text = cardModel.WaterLevel; vh.SetIcon(vh.forecastIcon, cardModel.Icon); }
/// <summary> /// Add and show new row for recycler view /// </summary> /// <param name="data">Data row to add</param> public void AddRow(ForecastCard data) { displayData.Add(data); NotifyItemInserted(ItemCount - 1); }
/// <summary> /// Converts ForecastCard model to JSON model /// </summary> /// <param name="user_email">User email</param> /// <param name="f">Forecast card model instance</param> /// <returns>Newton model</returns> public static Newton.ForecastCardNewton ForecastCard_To_ForecastCardNewton(string user_email, ForecastCard f) { Newton.ForecastCardNewton result = new Newton.ForecastCardNewton(); result.user_email = user_email; result.forecast_date = f.DateFormated; result.icon = f.Icon; result.forecast_location = f.Location; result.temperature = f.Temperature; result.summary = f.Summary; result.humidity = f.Humidity; result.wind_speed = f.WindSpeed; result.wind_direction = f.WindDirection; result.water_level = f.WaterLevel; return(result); }