B4A Library [Lib, Chargeable] Amir_RecyclerView

New b4a library! :)

RecyclerView, an important part of the sdk and android for making a custom list with better Layout , animation , and fixed for large data set.


Amir_RecyclerView released new version that we call it AX_RecyclerView.

version 1.0.8 is last update for Amir_RecyclerView and we will work on AX_RecyclerView only in future.


RecyclerView Android X : https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView

"RecyclerView is part of the v7 support library which means you can use it on anything that has api 7 and up"

543434345345.jpg



Advantages of using recyclerview instead listview:
  • ViewHolder Pattern
In a ListView, it was recommended to use the ViewHolder pattern but it was never a compulsion. In case of RecyclerView, this is mandatory using the RecyclerView.ViewHolder class. This is one of the major differences between the ListView and the RecyclerView.​

  • LayoutManager
This is another massive enhancement brought to the RecyclerView. In a ListView, the only type of view available is the vertical ListView. There is no official way to even implement a horizontal ListView.​
Now using a RecyclerView, we can have a:​
i) LinearLayoutManager - which supports both vertical and horizontal lists,​
ii) StaggeredLayoutManager - which supports Pinterest like staggered lists,​
iii) GridLayoutManager - which supports displaying grids as seen in Gallery apps.​
And the best thing is that we can do all these dynamically as we want.​

  • Item Animator
ListViews are lacking in support of good animations, but the RecyclerView brings a whole new dimension to it. Using the RecyclerView.ItemAnimator class, animating the views becomes so much easy and intuitive.​

  • Item Decoration
In case of ListViews, dynamically decorating items like adding borders or dividers was never easy. But in case of RecyclerView, the RecyclerView.ItemDecorator class gives huge control to the developers but makes things a bit more time consuming and complex.​

  • OnItemTouchListener
Intercepting item clicks on a ListView was simple, thanks to its AdapterView.OnItemClickListener interface. But the RecyclerView gives much more power and control to its developers by the RecyclerView. OnItemTouchListener but it complicates things a bit for the developer.​


For more info:
https://developer.android.com/reference/android/support/v7/widget/RecyclerView

You can add plugins as library and connect it to Amir_RecyclerView using a line of code

Current Plugins :
  • Amir_RVHeaderFooter
  • Amir_RVToolbarParallax
  • Amir_RVEmptyView
  • Amir_RVCardSlider
  • Amir_RVCarousel
  • Amir_RVDiscrete
  • Amir_RVExpandable
  • Amir_RVFanLayout
  • Amir_RVFeature
  • Amir_RVItemPicker ( deprecated )
  • Amir_RVLayoutAnimation
  • Amir_RVMultiSelection
  • Amir_RVParallax
  • Amir_RVRefreshLayout
  • Amir_RVShimmer
  • Amir_RVSkidRight
  • Amir_RVSwipeCards
  • Amir_RVVegaLayout
  • Amir_RVEchelon
  • Amir_WearableRecyclerView
  • Amir_RVDragItem
  • Amir_RVStickyHeader
  • AX_RecyclerViewPager ( deprecated )
  • Amir_RVAnimators
  • AX_RVSelection
  • AX_RVItemPicker
  • AX_RVPageIndicator
  • Amir_RVChipsLayoutManager
  • AX_RVSwipeLayout 1.00
  • AX_RVHeaderParallax
  • Amir_RVCardViewAdapter
  • Amir_RVExpandableStickyHeader
  • Amir_RVOverScroll
  • AX_RVFastScroller
  • AX_RVHeightStaggeredGrid
  • Amir_RVDragAndSwipe ( NEW )

Demo and samples how to use :

Download the DEMO.apk ( updated in 28th of July 2019 )
Download Demo Source Code

Extra Samples are here


Current version of Amir_RecyclerView : 1.2.0

Be sure to check the apk sample before purchasing.


You can have this fantastic library just with $25 ( only Amir_RecyclerView )
Full packages include all plugins only $35

Short documentations attached , special thanks to fredo

After your purchase please send me an email with your purchase detail ( alimanam@gmail.com )

 

Attachments

  • Amir_RecyclerView_FullPackage_1.0.2.LIBDOC.zip
    61.1 KB · Views: 1,678
Last edited:

Carlos marin

Active Member
Licensed User
Longtime User
You should NEVER load 100-500 images at the same time, from a memory consumption view RecyclerView will definitely help having 100-500 items even much much more but that's only for Views and views life cycle. of course for downloading images you can always rely on glide which this lib use and it will 100% be much more easier to handle all the memory and cache problems, to sum it up your problem is not about the kind of lib you use it's about the way you do it and downloading 500 images is never a good way ;)
Try to show only 20 items [lazy loading] no need to wait for the end of scroll maybe when user scroll reach 10 load another 20 and so on, this way even the user will not notice the download happening.

dear that's why I tell you that I use VisibleRangeChanged obviously I will not load 100 images at the time. but if I bring a more or less similar query and each one needs an image
 

itgirl

Active Member
Licensed User
Longtime User
dear that's why I tell you that I use VisibleRangeChanged obviously I will not load 100 images at the time. but if I bring a more or less similar query and each one needs an image
Well i really can't tell what is it exactly that you are seeking but if you are not loading a lot of images then it's not about the images being pulled from server but it's a memory wise concerning the [Views] which will cause the little [lag], in that case this Lib will definitely help, because RecyclerView reuses the views which will lower your memory usage
 

alimanam3386

Active Member
Licensed User
Longtime User
Anyone else getting the following error when using RVItemPicker?
B4X:
java.lang.IndexOutOfBoundsException: Invalid item position 0(0). Item count:0 com.aghajari.rv.RecyclerView{34a816ce VFED.... ......I. 0,0-0,0}, adapter:com.aghajari.rvplugins.Amir_RVItemPicker$Amir_RVItemPickerAdapter@13d8a9ef, layout:com.aghajari.rvplugins.PickerLayoutManager@14e15cfc, context:android.app.Application@35318f85

please update your android sdk , it should solve your problem.
 

wimpie3

Well-Known Member
Licensed User
Longtime User
Can someone please explain how we can modify one item in the dataset when the recyclerview is already on the screen? I've used
B4X:
recycleList.Adapter2.notifyItemChanged(latestPosition)
but that does not (always) seem to work. Is this the correct statement? Or should something else be added?
 

fredo

Well-Known Member
Licensed User
Longtime User
...does not (always) seem to work.

Had the same effect sometimes and sleep after notify helped
B4X:
    Sleep(100)

or this after item removal
B4X:
    ' Inform the Layout manager to refresh the visible items BELOW the clicked item
    RVMain_RecyclerView.Adapter2.NotifyDataItemChanged2(Position, Position +RVMain_RecyclerView.GetVisibleItemCount)
 

alimanam3386

Active Member
Licensed User
Longtime User
Adapter is dcKeyValueList ( DataCollection lib )

B4X:
Sub Edit_Message(m As Map)
    Dim pos As Int = Adapter.IndexOfKey(m.Get("MsgId"))
    If pos <> -1 Then
        Dim msg As Message = Adapter.GetValueAt(pos)
        msg.Msg = m.Get("Msg")
        Adapter.Put(m.Get("MsgId") , msg) ' OR Adapter.Set(pos , msg)
        RV.Adapter2.NotifyItemChanged(pos)
    End If
End Sub
 
Last edited:

Carlos marin

Active Member
Licensed User
Longtime User
my other question I have a server with many images we are working on a project similar to Instagram. it is possible to do this with this library (carousel layout- two cards)
 

wimpie3

Well-Known Member
Licensed User
Longtime User
Updated to Java 8.202 (the latest version) but that doesn't change a thing.
 

wimpie3

Well-Known Member
Licensed User
Longtime User
Well, it's definitely not working. I've switched to Java 11 (C:\Program Files\Java\jdk-11.0.2\bin\javac.exe)
And I'm using android-28 (C:\android_sdk\platforms\android-28\android.jar)

Cleaned my project and still the same error:
B4X:
PARSE ERROR:
unsupported class file version 52.0
...while parsing com/aghajari/rvplugin/Amir_RVStickyHeader.class
1 error; aborting


All other plugins for the recycleview work just fine.
 

alimanam3386

Active Member
Licensed User
Longtime User
Well, it's definitely not working. I've switched to Java 11 (C:\Program Files\Java\jdk-11.0.2\bin\javac.exe)
And I'm using android-28 (C:\android_sdk\platforms\android-28\android.jar)

All other plugins for the recycleview work just fine.

I told you I am not sure about the cause of your problem. I use JDK 10.0.1 With updated sdk without any problem ( android-28 )

4533564578e4.jpg


https://www.dropbox.com/s/3vlk87a9diq78qa/Amir_RVStickyHeader.apk?dl=0

you should find out your problem somewhere else.
 

wimpie3

Well-Known Member
Licensed User
Longtime User
The only difference I see is that I'm using B4A 8.0 and you're using a more recent version.
 
Top