Android Question Prelaunch report content labeling - B4XSwitch view

davemorris

Active Member
Licensed User
Longtime User
Hi, Guys

Before I start, please do feel free to comment it my method of dealing with this prelaunch report is not the best method!

Anyway, I am having a problem relating to Google Play content labeling warnings in the prelaunch report.

Normally I use the Accessibility library to handle this problem, i.e.
Fixes for warnings relating to panels:
#if B4A
        Dim acc As Accessibility
        ' This removes the pre-launch content labeling warnings.
        acc.SetContentDescription(pnlPlayerListClickDelete, "Delete icon")    ' This removes the pre-launch content labeling warnings.
        acc.SetContentDescription(pnlPlayerListMask, "Player list")
#End If

However, I now have a compiler warning relating to B4XSwitch when using the above method on a B4XSwitch.
Compiler warning:
#if B4A
    Dim acc As Accessibility
    acc.SetContentDescription(swHHMMSSres, "Time resolution")    ' <-- gives a "types do not match" Compiler warning.
#End If

It appears I need to cast the type to android.view.View, but there appears no As() operator for this custom view (if that would work anyway).
I also experience similar problems with using this method on other customer views - so a general answer would be appreciated.

Kind regards and as always thanks for any help.

Dave Morris
 
Last edited:

Serge Bertet

Active Member
Licensed User
Have you tried this?
B4X:
acc.SetContentDescription(swHHMMSSres.mBase, "Time resolution")
 
Upvote 0

davemorris

Active Member
Licensed User
Longtime User
Hi
Tried the fix suggested by Serge (thanks for the help) but it only fixed the compiler warning - when I uploaded the code with the snippet below:

B4X:
#if B4A
    Dim acc As Accessibility
    acc.SetContentDescription(swHHMMSSres.mBase, "Time resolution")    ' Try to remove the pre-launch content labeling warnings.
#End If

Google's pre-launch report still complained about the "content label" for this control.

Can anyone help?

Dave
 
Upvote 0

davemorris

Active Member
Licensed User
Longtime User
Hi, Erel

The report as requested

----------------------------
Element path

android:id/content/BALayout[0]/BALayout[0]/BALayout[2]/BALayout[1]/BALayout[1]
----------------------------

I have attached a screen shot - which may help - There is a lot of warnings over 4000 in total (that has got to be a record) - but most are related to similar issues with custom views (i.e. floating text box and customer list view).

Thanks again for you help

Dave
 

Attachments

  • Screenshot 2022-10-25 104647.png
    Screenshot 2022-10-25 104647.png
    120.8 KB · Views: 189
Upvote 0

davemorris

Active Member
Licensed User
Longtime User
Hi, Erel

Unfortunately, I have difficulty ignoring it - it appears to be intended to help those with sight difficulties.

Previously using the Accessibility library fixed this type problems- I can only assume it is difficult to provide the required name?

Also it this is the edge of the problems - (relating to custom list view - but that's for another post).

Kind regards
Dave
 
Upvote 0

Serge Bertet

Active Member
Licensed User
Could you try this:
B4X:
acc.SetContentDescription(swHHMMSSres.mBase.GetView(1), "Time resolution")
B4XSwitch mBase.GetView(1) is the underlying panel for the BitmapCreator used to draw the switch button

The method I use is:
- open XUI Views.b4xlib (in the internal library folder) with 7zip
- view the .bas file (in your case it's B4XSwitch.bas)
- check the DesignerCreateView sub to see how the component was built

Sorry this is a "Trial and error method" not academic that can takes time ... but sometimes helps.
 
Upvote 0

davemorris

Active Member
Licensed User
Longtime User
Hi (Serge - Thanks for the input)

I will give it a try.

I was thinking, if this is a common problem then perhaps a property should be added to the class (in this case B4XSwitch) which will provide a reference to the underlying view. Then this reference is used in the call to the Accessibility library to deal with the Google Play content labeling warning.

As is it only adding code, so it would be easy to modify the original source without risk of breaking it -However we are not considered good practice (for many reasons I agree with) to modify the internal libraries. I may put it forward as a suggestion, what do you think?

Kind regards
Dave
 
Upvote 0

Serge Bertet

Active Member
Licensed User
I think Erel will pass by and see this thread or you can also post a message in the wish list.
Sometimes (I confess) I modify the lib, I know I shouldn't, but dont disclose to others ?
 
Upvote 0
Top