Search in sources :

Example 1 with MyRecyclerViewAdapter

use of com.test.banner.adapter.MyRecyclerViewAdapter in project banner by youth5201314.

the class RecyclerViewBannerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recyclerview_banner);
    ButterKnife.bind(this);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(new MyRecyclerViewAdapter(this));
}
Also used : LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) MyRecyclerViewAdapter(com.test.banner.adapter.MyRecyclerViewAdapter)

Example 2 with MyRecyclerViewAdapter

use of com.test.banner.adapter.MyRecyclerViewAdapter in project banner by youth5201314.

the class BannerListFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    text.setText("当前页:" + index);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setAdapter(new MyRecyclerViewAdapter(getActivity()));
}
Also used : LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) MyRecyclerViewAdapter(com.test.banner.adapter.MyRecyclerViewAdapter)

Aggregations

LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)2 MyRecyclerViewAdapter (com.test.banner.adapter.MyRecyclerViewAdapter)2