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:

itgirl

Active Member
Licensed User
Longtime User
Hello, I have a question about Amir_Glide
I'm trying to load a Drawable into a background of a panel with no luck.

B4X:
panel.Background =Glide.As.Drawable.LoadURL("IMG_URL")

I've even tried to double load
B4X:
panel.Background =Glide.Load(Glide.As.Drawable.LoadURL("IMG_URL").Load )
with no luck at all , The "Into" method is working with no problem but the Drawables and Bitmaps is little bit tricky.
 

asales

Expert
Licensed User
Longtime User
Hello, I have a question about Amir_Glide
I'm trying to load a Drawable into a background of a panel with no luck.

B4X:
panel.Background =Glide.As.Drawable.LoadURL("IMG_URL")

I've even tried to double load
B4X:
panel.Background =Glide.Load(Glide.As.Drawable.LoadURL("IMG_URL").Load )
with no luck at all , The "Into" method is working with no problem but the Drawables and Bitmaps is little bit tricky.
See this (I think will be the same approach to panel):
https://www.b4x.com/android/forum/threads/lib-chargeable-amir_recyclerview.97274/page-4#post-614479
 

itgirl

Active Member
Licensed User
Longtime User

alimanam3386

Active Member
Licensed User
Longtime User
I don't think its the same because the one you refereed is to get the drawable from an imageview but im trying to get the drawable from an URL or URi .... and im trying to figure out the Glide.As method which is great to get the Drawable or Bitmap from any supported method URL,URI,file .....

Use this :
B4X:
Dim Glide As Amir_Glide
  Glide.Initializer.Default
  Glide.Load("URL").Listener("Glide",Img).Submit

Sub Glide_onResourceReady (Data As Object,Model As Object,DataSourceName As String,isFirstResource As Boolean) As Boolean
  Dim Img As ImageView=Sender
  Img.Background=Data
End Sub
 

Arthur Ávila

Member
Licensed User
Hi, it looks awesome! One question, how it performs with higher number of items? For example, 1000, 5000 etc.

Is there any example that maybe I missed?

Thanks.
 

alimanam3386

Active Member
Licensed User
Longtime User
Hi, it looks awesome! One question, how it performs with higher number of items? For example, 1000, 5000 etc.

Is there any example that maybe I missed?

Thanks.

Hi , it doesn't matter how many items do you have. even if you have 10 million of items.
 

sz4t4n

Member
Licensed User
Longtime User
Hello,

i have some problem with:
B4X:
Private Sub Amir_GetItemCount As Int

When I start app i dont know how many items will be in card slider co i have to check it by httjob:

B4X:
Private Sub Amir_GetItemCount As Int
   
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download("someWWW")
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Log(j.GetString)
    End If
    j.Release
    Dim result As Int
    result = j.GetString
  
    Return result
End Sub

j.getstring return just item count for example "100"

but i get error:

B4X:
Error description: Resumable subs return type must be ResumableSub (or none).
Error occurred on line: 81 (Main)
Private Sub Amir_GetItemCount As Int

any idea how to solve it?

thanks
 

MAGAREY

Member
Licensed User
Longtime User
Hello,

i have some problem with:
B4X:
Private Sub Amir_GetItemCount As Int

When I start app i dont know how many items will be in card slider co i have to check it by httjob:

B4X:
Private Sub Amir_GetItemCount As Int
 
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download("someWWW")
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Log(j.GetString)
    End If
    j.Release
    Dim result As Int
    result = j.GetString
 
    Return result
End Sub

j.getstring return just item count for example "100"

but i get error:

B4X:
Error description: Resumable subs return type must be ResumableSub (or none).
Error occurred on line: 81 (Main)
Private Sub Amir_GetItemCount As Int

any idea how to solve it?

thanks

that's because you are trying to access to j.getstring after you release it. why dont you put the result = j.GetString inside the j.Success
?
 

sz4t4n

Member
Licensed User
Longtime User
I have changed it to:
B4X:
Private Sub Amir_GetItemCount As Int
    
    Dim result As Int
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download("someWWW")
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Log(j.GetString)
        result = j.GetString
    End If
    j.Release
    
    
    Return result
End Sub

but there is still the same error
 

MAGAREY

Member
Licensed User
Longtime User
wait, why did you use the return for?
Sub Amir_GetItemCount As Int is declare as int
and the result as string
 

sz4t4n

Member
Licensed User
Longtime User
if i change to this:
B4X:
Private Sub Amir_GetItemCount As Int
    
    Dim result As Int
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download("someWWW")
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Log(j.GetString)
        'result = j.GetString
        result = 10
    End If
    j.Release
    
    
    Return result
End Sub

still the same error
 

sz4t4n

Member
Licensed User
Longtime User
thanks for Your reply. When i change as You wrote there is no error while compilation but when app run there is error:

B4X:
java.lang.ClassCastException: anywheresoftware.b4a.keywords.Common$ResumableSubWrapper cannot be cast to java.lang.Integer
 

asales

Expert
Licensed User
Longtime User
When I start app i dont know how many items will be in card slider co i have to check it by httjob
Check the items online before you create the list and not in the Sub Amir_GetItemCount.
When you get the items, call the sub that creates a list.
B4X:
Private Sub CheckItems
    Dim items As Int
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download("someWWW")
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Log(j.GetString)
        items = j.GetString

        CreateListWithItems(items) '-> CALL SUB TO CREATE THE LIST HERE
    End If
    j.Release
End Sub
 
Last edited:

Eldad Onojetah

Member
Licensed User
Hi
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.

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

View attachment 72645


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 ( new )
  • Amir_RVEmptyView
  • Amir_RVCardSlider
  • Amir_RVCarousel
  • Amir_RVDiscrete
  • Amir_RVExpandable
  • Amir_RVFanLayout
  • Amir_RVFeature
  • Amir_RVItemPicker
  • Amir_RVLayoutAnimation
  • Amir_RVMultiSelection
  • Amir_RVParallax
  • Amir_RVRefreshLayout
  • Amir_RVShimmer
  • Amir_RVSkidRight
  • Amir_RVSwipeCards
  • Amir_RVVegaLayout
  • Amir_RVViewPager
  • Amir_RVEchelon ( new )
  • Amir_WearableRecyclerView ( new )
  • Amir_RVDragItem

Demo and samples how to use :

Download the DEMO.apk ( updated in 28th of September 2018 )
Download all examples of Amir_RecyclerView with plugins

Current version of Amir_RecyclerView : 1.0.2

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


Pay

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

Hi,

It's the Christmas season, any promo sales? Urgently need to get this.
 
Top