0

I want to show a transparent lock screen over a web-view and want to make the underlying web-view inaccessible when there is a lock screen at the top. However, with my current implementation the user is still able to access and scroll the web-view even when there is a transparent lock screen. I used fragments to implement the web-view and the lock screen. Below are the screenshots-

Transparent Lock screen over the web-view.

As the screenshot shows, there is a transparent lock screen fragment over the web-view fragment. Ideally, the web-view fragment should be inaccessible and not scroll-able though still view-able. How can I make it inaccessible for the user?

Community
  • 1
  • 1
Lalit Agarwal
  • 173
  • 4
  • 14

1 Answers1

4

You have to make it so that the overlay intercepts click events:

<View
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#7000"
    android:clickable="true"/>
tachyonflux
  • 20,103
  • 7
  • 48
  • 67
  • I had another question regarding this. Suppose these were two different activities instead of fragments- a web view activity and a pin lock activity and I want to make the background screen containing the text scroll-able even though the PIN-Lock is visible. How is it possible to do this? – Lalit Agarwal Aug 04 '15 at 21:37