private void updateDisplay() { CurrentEvent currentEvent = mUnifier.getCurrentEvent(); mTheme.setText(currentEvent.getTheme()); mStartTimeValue.setText(currentEvent.getStartTime() + " HRS"); mEndTimeValue.setText(currentEvent.getEndTime() + " HRS"); mDateValue.setText("On " + currentEvent.getDate()); mVenueValue.setText("At " + currentEvent.getVenue()); mAddressValue.setText(currentEvent.getAddress()); mDescriptionValue.setText(currentEvent.getDescription()); // Drawable drawable = getResources().getDrawable(mCurrentWeather.getIconId()); // mIconImageView.setImageDrawable(drawable); }
private CurrentEvent getCurrentDetails(String jsonData) throws JSONException { JSONObject collection = new JSONObject(jsonData); // String timezone = collection.getString("timezone"); // Log.i(TAG, "From JSON: " + timezone); JSONObject currently = collection.getJSONObject("currently"); CurrentEvent currentEvent = new CurrentEvent(); currentEvent.setTheme(currently.getString("theme")); currentEvent.setDescription(currently.getString("description")); currentEvent.setStartTime(currently.getString("starttime")); currentEvent.setEndTime(currently.getString("endtime")); currentEvent.setVenue(currently.getString("venue")); currentEvent.setAddress(currently.getString("address")); currentEvent.setDate(currently.getString("date")); currentEvent.setIconId(currently.getString("icon")); // Log.d(TAG, currentEvent.getFormattedTime()); return currentEvent; }