Search in sources :

Example 1 with WeatherAdapter

use of com.xiecc.seeWeather.modules.main.adapter.WeatherAdapter in project SeeWeather by xcc3641.

the class MainFragment method initView.

private void initView() {
    if (mRefreshLayout != null) {
        mRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light);
        mRefreshLayout.setOnRefreshListener(() -> mRefreshLayout.postDelayed(this::load, 1000));
    }
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    mAdapter = new WeatherAdapter(mWeather);
    mRecyclerView.setAdapter(mAdapter);
}
Also used : WeatherAdapter(com.xiecc.seeWeather.modules.main.adapter.WeatherAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 2 with WeatherAdapter

use of com.xiecc.seeWeather.modules.main.adapter.WeatherAdapter in project SeeWeather by xcc3641.

the class DetailCityActivity method initViewWithData.

private void initViewWithData() {
    Intent intent = getIntent();
    Weather weather = (Weather) intent.getSerializableExtra(IntentKey.WEATHER);
    if (weather == null) {
        finish();
    }
    safeSetTitle(weather.basic.city);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    WeatherAdapter mAdapter = new WeatherAdapter(weather);
    mRecyclerView.setAdapter(mAdapter);
}
Also used : Weather(com.xiecc.seeWeather.modules.main.domain.Weather) WeatherAdapter(com.xiecc.seeWeather.modules.main.adapter.WeatherAdapter) Intent(android.content.Intent) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 WeatherAdapter (com.xiecc.seeWeather.modules.main.adapter.WeatherAdapter)2 Intent (android.content.Intent)1 Weather (com.xiecc.seeWeather.modules.main.domain.Weather)1