Non ho mai usato B4XPage, devo utilizzare la libreria Amir.
ho questo codice :
mi da questo errore :
Error occurred on line: 64 (B4XOrderPage)
java.lang.RuntimeException: Object should first be initialized (View).
Did you forget to call Activity.LoadLayout?
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at b4a.example.b4xorderpage._amir_onbindviewholder(b4xorderpage.java:89)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at com.aghajari.rv.Amir_RVAdapter$Amir_RVAdapterWrapper.onBindViewHolder(Amir_RVAdapter.java:164)
at com.aghajari.rv.Amir_RVAdapter$Amir_RVLoopTwoAdapterWrapper.onBindViewHolder(Amir_RVAdapter.java:367)
at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7065)
at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7107)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6012)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6279)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6118)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6114)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2303)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1627)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665)
at com.aghajari.layout.TurnLayoutManager.onLayoutChildren(TurnLayoutManager.java:187)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4134)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3851)
at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4404)
at android.view.View.layout(View.java:20960)
at android.view.ViewGroup.layout(ViewGroup.java:6279)
at anywheresoftware.b4a.BALayout.onLayout(BALayout.java:60)
at android.view.View.layout(View.java:20960)
at android.view.ViewGroup.layout(ViewGroup.java:6279)
at anywheresoftware.b4a.BALayout.onLayout(BALayout.java:60)
at android.view.View.layout(View.java:20960)
at android.view.ViewGroup.layout(ViewGroup.java:6279)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:325)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:20960)
at android.view.ViewGroup.layout(ViewGroup.java:6279)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1842)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1686)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1595)
at android.view.View.layout(View.java:20960)
at android.view.ViewGroup.layout(ViewGroup.java:6279)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:325)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:926)
at android.view.View.layout(View.java:20960)
at android.view.ViewGroup.layout(ViewGroup.java:6279)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3037)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2545)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1636)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7946)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1092)
at android.view.Choreographer.doCallbacks(Choreographer.java:893)
at android.view.Choreographer.doFrame(Choreographer.java:812)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1078)
at a
Message longer than Log limit (4000). Message was truncated.
** Activity (main) Pause event (activity is not paused). **
** Service (starter) Destroy (ignored)**
Sos
[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...
www.b4x.com
ho questo codice :
B4X:
Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Public nomeAzienda As String
Public idAzienda As String
Public F As function
Private ListCategory As List
Private ListProduct As List
Private Recycler As Amir_RecyclerView
Private Carousel As Amir_RVCarousel
End Sub
'You can add more parameters here.
Public Sub Initialize As Object
Return Me
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
ListCategory.Initialize
ListProduct.Initialize
Root = Root1
Root.LoadLayout("MainPageOrdina")
ProgressDialogShow("Caricamento...")
Wait For (F.chargeListCategoryStrictMode(idAzienda)) Complete(l As List)
If l == Null Then
Log("Errore di connessione nel database")
ProgressDialogHide()
B4XPages.ClosePage(Me)
Else If l.Size == 0 Then
Log("Nessuna Categoria nel database")
ProgressDialogHide()
B4XPages.ClosePage(Me)
Else
ListCategory = l
ProgressDialogHide()
End If
Recycler.Initializer("Amir")
Root.AddView(Recycler, 0, 0, 100%x, 100%y)
Dim Carousel As Amir_RVCarousel
Carousel.Initialize(Recycler)
Carousel.Rotate = True
Carousel.Orientation = Carousel.HORIZONTAL
Carousel.Gravity = Carousel.GRAVITY_START
Carousel.PeekDistance = 100dip
Carousel.Radius = 1000dip
Dim Adapter As Amir_RVAdapter
Adapter.Initialize("Amir", Adapter.LOOP_FULL)
Recycler.Adapter = Adapter
Recycler.LinearSnapHelper
Recycler.Color = Colors.White
End Sub
Private Sub Amir_onCreateViewFolder (Parent As Panel, ViewType As Int)
Dim Label As Label
Label.Initialize("")
Parent.AddView(Label, 50%x-30dip, 0, 60dip, 60dip)
Label.Padding = Array As Int(8dip, 8dip, 8dip, 8dip)
End Sub
Private Sub Amir_onBindViewHolder (Parent As Panel, Position As Int)
Dim Label As Label = Parent.GetView(0)
Label.TextColor = Colors.White
Label.TextSize = 22
Label.Gravity = Gravity.CENTER
Label.Text = (Position+1)
Dim Color As ColorDrawable
Color.Initialize(0xFF005D80, 1000dip)
Label.Background = Color
Parent.Height = 68dip
End Sub
Private Sub Amir_GetItemCount As Int
Return ListCategory.Size
End Sub
mi da questo errore :
Error occurred on line: 64 (B4XOrderPage)
java.lang.RuntimeException: Object should first be initialized (View).
Did you forget to call Activity.LoadLayout?
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at b4a.example.b4xorderpage._amir_onbindviewholder(b4xorderpage.java:89)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at com.aghajari.rv.Amir_RVAdapter$Amir_RVAdapterWrapper.onBindViewHolder(Amir_RVAdapter.java:164)
at com.aghajari.rv.Amir_RVAdapter$Amir_RVLoopTwoAdapterWrapper.onBindViewHolder(Amir_RVAdapter.java:367)
at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7065)
at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7107)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6012)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6279)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6118)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6114)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2303)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1627)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665)
at com.aghajari.layout.TurnLayoutManager.onLayoutChildren(TurnLayoutManager.java:187)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4134)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3851)
at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4404)
at android.view.View.layout(View.java:20960)
at android.view.ViewGroup.layout(ViewGroup.java:6279)
at anywheresoftware.b4a.BALayout.onLayout(BALayout.java:60)
at android.view.View.layout(View.java:20960)
at android.view.ViewGroup.layout(ViewGroup.java:6279)
at anywheresoftware.b4a.BALayout.onLayout(BALayout.java:60)
at android.view.View.layout(View.java:20960)
at android.view.ViewGroup.layout(ViewGroup.java:6279)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:325)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:20960)
at android.view.ViewGroup.layout(ViewGroup.java:6279)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1842)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1686)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1595)
at android.view.View.layout(View.java:20960)
at android.view.ViewGroup.layout(ViewGroup.java:6279)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:325)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:926)
at android.view.View.layout(View.java:20960)
at android.view.ViewGroup.layout(ViewGroup.java:6279)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3037)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2545)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1636)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7946)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1092)
at android.view.Choreographer.doCallbacks(Choreographer.java:893)
at android.view.Choreographer.doFrame(Choreographer.java:812)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1078)
at a
Message longer than Log limit (4000). Message was truncated.
** Activity (main) Pause event (activity is not paused). **
** Service (starter) Destroy (ignored)**
Sos