0

I am trying to make an android app that with accesibility permissions draws over any app at the very top of my phone (at the status bar). The problem is that the top of the XML is not the top of the screen, it stays below the status bar. And yes, my app is at full screen mode (copyed some code of the full screen activity template in android studio). This is my first post and I am starting to android studio. Thanks in advance.

Tokio
  • 1

1 Answers1

0

create a new Style in Styles.xml and use it under the activity you want as full screen , it will cover the status bar

<style name="Theme.fullScreen" parent="Theme."MainTheme">

    <item name="android:windowLayoutInDisplayCutoutMode" 
     tools:targetApi="o_mr1">shortEdges</item>
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowTranslucentNavigation">true</item>
</style>
  • Hey, thanks for answering. I tried this and got the same result. [Image](https://ibb.co/9nG0DRp) – Tokio Sep 13 '22 at 18:54
  • have you seen any app displaying over status bar ?? can share the screenshot , i think it would only be possible only by doing something in accessibility Api – Himanshu Yadav Anshu Sep 14 '22 at 04:14
  • Yes, other apps [like this one](https://play.google.com/store/apps/details?id=you.in.spark.energy.ring.gen) can draw over there with the same permissions. I have made other question with images and expalining more. Thanks – Tokio Sep 14 '22 at 05:52