Search in sources :

Example 1 with MovieDetailDataSource

use of com.shizhefei.test.models.datasource.MovieDetailDataSource in project MVCHelper by LuckyJayce.

the class MovieDetailActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_ultrarecyclerview);
    PtrClassicFrameLayout contentLayout = (PtrClassicFrameLayout) findViewById(R.id.rotate_header_list_view_frame);
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    mvcHelper = new MVCUltraHelper<Data3<Movie, List<Discuss>, List<Movie>>>(contentLayout);
    // 设置数据源
    mvcHelper.setDataSource(new MovieDetailDataSource());
    // 设置适配器
    mvcHelper.setAdapter(new MovieDetailAdapter(this));
    // 加载数据
    mvcHelper.refresh();
}
Also used : Movie(com.shizhefei.test.models.enties.Movie) PtrClassicFrameLayout(in.srain.cube.views.ptr.PtrClassicFrameLayout) Data3(com.shizhefei.mvc.data.Data3) Discuss(com.shizhefei.test.models.enties.Discuss) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) MovieDetailAdapter(com.shizhefei.test.view.adapters.MovieDetailAdapter) MovieDetailDataSource(com.shizhefei.test.models.datasource.MovieDetailDataSource)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 Data3 (com.shizhefei.mvc.data.Data3)1 MovieDetailDataSource (com.shizhefei.test.models.datasource.MovieDetailDataSource)1 Discuss (com.shizhefei.test.models.enties.Discuss)1 Movie (com.shizhefei.test.models.enties.Movie)1 MovieDetailAdapter (com.shizhefei.test.view.adapters.MovieDetailAdapter)1 PtrClassicFrameLayout (in.srain.cube.views.ptr.PtrClassicFrameLayout)1