piscianemperor piscianemperor - 3 months ago 12
Android Question

Android - How can I highlight a button which is part of the layout underneath in an help overlay layout that is translucent?

On create, a sign-in button is visible. There is a help overlay that is triggered after N seconds. This help overlay must highlight the sign-in button in the layout below, like in the screen on the right in the image below. How can this be achieved? Both the initial sign-in screen and help overlay are two different relative layouts.

Example

Thanks for the help.

Answer

I figured it out. Following is the relative layout I used-

    <FrameLayout
        android:id="@+id/whiteDot"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/white_dot"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="9dp"
        android:layout_below="@id/loginHelpText">
    </FrameLayout>



    <Button
        android:id="@+id/loginHelpButton"
        android:layout_width="80dp"
        android:layout_height="38dp"
        android:layout_marginTop="16dp"
        android:layout_alignParentRight="true"
        android:layout_below="@id/loginHelpText"
        android:layout_marginRight="16dp"
        android:background="@drawable/rounded_corner_button_transparent"
        android:textColor="#fafafa"
        android:text="OK"/>

    <View
        android:id="@+id/whiteLine"
        android:layout_width="1dp"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_below="@id/whiteDot"
        android:layout_above="@+id/highlightButton"
        android:background="#e9ebed">
    </View>

    <Button
        android:id="@+id/highlightButton"
        android:layout_width="299dp"
        android:layout_height="57dp"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="114dp"
        android:layout_alignParentBottom="true"
        android:background="@drawable/rounded_corner_highlight_button"/>

    <ImageButton
        android:id="@+id/signInDuplicate"
        android:scaleType="fitXY"
        android:layout_width="283dp"
        android:layout_height="44dp"
        android:layout_marginBottom="120dp"
        android:focusable="false"
        android:src="@drawable/bt_signin"
        android:background="@android:color/transparent"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true"/>
Comments