Android Question Designer Weid Issue

Descartex

Well-Known Member
Licensed User
Hi, friends.
I've created an app that needs to take some pictures, so I'm using the Camera Library Example (i've copied the layout and made some changes on sizing and position only).
Captura.png
The app goes fine, and does its job as it should, but on some devices, the camera button is missing but, if you click on the area it should be... it takes the pic!!!
WhatsApp Image 2019-06-15 at 15.41.46.jpeg WhatsApp Image 2019-06-15 at 15.41.47(1).jpeg WhatsApp Image 2019-06-15 at 15.41.47.jpeg
I'm going crazy with this, because I've made a lot of changes and button stills missing on those devices...
Please any help about this would be welcome.

Regards.
 

Descartex

Well-Known Member
Licensed User
It's not a problem of sizing or anchors (I've already seen the video).
The issue is that the button seems to be invisible on some devices, but stills there, because, as I've told, it works fine on the area its supposed to be.
 

Descartex

Well-Known Member
Licensed User
Yes, I have it, and button goes at the botton, centered. But still missing on those devices.
It's weird because it only happens on some devices (Samsung), in others it goes like a charm.
 

emexes

Well-Known Member
Licensed User
It's weird because it only happens on some devices (Samsung), in others it goes like a charm.
Agreed, that is weird. Throwing ideas into the mix, thinking what could be different between some phones and others:

- Variants? (although the button is there, but... could it be something in a variant chosen by the affected phones like negative width or height, or one of the button edges being outside the screen boundary). Does the button only work when you press in the area where it should be, or does pressing anywhere on the camera preview screen cause the same action? Perhaps a press on the camera preview screen defaults to taking a picture, and the button is in fact not there after all.

- Layers? Perhaps the camera panel is higher on those phones. Increase the button elevation. Make sure the button is at the bottom of the views tree ie the top layer. Add another button that you can press to disable or move the camera preview screen, to see if the button is underneath.

- Transparency somehow being set (or cleared). Reassign opaque colors to the button in code, give it a border.

- Perhaps the phone does not have the button icon or character that you are using. Try using a standard text button in its place, see if that works.

- If you add a label alongside the button, does the label show up over the camera preview screen?

- Perhaps some phones don't permit altering the camera interface, to eg thwart hackers secretly taking photos without the user knowing.

I know these all look like crazy clutching-at-straws desperation, but: weird problems call for weird ideas ;-)
 

Descartex

Well-Known Member
Licensed User
Elevation?
It can't be, on my code i have this:
B4X:
Activity.LoadLayout("Camera")
    Panel1.SendToBack
    btnTakePicture.BringToFront
So it should put the button on top.
 

Descartex

Well-Known Member
Licensed User
Which theme is your app using? Can you upload the app?
On our manifest, we have this code:
B4X:
CreateResourceFromFile(Macro, Themes.DarkTheme)
And our client doesn't allows us to upload the app at forum. I can send you a link on a Google Drive.
 

Descartex

Well-Known Member
Licensed User
Your code has nothing to do with elevation. Check the Elevation property of the panel in the designer.
It's set on 0
 

Descartex

Well-Known Member
Licensed User
Then it is not related to the elevation.

Do you have access to the problematic device? What happens when you run CameraEx example?
It works fine with this example...
Logger connected to: samsung SM-J500M
--------- beginning of main
--------- beginning of system
Copying updated assets files (1)
* Service (starter) Create *
* Service (starter) Start *
* Activity (main) Create, isFirst = true *
* Activity (main) Resume *
* Activity (main) Pause, UserClosed = false *
sending message to waiting queue (activity_permissionresult)
running waiting messages (1)
findCamera
null
2
facing: 0, 0
* Activity (main) Resume *
findCamera
null
2
facing: 0, 0
findCamera
0
2
facing: 0, 0
90
[Height=720, IsInitialized=false, Width=1280
]
* Activity (main) Pause, UserClosed = false *
* Activity (main) Create, isFirst = false *
* Activity (main) Resume *
findCamera
null
2
facing: 0, 0
findCamera
1
2
facing: 0, 0
0
[Height=720, IsInitialized=false, Width=1280
]
findCamera
null
2
facing: 0, 1
facing: 1, 1
findCamera
1
2
facing: 0, 1
facing: 1, 1
Continuous focus mode is not available
[Height=720, IsInitialized=false, Width=1280
]
0.10000000149011612, 0.8999999761581421, Infinity
findCamera
null
2
facing: 0, 0
findCamera
1
2
facing: 0, 0
0
[Height=720, IsInitialized=false, Width=1280
]
* Activity (main) Pause, UserClosed = true *
 

emexes

Well-Known Member
Licensed User
It works fine with this example...
If you have code that works and code that doesn't work then you are on the home stretch to finding out why the code that doesn't, doesn't.

One approach would be to add the same Log statements to the not-working code, and then adjust the not-working code towards producing the exact same Log output.

I'm interested to hear what you discover. It's always nice when crazy stuff suddenly makes sense. :)
 
Top