B4A Library ElemeShoppingView

A wrapper for this project https://github.com/JeasonWong/ElemeShoppingView
A cool shopping cart effect.

fc98f7669b1b61a359f79716ad106793.gif




NOTE :
B4X:
@DependsOn(values={"android-support-v4"})
B4X:
    #AdditionalRes : ..\res
ShoppingView
Author:
SMM
Version: 0.01
  • ShoppingView
    Events:
    • _add
    • _minus
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • Initialize (EventName As String, bgcolor As Int, textSize As Float, numbercolor As Int, textcolor As Int)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Duration As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Parent As Object [read only]
    • ShoppingText As String [write only]
    • Tag As Object
    • TextNum As Int
    • Top As Int
    • Visible As Boolean
    • Width As Int



Sample

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim demo As ShoppingView


End Sub

Sub Activity_Create(FirstTime As Boolean)

    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    demo.Initialize("buy",Colors.Green,18,Colors.Yellow,Colors.Black)
    Activity.AddView(demo,0,0,100%x,100%y)
    demo.ShoppingText="Buy B4A"
    demo.Duration=100
End Sub
Sub buy_add
    Log(demo.TextNum)
End Sub
Sub buy_minus
    Log(demo.TextNum)
End Sub

Version 2 fixes a bug reported here . Thank you itgirl
 

Attachments

  • res.zip
    793 bytes · Views: 364
  • ShoppingView.zip
    12.7 KB · Views: 334
  • ShoppingView2.zip
    12.7 KB · Views: 363
Last edited:

itgirl

Active Member
Licensed User
Longtime User
Great Lib thank you so much ... just one problem
B4X:
Dim ShoppingView1 As ShoppingView = Sender
Not working with error
java.lang.ClassCastException: anywheresoftware.b4a.BA cannot be cast to me.wangyuwei.shoppoing.ShoppingView

could you please fix this problem
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
Great Lib thank you so much ... just one problem
B4X:
Dim ShoppingView1 As ShoppingView = Sender
Not working with error
java.lang.ClassCastException: anywheresoftware.b4a.BA cannot be cast to me.wangyuwei.shoppoing.ShoppingView

could you please fix this problem
I am sorry I do not know why does this happen but I will look for a solution .
Also waiting for any hint from experts :)
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
Great Lib thank you so much ... just one problem
B4X:
Dim ShoppingView1 As ShoppingView = Sender
Not working with error
java.lang.ClassCastException: anywheresoftware.b4a.BA cannot be cast to me.wangyuwei.shoppoing.ShoppingView

could you please fix this problem
Please check version 2 . It should fix the problem .
 

jchal

Active Member
Licensed User
Longtime User
i have tred to run this but i got this error
Compiling generated Java code. Error
Cannot find: C:\Program Files (x86)\Anywhere Software\Basic4androidv6\libraries\android-support-v4.jar
can you tell me what is the problem?
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
or make sure you have android-support-v4.jar in C:\Program Files (x86)\Anywhere Software\Basic4androidv6\libraries\
 
Top