private void initUI(View view) { mProgressBar = view.findViewById(R.id.progressBar); mEditText = ((EditText) view.findViewById(R.id.locationQuery)); mLocation = (TextView) view.findViewById(R.id.tv_location); mTemperature = (TextView) view.findViewById(R.id.tv_temperature); mWeatherIcon = (ImageView) view.findViewById(R.id.im_weather); RecyclerView mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler); mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); mAdapter = ForecastAdapter.createForecastAdapter(new WeatherForecastModel()); mRecyclerView.setAdapter(mAdapter); }
@Override public void updateForecastView(WeatherForecastModel forecastModel) { Log.d(TAG, "updateForecastView: " + forecastModel); mAdapter.update(forecastModel); }