android:keepScreenOn && android:visibility gone? Which one is stronger?

PressRex profile image
by PressRex
android:keepScreenOn && android:visibility gone? Which one is stronger?

In case I have `android:keepScreenOn="true":

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/main">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="@string/hello_world"
        android:gravity="center"
        android:textAppearance="?android:attr/textAppearanceLarge"/>

    <GridLayout
        android:id="@+id/myLayout"
        android:background="@android:color/background_dark"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_centerHorizontal="true"
        android:keepScreenOn="true">
    </GridLayout>

</RelativeLayout>

And later in my app I change myLayout's visibility to gone, while keep displaying the main layout, will it keep my screen on?

So technically speaking, is visibility=gone disabling keepScreenOn?

Source: View source

PressRex profile image
by PressRex

Subscribe to New Posts

Lorem ultrices malesuada sapien amet pulvinar quis. Feugiat etiam ullamcorper pharetra vitae nibh enim vel.

Success! Now Check Your Email

To complete Subscribe, click the confirmation link in your inbox. If it doesn’t arrive within 3 minutes, check your spam folder.

Ok, Thanks

Read More