A blog to understand the use of Recyclerview

Starting from Android 5.0, Google launched the RecylerView control. When seeing the new control RecylerView, most people will first ask, what is recylerview? Why is there recylerview? That is to say, what are the advantages of recylerview? How to use recylerview? Wait, we will analyze recylerview in depth below. 1.What is RecyclerView? RecyclerView is a […]

RecycleView long press drag control ItemTouchHelper.Callback

1.Adapter Inherit RecycleView.Adapter In fact, it is not difficult to implement long-press and drag controls in RecycleView. Just rewrite ItemTouchHelper.Callback. ItemTouchHelper is a tool class that implements RecyclerView‘s side-sliding deletion and drag-and-drop movement. The following code is the ordinary RecycleView.Adapter implementation process except ItemTouchHelper.Callback. public class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.Holder>{ private Context context; private ItemTouchHelper itemTouchHelper; […]

[Production problem record] Troubleshooting a large number of exceptions in an interface (large objects are strongly referenced and cannot be recycled, resulting in GC all the time)

1 Conclusion Let’s talk about the conclusion first: There is a method to query data from the database in batches, then put it into an ArrayList, and finally use the ArrayList with the full amount of data to perform other operations. In this accident, during the batch query process, a large amount of data was […]

Android—RecyclerView replaces ListView

RecyclerView, referred to as RV, appears as an enhanced version of ListView and GridView, with the purpose of displaying a large amount of content on a limited screen. Therefore, the implementation of RecyclerView’s reuse mechanism is a core part of it. General RV usage // 1 RecyclerView.setLayoutManager(); // 2 RecyclerView.setAdapter(); // 3 RecyclerView.setItemAnimator(); // 4 […]

Customize recyclerView to achieve light axis effect

The time axis effect appears in many apps, such as express delivery tracking in Taobao. This article will use recyclerView to achieve the time axis effect. We will go to the custom control. First, take a look at the rendering: Next is the step analysis 1Custom attributes Everyone should know this. According to our previous […]

Android uses RecyclerView to implement product list

Implementation steps: Create a data model Create a class that represents the product, such as ProductInfo Create an adapter Create an adapter class that inherits from RecyclerView.Adapter to handle data and views in RecyclerView Add RecyclerView to the main page layout file Create Item layout file In your Activity or Fragment, initialize the RecyclerView and […]

Android Studio- App portal page design and development and recycleview (1)

1. Homework Objectives 1. Please design an app portal framework based on the course content, which needs to achieve 3-4 tab switching effects; the technologies required for this function are: activity, xml, fragment 2. Implement the list effect in any tab page; the implementation of this function requires the use of recycleview; 2. Design effect […]

Android intermediate-ListView and RecycleView analysis

ListView and RecycleView ListView RecycleView ListView For usage steps, see Android Basics – ListView, its setAdapter() is as follows, call back getCount() to get the number of Items @Override public void setAdapter(ListAdapter adapter) { if (mAdapter != null & amp; & amp; mDataSetObserver != null) { mAdapter.unregisterDataSetObserver(mDataSetObserver); } resetList(); mRecycler.clear(); if (mHeaderViewInfos.size() > 0|| mFooterViewInfos.size() […]

ViewPager, RecycleView implement carousel chart

1.ViewPager implements carousel graphics effects. 1) In layout, PageIndicatorView carousel View <RelativeLayout android:layout_width=”match_parent” android:layout_height=”200dp” android:orientation=”vertical”> <androidx.viewpager2.widget.ViewPager2 android:id=”@ + id/viewpager” android:layout_width=”match_parent” android:layout_height=”match_parent” /> <com.example.viewpager.indicator.PageIndicatorView android:id=”@ + id/indicator1″ android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_alignParentBottom=”true” /> </RelativeLayout> 2) In Activity List<String> list = new ArrayList<>(); for (int i = 0; i < 5; i + + ) { list.add(“pos: ” + […]