Search in sources :

Example 6 with PtrClassicFrameLayout

use of in.srain.cube.views.ptr.PtrClassicFrameLayout in project MVCHelper by LuckyJayce.

the class BookDetailActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_bookdetail);
    nameTextView = (TextView) findViewById(R.id.name_textView);
    authorTextView = (TextView) findViewById(R.id.author_textView);
    descriptionTextView = (TextView) findViewById(R.id.description_textView);
    contentTextView = (TextView) findViewById(R.id.content_textView);
    PtrClassicFrameLayout contentLayout = (PtrClassicFrameLayout) findViewById(R.id.rotate_header_list_view_frame);
    mvcHelper = new MVCUltraHelper<Book>(contentLayout);
    // 设置数据源
    mvcHelper.setDataSource(new BookDetailDataSource());
    // 设置适配器
    mvcHelper.setAdapter(dataAdapter);
    // 加载数据
    mvcHelper.refresh();
}
Also used : PtrClassicFrameLayout(in.srain.cube.views.ptr.PtrClassicFrameLayout) Book(com.shizhefei.test.models.enties.Book) BookDetailDataSource(com.shizhefei.test.models.datasource.BookDetailDataSource)

Example 7 with PtrClassicFrameLayout

use of in.srain.cube.views.ptr.PtrClassicFrameLayout 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

PtrClassicFrameLayout (in.srain.cube.views.ptr.PtrClassicFrameLayout)7 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)3 RecyclerView (android.support.v7.widget.RecyclerView)3 PtrFrameLayout (in.srain.cube.views.ptr.PtrFrameLayout)3 View (android.view.View)2 BooksDataSource (com.shizhefei.test.models.datasource.BooksDataSource)2 Data3 (com.shizhefei.mvc.data.Data3)1 Code (com.shizhefei.task.Code)1 MemoryCacheStore (com.shizhefei.task.imp.MemoryCacheStore)1 BookDetailDataSource (com.shizhefei.test.models.datasource.BookDetailDataSource)1 MovieDetailDataSource (com.shizhefei.test.models.datasource.MovieDetailDataSource)1 MoviesDataSource (com.shizhefei.test.models.datasource.MoviesDataSource)1 Book (com.shizhefei.test.models.enties.Book)1 Discuss (com.shizhefei.test.models.enties.Discuss)1 Movie (com.shizhefei.test.models.enties.Movie)1 MovieAmount (com.shizhefei.test.models.enties.MovieAmount)1 BooksAdapter (com.shizhefei.test.view.adapters.BooksAdapter)1 MovieDetailAdapter (com.shizhefei.test.view.adapters.MovieDetailAdapter)1 MoviesAdapter (com.shizhefei.test.view.adapters.MoviesAdapter)1 ReBooksAdapter (com.shizhefei.test.view.adapters.ReBooksAdapter)1