Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 737170f4 authored by Peter Cai's avatar Peter Cai Committed by Łukasz Patron
Browse files

FODCircleView: defer removal to next re-layout

* Originally, when hide() is called, it removes the dim layer and then
  removes the view immediately, then calls the hide event in HAL. This
  causes severe flickering because the HAL is expected to restore the
  brightness immediately, but the dim layer will not be removed until
  the next repaint cycle.

* Since it is not easy to listen for a redraw after the view itself has
  been removed, we can defer removal after the next time onLayout() is
  called. When tested on my OnePlus 7 Pro, this reduces flickering on
  successful fp authentication drastically.

* There are some cases where show() is called so quickly after hide()
  that the view hasn't been actually removed due to this change (which
  is actually another cause of flickering). This is handled by checking
  the removal flag in show() and removing it immediately if the view is
  yet to be removed, and also by moving calls to HAL show / hide events
  to the actual attached / detached event handlers.

* For consistency in semantics, also move calls related to the dim
  layer that were originally in onDraw for similar reasons to the
  onLayout function.

Change-Id: I9b0cfe5c4d572a64b918ce7d3c130a659fd25a30
parent 471cf7dc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment