B4A Library Floating Action Button

luke2012

Well-Known Member
Licensed User
Longtime User
Ok, I can now reproduce it.

As a workaround for now you need to disable the shadow for KitKat devices.

Thanks for your workaround corwin42! It's in plan for a library update in order to fix the issue ?
 

corwin42

Expert
Licensed User
Longtime User
Hi @corwin42
i tested FAB library with appcompact and ClsCheckList by informatix
the problem same like @luke2012

View attachment 32450

and this example project.. i use appcompactmenu example project.
FAB+APPCOMP+CHKLIST.zip

Ok, this took me 4 hours of my life and I was going mad while searching for this issue.

I found the problem but I didn't understand it completely.
The problem is that in your project folder under Objects/res/drawable-xxx you have a shadow.png which is write protected. The FAB uses a drawable named shadow.png which is located in the FAB resource folder. My understanding was that if I add the resources with #AdditionalRes and a package name the library will always use the resource from the resource folder with the package name. Seems I was wrong.

Maybe Erel can clarify things here how #AdditionalRes works exactly. I will ask him.
 

luke2012

Well-Known Member
Licensed User
Longtime User

Probably also @Informatix that implemented clsChecklist class could help

In my projects I'm using also UltraListView class by @Informatix! I'll test FAB also on this class.
 

corwin42

Expert
Licensed User
Longtime User
@corwin42 where I can do this within the code of FAB ?
Thanks in advance!

There is no need for the workaround (though there is a shadow property in the fab object to disable the shadow).
The problem was a conflict with resources in the project.
 

luke2012

Well-Known Member
Licensed User
Longtime User

Yes @corwin42. I agree with you that the right person for this clarification is @Erel.
 

corwin42

Expert
Licensed User
Longtime User
Yes @corwin42. I agree with you that the right person for this clarification is @Erel.

We already have the solution and the answer is here.
In short words. It is expected behavior that library resources get overwritten by local resources. Maybe I will add a prefix to the libraries resources in a future version.
 

omidaghakhani1368

Well-Known Member
Licensed User
Longtime User
Hi.
Thank you for your library it is good but i cannot test it
it get error android.content.res.Resources$NotFoundException: Resource ID #0x0
What's problem?
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
Hi @corwin42,

I'm trying to compile and test your FABListView sample project.

I've followed all the directions from post#1.
Lib files and res folder have been copied to the right places.
My "#AdditionalRes" statement is as follows:
B4X:
#AdditionalRes: D:\Documents and Settings\Claudio\Downloads\B4X\Basic4Android\AdditionalResources\b4a_floatingactionbutton, de.amberhome.objects.floatingactionbutton

Everything seems to be ok, but I always get this error:
B4X:
B4A version: 5.02 (1)
Parsing code.    (0.00s)
Compiling code.    (0.03s)
Compiling layouts code.    (0.00s)
Generating R file.    Error
invalid resource directory name: D:\Documents and Settings\Claudio\Downloads\B4X\Basic4Android\Samples\FABListView\resource\b4a_floatingactionbutton/drawable-xxxhdpi

My device is a Samsung Galaxy S4, with Android 5.0.1, and my desktop is a Windows 7 SP1.

Any ideas?

Thank you!
 

ArminKH

Well-Known Member
download attached zip file then unzip and move that inside your project like this

then add this code for use additional res(exactly this code)
B4X:
    #AdditionalRes: ..\CustomLibsRes\floatingactionbutton\res , de.amberhome.objects.floatingactionbutton
then compile your project
if still any error appared then you should update your build-tools to latest version from SDK Manager
 

Attachments

  • CustomLibsRes.zip
    53.4 KB · Views: 276
Last edited:

Claudio Oliveira

Active Member
Licensed User
Longtime User
Hi @arminkh
Thanks for your help!
I did exactly what you suggested. Libs in the right place, all Android SDK tools are up to date, everything looks fine but the error's still there.

B4X:
#Region  Activity Attributes 
    #FullScreen: False
    #IncludeTitle: True
    #AdditionalRes: ..\CustomLibsRes\floatingactionbutton\res, de.amberhome.objects.floatingactionbutton
#End Region

Something captured my attention, though. On the R file generating step, the compilation process inserts a forward slash ("/") in the directory name, and I just can't figure out why. This obviously raises a directory name error. It should be a backslash ("\") instead.

B4X:
B4A version: 5.02 (1)

Parsing code.    (0.00s)
Compiling code.    (0.05s)
Compiling layouts code.    (0.01s)
Generating R file.    Error
invalid resource directory name: ..\CustomLibsRes\floatingactionbutton\res/drawable-xxxhdpi

Maybe @Erel can shed some light on this...

Thanks again, mate!
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
Solved!
Searching the forum, I've read some posts on the same subject. One of these says that only the last version of Android Build Tools should be installed.
As I had all Android Build Tools, I've deleted all but the latest version (22.0.1), and that's it.
Everything's up'n'running now.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…