0

Have and issue after android 11 upgrade

I have an application which need to be updated to sdk 30, after upgrading I am getting wierd UI issue, There is an extra space added on top of the container just below the appbar. When I run the app in lower version after sdk upgrade it looks fine. Seems issue is only with android 11. Please let me know what is the exact issue, not able to figure out. I tried changing the material to stable version 1.2.0, and appcompact version as well, but no change.

build tool used is: 30.0.0

the top area has some default margin where as in code the is no such margins added.

<com.google.android.material.appbar.AppBarLayout

        android:id="@+id/app_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:elevation="0dp">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/toolbar_title"
                style="@style/PsToolbarTitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:ellipsize="end"/>
        </androidx.appcompat.widget.Toolbar>

        <View
            style="@style/Divider"
            android:layout_width="match_parent"
            android:layout_height="@dimen/divider_height"/>

    </com.google.android.material.appbar.AppBarLayout>

this is included in the coordinator layout

use this link for screenshot: https://i.stack.imgur.com/Jns79.png

Kishan Maurya
  • 3,356
  • 8
  • 21

1 Answers1

0

I had the same problem. I don't know the fundamental cause but, in my case, the problem is solved by update com.google.android.Material (to version 1.3.0) in build.gradle.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
yoyan
  • 1