@@ -143,18 +143,26 @@ public void setLowProfile(final boolean lightsOut, final boolean animate, final
143143 final View navButtons = mCurrentView .findViewById (R .id .nav_buttons );
144144 final View lowLights = mCurrentView .findViewById (R .id .lights_out );
145145
146+ // ok, everyone, stop it right there
147+ navButtons .animate ().cancel ();
148+ lowLights .animate ().cancel ();
149+
146150 if (!animate ) {
147- lowLights .setVisibility (View .GONE );
148- navButtons .setAlpha (1f );
151+ navButtons .setAlpha (lightsOut ? 0f : 1f );
152+
153+ lowLights .setAlpha (lightsOut ? 1f : 0f );
154+ lowLights .setVisibility (lightsOut ? View .VISIBLE : View .GONE );
149155 } else {
150156 navButtons .animate ()
151157 .alpha (lightsOut ? 0f : 1f )
152158 .setDuration (lightsOut ? 600 : 200 )
153159 .start ();
154160
155161 lowLights .setOnTouchListener (mLightsOutListener );
156- lowLights .setAlpha (0f );
157- lowLights .setVisibility (View .VISIBLE );
162+ if (lowLights .getVisibility () == View .GONE ) {
163+ lowLights .setAlpha (0f );
164+ lowLights .setVisibility (View .VISIBLE );
165+ }
158166 lowLights .animate ()
159167 .alpha (lightsOut ? 1f : 0f )
160168 .setStartDelay (lightsOut ? 500 : 0 )
@@ -236,15 +244,6 @@ public void onFinishInflate() {
236244 mCurrentView = mRotatedViews [Surface .ROTATION_0 ];
237245 }
238246
239- @ Override
240- public boolean onTouchEvent (MotionEvent ev ) {
241- try {
242- mBarService .setSystemUiVisibility (0 );
243- } catch (android .os .RemoteException ex ) {
244- }
245- return false ; // pass it on
246- }
247-
248247 public void reorient () {
249248 final int rot = mDisplay .getRotation ();
250249 for (int i =0 ; i <4 ; i ++) {
0 commit comments