B4A Library Arc Menu [Class] + [Lib]

Gary Milne

Active Member
Licensed User
Longtime User
With these search criteria, it's the first link returned by Google...
But as NJDude suggested, this forum is a better place for a search.
Got it, I was confused by your statement in the discussion regarding Arc Menu that you had pulled version 2 from this site so I was trying to find it elsewhere.
 

koaunglay

Member
Licensed User
Longtime User
When I run, ----------------
Parsing code. 0.02
Compiling code. 0.04
Compiling layouts code. 0.07
Generating R file. 0.45
Compiling generated Java code. 1.34
Convert byte code - optimized dex. Error
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lbarxdroid/ArcMenuDemo/arcmenu;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
at com.android.dx.command.dexer.Main.processClass(Main.java:490)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
at com.android.dx.command.dexer.Main.access$400(Main.java:67)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:135)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
at com.android.dx.command.dexer.Main.processOne(Main.java:422)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
at com.android.dx.command.dexer.Main.run(Main.java:209)
at com.android.dx.command.dexer.Main.main(Main.java:174)
at com.android.dx.command.Main.main(Main.java:91)
1 error; aborting
Optimized dexer failed. Switching to Standard dexer.


----------------
Please help!
 

barx

Well-Known Member
Licensed User
Longtime User
Can you post your code relating to the menu please...
 

microbox

Active Member
Licensed User
Longtime User
Hi barx, thank you for this.. and also to Infomatix. I'm planning to use it in my app if it's okay?
 

barx

Well-Known Member
Licensed User
Longtime User
Hi barx, thank you for this.. and also to Infomatix. I'm planning to use it in my app if it's okay?
That is what it is there for
 

Bitcrawler

Member
Licensed User
Longtime User
Hi barx, this is great. I love it.

But I have a little problem ;-)

I use the PreferenceActivity to change the SetStartDegrees. On FirstRun SetStartDegrees(270). This works. I change it in Preferences to SetStartDegrees(90). When I open the Arc Menu it shows up correct, but it seems like the position counter has not updated. The menu icons have the right positition, but the wrong position id.

When I restart the app, it works correct. But it would be nice to do this on runtime.


Example: After changing SetStartDegrees from 270 to 90

B4X:
Sub ArcMenu_Click(position As Int)
    If position = 1 Then Flashlight_Click (positon = 5 after changing to 90)
    If position = 2 Then Compass_Click (positon = 4 after changing to 90)
    If position = 3 Then ScreenLight_Click (positon = 3 after changing to 90)
    If position = 4 Then Preference (positon = 2 after changing to 90)
    If position = 5 Then StartActivity ("infoact") (positon = 1 after changing to 90)
End Sub

Do you have a solution for this?
 

barx

Well-Known Member
Licensed User
Longtime User
I've had a flick through the code but cannot see anything that would cause this. Calling SetStartDegrees sets a private variable in the class and this is used in the calculations whenever the menu button is clicked.

manybe show your code from Preference activity that changes the StartDegree, see if I can spot something there. Or post a sample project showing the issue. Maybe I didn't understand the issue properly.

Thanks
 

koaunglay

Member
Licensed User
Longtime User
Please what is my error? I didn't change anycode. But I get this error.
B4X:
Parsing code.                           0.05
Compiling code.                         0.31
Compiling layouts code.                 0.01
Generating R file.                      0.11
Compiling generated Java code.          1.12
Convert byte code - optimized dex.      Error
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lbarxdroid/ArcMenuDemo/arcmenu;
    at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
    at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
    at com.android.dx.command.dexer.Main.processClass(Main.java:490)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
    at com.android.dx.command.dexer.Main.access$400(Main.java:67)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:135)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
    at com.android.dx.command.dexer.Main.processOne(Main.java:422)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
    at com.android.dx.command.dexer.Main.run(Main.java:209)
    at com.android.dx.command.dexer.Main.main(Main.java:174)
    at com.android.dx.command.Main.main(Main.java:91)
1 error; aborting
    Optimized dexer failed. Switching to Standard dexer.
 

koaunglay

Member
Licensed User
Longtime User
Very very nice ! I can run it. No need to check arcmenu lib if it is arcmenu module . Right?
 

koaunglay

Member
Licensed User
Longtime User
Very very nice ! I can run it. No need to check arcmenu lib if it is arcmenu module . Right?
 

koaunglay

Member
Licensed User
Longtime User
Very very nice ! I can run it. No need to check arcmenu lib if it is arcmenu module . Right?
 

koaunglay

Member
Licensed User
Longtime User
Very very nice ! I can run it. No need to check arcmenu lib if it is arcmenu module . Right?

 

koaunglay

Member
Licensed User
Longtime User
Very very nice ! I can run it. No need to check arcmenu lib if it is arcmenu module . Right?
 

koaunglay

Member
Licensed User
Longtime User
Very very nice ! I can run it. No need to check arcmenu lib if it is arcmenu module . Right?
 

barx

Well-Known Member
Licensed User
Longtime User
Very very nice ! I can run it. No need to check arcmenu lib if it is arcmenu module . Right?
No need for both. The lib is for quick easy use. The class was for peoe to see how it was done and to allow modification if they wish. Please do not keep posting the same question like above. Next time I simply won't answer.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…