Android Question IME_HeightChanged not firing with targetSdkVersion = 35

giggetto71

Active Member
Licensed User
Longtime User
Hi,
with targetSdkVersion = 35 IME_HeightChanged event does NOT fire. I have

B4X:
SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateHidden)
in the manifest and even an example taken from an old case works if the targetSdk is 34 but it does NOT if the targetSDK = 35.
Any idea?

PS: EVERY targetSdk enformcement is a complete nightmare! che palle!
 

giggetto71

Active Member
Licensed User
Longtime User
when I run it does not build and I get:

aapt2.exe W 07-06 12:38:47 5948 2556 LoadedArsc.cpp:657] Unknown chunk type '200'.
res\values\theme.xml:6: error: style attribute 'android:attr/windowOptOutEdgeToEdgeEnforcement' not found.
error: failed linking references.
 
Upvote 0

giggetto71

Active Member
Licensed User
Longtime User
sorry to go back to this but I am getting crazy..this example works while my app does not if sdk is 35 (ie. in android 15 or 16 phones) it works just fine in 14 and below. I have used the same identical manifest for both (my app) and the IME example from @Erel and in both app I have the same, conceptually of course as my app is more complex, so in activity create I have
B4X:
IME.Initialize("IME")
IME.AddHeightChangedEvent

the test i do is to place a test edittext under Activity or in any panel (I am not using pages as it's an old app) and trying to get the IME_HeightChanged event triggered by clicking in the edit text. in the ime example it works, in my app does not. I have tried to "mess" the ime app by setting crazy things like activity.height to a fixed value or force the panel.height to 100%y..but the IME app always works and mine does not..I dont' know what to try more on my app. please help
 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
Did you also add the updated code to the Main Module?

 
Upvote 0

giggetto71

Active Member
Licensed User
Longtime User
no, becasue as I said it's not a pages based application. it's an old app with one activity and one background service.
 
Upvote 0

b4x-de

Active Member
Licensed User
Longtime User
I have an example for you. Try it out once. I have based the example on the classic example provided by Erel.

Please note that you must use the libraries from the AdditionalLibraries-Zip file in order to be able to receive an event from the IME keyboard in a full screen edge-to-edge. I am the author of this library, which implements code I adapted from Stackoverflow. Unfortunately, I cannot provide support for this library: It is what it is. But you are welcome to use it.

Also, pay attention to the entries in the manifest that allow you to set full screen edge-to-edge.

You will notice that the height of the notch and the height of the navigation bar must be taken into account in the layout. That's why I've added a function to the code that has already been published elsewhere in the forum.

This example was made possible by Erel, the members of the B4X forum and authors at Stackoverflow, for which I am very grateful.

Thomas


az_recorder_20250712_114600.gif
 

Attachments

  • FullScreen_IME_KeyboardHelper_v0-9.zip
    198.3 KB · Views: 38
  • FullScreen_IME_KeyboardHelper_AdditionalLibraries.zip
    9.4 KB · Views: 41
Last edited:
Upvote 0

giggetto71

Active Member
Licensed User
Longtime User
I have an example for you. Try it out once. I have based the example on the classic example provided by Erel.

Please note that you must use the libraries from the AdditionalLibraries-Zip file in order to be able to receive an event from the IME keyboard in a full screen edge-to-edge. I am the author of this library, which implements code I adapted from Stackoverflow. Unfortunately, I cannot provide support for this library: It is what it is. But you are welcome to use it.

Also, pay attention to the entries in the manifest that allow you to set full screen edge-to-edge.

You will notice that the height of the notch and the height of the navigation bar must be taken into account in the layout. That's why I've added a function to the code that has already been published elsewhere in the forum.

This example was made possible by Erel, the members of the B4X forum and authors at Stackoverflow, for which I am very grateful.

Thomas


View attachment 165324
Thank you very much. I am travelling for a biz trip for 2 weeks without access to my b4x workstation, so i will not be able to test it until end of july, but really thanks! I will let you known once i can give a try. Ps: i am really getting tired by google policies breaking things..
 
Upvote 0

giggetto71

Active Member
Licensed User
Longtime User
@b4x-de I just came back from biz trip and from vacation and finally I had the chance to try you your lib and YES! the events fires just nicely! great job! thanks also for the heads up about forced orientation...I just want my VB6 back!! :)
Seriously thank you VERY VERY much!
 
Upvote 0
Top