B4A Library Nice Spinner

DonManfred

Expert
Licensed User
Longtime User
These files need to set to READ ONLY else they will be deleted the first time that you compile the B4A app.
You can create a new Resourcefolder and reference it with #additionalres: path
In this case you dont need to put them in objects res and you dont need to take care of setting READONLY on all files in the Resourcefolder.
 

Csaba Balogh

Member
Licensed User
 

Csaba Balogh

Member
Licensed User
Hi there,

I know it is my mistake that I cannot figure out what the problem is but also have the same error that tylorrw had some time ago. I did all what was suggested, I changed the attributes of files in drawable dir, but still it returns with the error code. What am I doing wrong? Do I miss somthing?
The err.code:
B4X:
Logger connected to:  Sony D5503
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 32 (Main)
android.content.res.Resources$NotFoundException: Resource ID #0x0
    at android.content.res.Resources.getValue(Resources.java:1307)
    at android.content.res.Resources.getDimensionPixelSize(Resources.java:714)
    at main.java.org.angmarch.views.NiceSpinner.init(NiceSpinner.java:125)
    at main.java.org.angmarch.views.NiceSpinner.<init>(NiceSpinner.java:70)
    at nicespinnerwrapper.niceSpinnerWrapper._initialize(niceSpinnerWrapper.java:63)
    at nicespinnerwrapper.niceSpinnerWrapper.Initialize(niceSpinnerWrapper.java:56)
    at JHS.NiceSpinner.main._activity_create(main.java:390)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at JHS.NiceSpinner.main.afterFirstLayout(main.java:104)
    at JHS.NiceSpinner.main.access$000(main.java:17)
    at JHS.NiceSpinner.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:211)
    at android.app.ActivityThread.main(ActivityThread.java:5389)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
** Activity (main) Resume **
 

Johan Schoeman

Expert
Licensed User
Longtime User
See post #18 of this thread.

Rgds
JS
 

BarryW

Active Member
Licensed User
Longtime User
B4X:
Java Version: 8
Parsing code.    (0.00s)
Building folders structure.    (0.01s)
Compiling code.    (0.00s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Generating R file.    (0.00s)
Compiling generated Java code.    Error
B4A line: 70
spn_search_category.DropdownListTextSize = 20
javac 1.8.0_211
src\com\trabaho\p14\main.java:426: error: cannot find symbol
mostCurrent._spn_search_category.setDropdownListTextSize((int) (20));
                                ^
  symbol:   method setDropdownListTextSize(int)
  location: variable _spn_search_category of type niceSpinnerWrapper
 

alfaiz678

Active Member
Licensed User
do not work
B4X:
Error occurred on line: 47 (M_Asnaf)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at com.Alfaiz.AlmuhraRestaurantsAdmin.m_asnaf._activity_create(m_asnaf.java:395)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at com.Alfaiz.AlmuhraRestaurantsAdmin.m_asnaf.afterFirstLayout(m_asnaf.java:104)
    at com.Alfaiz.AlmuhraRestaurantsAdmin.m_asnaf.access$000(m_asnaf.java:17)
    at com.Alfaiz.AlmuhraRestaurantsAdmin.m_asnaf$WaitForLayout.run(m_asnaf.java:82)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:6918)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    ... 21 more
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
    at android.content.res.Resources.getValue(Resources.java:2480)
    at android.content.res.Resources.getDimensionPixelSize(Resources.java:1863)
    at main.java.org.angmarch.views.NiceSpinner.init(NiceSpinner.java:127)
    at main.java.org.angmarch.views.NiceSpinner.<init>(NiceSpinner.java:72)
    at nicespinnerwrapper.niceSpinnerWrapper._initialize(niceSpinnerWrapper.java:105)
    ... 25 more
** Activity (m_asnaf) Resume **
 

Johan Schoeman

Expert
Licensed User
Longtime User
See post #18 of this thread. Sure you will figure it out.
 

incendio

Well-Known Member
Licensed User
Longtime User
Hi,

I know this is old, but this spinner is exactly what I need, but it didn't work as expected.

This code didn't work
B4X:
ns2.DropdownListBackgroundColor = Colors.Black

No matter what color set for dropdown background, it always set to white, see attachment.

Runs on B4A 11.8, tested on Android 10 (real device) and Android 11 (emulator)

Is there a solution for this?
 

Attachments

  • ss.png
    24 KB · Views: 69

Johan Schoeman

Expert
Licensed User
Longtime User
What does the attached project look like on your device?
 

Attachments

  • b4aNiceSpinner27042023.zip
    32.4 KB · Views: 74

incendio

Well-Known Member
Licensed User
Longtime User
What does the attached project look like on your device?
See the attached pictures.

Also, these codes raised an error : Unknown member
B4X:
ns1.DropdownListTypeface = l1.Typeface

ns2.DropdownListTextSize = 15
ns2.SelectedItemTextSize = 10
Is there a new version of this class? Mine is ver 1.00
 

Attachments

  • SS1.png
    18.5 KB · Views: 79
  • SS2.png
    15 KB · Views: 72

GMan

Well-Known Member
Licensed User
Longtime User
On my Android 13 it Breaks on starting and then Shows nothing


 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…