B4A Library [Lib] wAppMenu v.1.10 (Circle Reveal / same WhatsApp Attachment menu)

Tayfur

Well-Known Member
Licensed User
HEllo everbody;

My new library is same WhatsApp attachment menu.
My new library is same Circle Reveal

This lib need to AnimationMultiple lib.
Please update /download AnimationMultiple lib.
AnimationMultiple in attachmet

(External link or my in signature)


Version 1.10
I added a new methods:

DelayTime(Value As Int)
' set/get value of delay for options animations from background panel animations
' auto change value when you up to Animi_Time
' After, must be call "SetLayout" for recalculate all settings
' After, must be call "OptionsAdd" for recalculate all settings
' After, must be call "OptionsLoad" for recalculate all settings



***************************************
Version 1.03
I added methods:
  • LEFT As Int
  • TOP As Int
  • HEIGHT As Int
  • WIDTH As Int
general informations for size methods
' set/get value of sizes
' After, must be call "SetLayout" for recalculate all settings
' After, must be call "OptionsAdd" for recalculate all settings
' After, must be call "OptionsLoad" for recalculate all settings

*****************************************************



Screenshot_2015-11-13-21-14-44.png Screenshot_2015-11-13-21-15-21.png View attachment 38892 Screenshot_2015-11-13-21-15-36.png View attachment 38894 Screenshot_2015-11-13-21-15-43.png Screenshot_2015-11-13-21-15-59.png Screenshot_2015-11-13-21-16-10.png Screenshot_2015-11-13-21-16-16.png
#Event:

Click(Text as String, No as Int)


METHOD


  • Initialize(CallbackModule AsObject, EventName AsString, Activityx AsActivity)
  • AsMainViewAsView
  • OptionsLoad
  • OptionsDeleteAll
  • OptionsAdd(Text AsString,Normal_Pic_File_Name AsString,Push_Pic_File_Name AsString) AsBoolean

'You must declare ColCount and RowCount method
' Text >>
Normal_Pic_File_Name >> fiel name of Option's Normal picture
' Push_Pic_File_Name >> fiel name of Option's Pushing time picture
' Return >> every thing is ok >> TRUE

  • ShowAsBoolean
' Before you must call ##OptionsLoad## only one time

  • HideAsBoolean
' Before you must call ##OptionsLoad## only one time

  • SetLayout'(Left As Int,Top As Int,Width As Int, Height As Int,StartPoint As Int)
' SP_Left_Top =>> 1
' SP_Left_Bottom =>>2
' SP_Right_Top =>>3
' SP_Right_Bottom =>>4
' This values use SP_??? for staring animations point
'---settin LAyout values

  • isShowAsBoolean
'True is wAppManu Showed

PROPERTIES:


  • Animi_Time(value AsInt)
' set/get value of Animation Cycle Time

  • Padding(value AsInt)
' set/get value of Col Count

  • Col_Count(value AsInt)
' set/get value of Col Count

  • Row_Count(value AsInt)
' set/get value of Row Count

  • BackgroundColor(Color AsInt)
' set/get value of Background Color

  • TextColor(Color AsInt)
' set/get value of Labels text Color

  • StartingPoint(Value AsInt)
' SP_Left_Top =>> 1
' SP_Left_Bottom =>>2
' SP_Right_Top =>>3
' SP_Right_Bottom =>>4
' This values use SP_??? for staring animations point

  • TextSize(Value AsInt)
' set/get value of sizes

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Private z As wAppMenu
    Public b,c,d,e,TL,TR,BL,BR As Button
    Private p As ImageView
    Private s As Spinner

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")

    z.Initialize(Me,"z",Activity)
    TL.Initialize("TL")
    TR.Initialize("TR")
    BL.Initialize("BL")
    BR.Initialize("BR")

    Activity.AddView(TL,0,0,40%x,20%y)
    Activity.AddView(TR,60%x,0,40%x,20%y)
    Activity.AddView(BL,0,55%y,40%x,20%y)
    Activity.AddView(BR,60%x,55%y,40%x,20%y)
    TL.Text="3x2 cells, 3sec, 10dip pad."
    TR.Text="2x3 cells, 10sec, 2dip pad."
    BL.Text="2x2 cells, 5sec, 20dip pad."
    BR.Text="3x1 cells, 1 sec, 5dip pad"

    b.Initialize("b")
    c.Initialize("c")
    d.Initialize("d")
    d.Initialize("d")
    s.Initialize("s")
    Activity.AddView(b,0,90%y,50%x,10%y)
    b.Text="show"
    Activity.AddView(c,50%x,90%y,50%x,10%y)
    c.Text="close"

    Activity.AddView(z.AsMainView,0,25%y,100%x,30%y)
End Sub

Sub TL_Click
    z.BackgroundColor=Colors.Yellow
    z.TextColor=Colors.Blue
    z.Animi_Time=3000
    z.Col_Count=3
    z.Row_Count=2
    z.Padding=10dip
    z.StartingPoint=1
    z.SetLayout
    z.OptionsDeleteAll
    If z.OptionsAdd("Option #1","1.png","1n.png")=False Then LogColor("1# error",Colors.red)
    If z.OptionsAdd("Option #2","2.png","2n.png")=False Then LogColor("2# error",Colors.red)
    If z.OptionsAdd("Option #3","3.png","3n.png")=False Then LogColor("3# error",Colors.red)
    If z.OptionsAdd("Option #4","4.png","4n.png")=False Then LogColor("4# error",Colors.red)
    If z.OptionsAdd("Option #5","5.png","5n.png")=False Then LogColor("5# error",Colors.red)
    If z.OptionsAdd("Option #6","6.png","6n.png")=False Then LogColor("6# error",Colors.red)
    z.OptionsLoad


End Sub
Sub TR_Click
    z.BackgroundColor=Colors.Blue
    z.TextColor=Colors.Yellow
    z.Animi_Time=10000
    z.Col_Count=2
    z.Row_Count=3
    z.Padding=2dip
    z.StartingPoint=3
    z.SetLayout
    z.OptionsDeleteAll
    If z.OptionsAdd("Option #1","1.png","1n.png")=False Then LogColor("1# error",Colors.red)
    If z.OptionsAdd("Option #2","2.png","2n.png")=False Then LogColor("2# error",Colors.red)
    If z.OptionsAdd("Option #3","3.png","3n.png")=False Then LogColor("3# error",Colors.red)
    If z.OptionsAdd("Option #4","4.png","4n.png")=False Then LogColor("4# error",Colors.red)
    If z.OptionsAdd("Option #5","5.png","5n.png")=False Then LogColor("5# error",Colors.red)
    If z.OptionsAdd("Option #6","6.png","6n.png")=False Then LogColor("6# error",Colors.red)
    z.OptionsLoad

End Sub
Sub BL_Click
    z.BackgroundColor=Colors.White
    z.TextColor=Colors.Red
    z.Animi_Time=5000
    z.Col_Count=2
    z.Row_Count=2
    z.Padding=20dip
    z.StartingPoint=2
    z.SetLayout
    z.OptionsDeleteAll
    If z.OptionsAdd("Option #1","1.png","1n.png")=False Then LogColor("1# error",Colors.red)
    If z.OptionsAdd("Option #2","2.png","2n.png")=False Then LogColor("2# error",Colors.red)
    If z.OptionsAdd("Option #3","3.png","3n.png")=False Then LogColor("3# error",Colors.red)
    If z.OptionsAdd("Option #4","4.png","4n.png")=False Then LogColor("4# error",Colors.red)
    If z.OptionsAdd("Option #5","5.png","5n.png")=False Then LogColor("5# error",Colors.red)
    If z.OptionsAdd("Option #6","6.png","6n.png")=False Then LogColor("6# error",Colors.red)
    z.OptionsLoad
End Sub
Sub BR_Click
    z.BackgroundColor=Colors.LightGray
    z.TextColor=Colors.Blue
    z.Animi_Time=1000
    z.Col_Count=3
    z.Row_Count=1
    z.Padding=5dip
    z.StartingPoint=4
    z.SetLayout
    z.OptionsDeleteAll
    If z.OptionsAdd("Option #1","1.png","1n.png")=False Then LogColor("1# error",Colors.red)
    If z.OptionsAdd("Option #2","2.png","2n.png")=False Then LogColor("2# error",Colors.red)
    If z.OptionsAdd("Option #3","3.png","3n.png")=False Then LogColor("3# error",Colors.red)
    If z.OptionsAdd("Option #4","4.png","4n.png")=False Then LogColor("4# error",Colors.red)
    If z.OptionsAdd("Option #5","5.png","5n.png")=False Then LogColor("5# error",Colors.red)
    If z.OptionsAdd("Option #6","6.png","6n.png")=False Then LogColor("6# error",Colors.red)
    z.OptionsLoad
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Sub b_Click

    z.Show
End Sub
Sub c_Click
    z.Hide
End Sub

Sub z_Click(Text As String, No As Int)
    Msgbox(Text,No)
    Log(Text &" --- "&No)
End Sub
 

Attachments

Last edited:

mshafiee110

Active Member
Licensed User
Hi, @Tayfur
This is my log,please help me.
** Activity (main) Create, isFirst = true **
1
2
1
2
** Activity (main) Resume **
1
2
1
2
ADDOPTION method is problem for input values
1# error
ADDOPTION method is problem for input values
2# error
ADDOPTION method is problem for input values
3# error
ADDOPTION method is problem for input values
4# error
ADDOPTION method is problem for input values
5# error
ADDOPTION method is problem for input values
6# error
a.Target:(BALayout): Left=1152, Top=177, Width=1165, Height=1165, Tag=MAIN
a.Target:(BALayout): Left=1152, Top=177, Width=1165, Height=1165, Tag=MAIN
a.Target:(BALayout): Left=0, Top=0, Width=1165, Height=1165
a.Target:(BALayout): Left=0, Top=0, Width=1165, Height=1165
a.Target:(BALayout): Left=1152, Top=177, Width=1165, Height=1165, Tag=MAIN
a.Target:(BALayout): Left=1152, Top=177, Width=1165, Height=1165, Tag=MAIN
a.Target:(BALayout): Left=0, Top=0, Width=1165, Height=1165
a.Target:(BALayout): Left=0, Top=0, Width=1165, Height=1165
1
2
1
2
ADDOPTION method is problem for input values
1# error
ADDOPTION method is problem for input values
2# error
ADDOPTION method is problem for input values
3# error
ADDOPTION method is problem for input values
4# error
ADDOPTION method is problem for input values
5# error
ADDOPTION method is problem for input values
6# error
a.Target:(BALayout): Left=1152, Top=177, Width=1165, Height=1165, Tag=MAIN
a.Target:(BALayout): Left=1152, Top=177, Width=1165, Height=1165, Tag=MAIN
a.Target:(BALayout): Left=0, Top=0, Width=1165, Height=1165
a.Target:(BALayout): Left=0, Top=0, Width=1165, Height=1165
a.Target:(BALayout): Left=1152, Top=177, Width=1165, Height=1165, Tag=MAIN
a.Target:(BALayout): Left=1152, Top=177, Width=1165, Height=1165, Tag=MAIN
a.Target:(BALayout): Left=0, Top=0, Width=1165, Height=1165
a.Target:(BALayout): Left=0, Top=0, Width=1165, Height=1165
1
2
1
2
ADDOPTION method is problem for input values
1# error
ADDOPTION method is problem for input values
2# error
ADDOPTION method is problem for input values
3# error
ADDOPTION method is problem for input values
4# error
ADDOPTION method is problem for input values
5# error
ADDOPTION method is problem for input values
6# error
a.Target:(BALayout): Left=1152, Top=177, Width=1165, Height=1165, Tag=MAIN
a.Target:(BALayout): Left=1152, Top=177, Width=1165, Height=1165, Tag=MAIN
a.Target:(BALayout): Left=0, Top=0, Width=1165, Height=1165
a.Target:(BALayout): Left=0, Top=0, Width=1165, Height=1165
a.Target:(BALayout): Left=1152, Top=177, Width=1165, Height=1165, Tag=MAIN
a.Target:(BALayout): Left=1152, Top=177, Width=1165, Height=1165, Tag=MAIN
a.Target:(BALayout): Left=0, Top=0, Width=1165, Height=1165
a.Target:(BALayout): Left=0, Top=0, Width=1165, Height=1165
main_b_click (B4A line: 143)
z.Show
java.lang.NoSuchMethodError: b4a.Animation.Multiple.animationmultiple._startall
at wap.menu.wappmenu._show(wappmenu.java:1047)
at aaa.bbb.main._b_click(main.java:472)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:4443)
at android.view.View$PerformClick.run(View.java:18442)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)
 

Tayfur

Well-Known Member
Licensed User
Helllo;


Root couse for This error is Your image files. My code cant find your images in FILE.DIRASSET;
My lib now only support "File.DirAssets" directory. Please Recheck files in dirasset.

please you will look my sample code.

B4X:
If z.OptionsAdd("Option #1","1.png","1n.png")=False Then LogColor("CANT FIND YOUR IMAGE FILE IN DIRASSET ",Colors.red)
    If z.OptionsAdd("Option #2","2.png","2n.png")=False Then LogColor("CANT FIND YOUR IMAGE FILE IN DIRASSET",Colors.red)
    If z.OptionsAdd("Option #3","3.png","3n.png")=False Then LogColor("CANT FIND YOUR IMAGE FILE IN DIRASSET",Colors.red)
    If z.OptionsAdd("Option #4","4.png","4n.png")=False Then LogColor("CANT FIND YOUR IMAGE FILE IN DIRASSET",Colors.red)
    If z.OptionsAdd("Option #5","5.png","5n.png")=False Then LogColor("CANT FIND YOUR IMAGE FILE IN DIRASSET",Colors.red)
    If z.OptionsAdd("Option #6","6.png","6n.png")=False Then LogColor("CANT FIND YOUR IMAGE FILE IN DIRASSET",Colors.red)

I waintig your good or bad feedback .
 

mshafiee110

Active Member
Licensed User
Hi, @Tayfur
thanks for your reply.

I put files in File.DirAssets. but i am not able to use your lib.
can you upload a sample of your lib?
tnx
 

Tayfur

Well-Known Member
Licensed User
I uploaded sample code.
B4X:
z.BackgroundColor=Colors.Yellow
 ' 1. STEP : input geraral setting
   z.TextColor=Colors.Blue   
    z.Animi_Time=3000
    z.Col_Count=3
    z.Row_Count=2
    z.Padding=10dip
    z.StartingPoint=1
'2 STEP ---- >>> You  must setLayout  for calculate all pozitions
    z.SetLayout '<<<<  calculate  all pozitions
'3 STEP ---- >>> this is optional, you must use it when you  change option list or general settings.
    z.OptionsDeleteAll '<<<<  Reset/delete old all options
'4. STEP ---->> Options adding way. Check your images. Return is TRUE. Everything ok.
    If z.OptionsAdd("Option #1","1.png","1n.png")=False Then LogColor("1# error",Colors.red)
'---- many options  add
    If z.OptionsAdd("Option #6","6.png","6n.png")=False Then LogColor("6# error",Colors.red)
'5.STEP ----->>  Loading all codes for SHOW or HIDE events. (You can use many many times /repat again Show or Hide)
    z.OptionsLoad' System ready for show or hide event
'6 STEP ---->>> final code is ready SHOW or HIDE
 

Attachments

Tayfur

Well-Known Member
Licensed User
Last edited:

Tayfur

Well-Known Member
Licensed User

Attachments

mshafiee110

Active Member
Licensed User
HEllo @mshafiee110 ;

I add little video with my sample code in this article attachment.
@Tayfur
tnx a lot , I've tested your samples and saw your video,But in this case an error occurs.
main_b_click (java line: 392)
java.lang.NoSuchMethodError: b4a.Animation.Multiple.animationmultiple._startall
at wap.menu.wappmenu._show(wappmenu.java:1047)
at wap.menu.sample.main._b_click(main.java:392)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:3511)
at android.view.View$PerformClick.run(View.java:14105)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
main_b_click (java line: 392)
java.lang.NoSuchMethodError: b4a.Animation.Multiple.animationmultiple._startall
at wap.menu.wappmenu._show(wappmenu.java:1047)
at wap.menu.sample.main._b_click(main.java:392)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:3511)
at android.view.View$PerformClick.run(View.java:14105)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
 

Tayfur

Well-Known Member
Licensed User
@Tayfur
tnx a lot , I've tested your samples and saw your video,But in this case an error occurs.
main_b_click (java line: 392)
java.lang.NoSuchMethodError: b4a.Animation.Multiple.animationmultiple._startall
at wap.menu.wappmenu._show(wappmenu.java:1047)
at wap.menu.sample.main._b_click(main.java:392)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:3511)
at android.view.View$PerformClick.run(View.java:14105)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
main_b_click (java line: 392)
java.lang.NoSuchMethodError: b4a.Animation.Multiple.animationmultiple._startall
at wap.menu.wappmenu._show(wappmenu.java:1047)
at wap.menu.sample.main._b_click(main.java:392)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:3511)
at android.view.View$PerformClick.run(View.java:14105)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
This sample more clear....
 

Attachments

Tayfur

Well-Known Member
Licensed User
Updated Version 1.03

Clear and reorganize logs.
I added methods:

  • LEFT As Int
  • TOP As Int
  • HEIGHT As Int
  • WIDTH As Int
general information for size methods
' set/get value of sizes
' After, must be call "SetLayout" for recalculate all settings
' After, must be call "OptionsAdd" for recalculate all settings
' After, must be call "OptionsLoad" for recalculate all settings




Please udated on #1 article
 

AndOrNot

Well-Known Member
Licensed User
Hi tayfur, great library. I think the name of this effect is "Circle Reveal", you can add this on your post to help user to find your library
 

Tayfur

Well-Known Member
Licensed User
Updated Version 1.10
I added a new methods: (it is in article #1 )

DelayTime As Int
' set/get value of delay for options animations from background panel animations
' auto change value when you up to Animi_Time
' After, must be call "SetLayout" for recalculate all settings
' After, must be call "OptionsAdd" for recalculate all settings
' After, must be call "OptionsLoad" for recalculate all settings
 
Top