firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.24k stars 568 forks source link

Card type In-App Message layout disorder when rotating from portrait to landscape on Android #3540

Open txfyxzzy opened 2 years ago

txfyxzzy commented 2 years ago

[READ] Step 1: Are you in the right place?

Yes

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Relevant Code:

AndroidMainfest.xml <activity ... android:configChanges="orientation|screenSize|keyboardHidden" />

ScreenRecords

layout_from_portrait_to_lanscape layout_from_landscape_to_portrait

google-oss-bot commented 2 years ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

argzdev commented 2 years ago

Hi @txfyxzzy, thanks for reporting. I was able to reproduce the same behaviour. That being said, I'll notify an engineer and see what we can do here. Thanks!

argzdev commented 2 years ago

Tracked internally at b/225188096

Here are some observations by our engineers:

It works if I delete the "android:configChanges" line, or set its value to:

  1. android:configChanges="orientation"
  2. android:configChanges="screenSize"
  3. android:configChanges="keyboardHidden"
  4. android:configChanges="orientation|keyboardHidden"
  5. android:configChanges="screenSize|keyboardHidden" But it doesn't work if I set its value to:
  6. android:configChanges="orientation|screenSize"
  7. android:configChanges="orientation|screenSize|keyboardHidden"

Upon investigation of our engineers, the issue was because of the "android:configChanges" being set which tells android OS that the OS doesn't need to do an activity restart to handle the config change as the developer will be handling it.

But in FIAM implementation, we are depending up on the OS to handle the config change and there by inflating a new layout (layout for landscape mode in this case) which matches the new config.

As of now we don't have any api exposed for the developer to communicate the config change if our developers are handling it by themselves.

So as a result, this is considered as a feature request. I've marked this for now, and our engineers can take a look into this deeper and discuss this further for future plans.