Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Dismiss the no internet dialog when focus is lost
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Nov 11, 2019
1 parent 425e38b commit 20c8ac2
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import org.mozilla.vrbrowser.R;

public class NoInternetWidget extends UIWidget {
public class NoInternetWidget extends UIWidget implements WidgetManagerDelegate.WorldClickListener {

private Button mAcceptButton;

Expand Down Expand Up @@ -54,4 +54,27 @@ protected void initializeWidgetPlacement(WidgetPlacement aPlacement) {
aPlacement.visible = false;
}

@Override
public void show(int aShowFlags) {
super.show(aShowFlags);

mWidgetManager.addWorldClickListener(this);
mWidgetManager.pushWorldBrightness(this, WidgetManagerDelegate.DEFAULT_DIM_BRIGHTNESS);
}

@Override
public void hide(int aHideFlags) {
super.hide(aHideFlags);

mWidgetManager.popWorldBrightness(this);
mWidgetManager.removeWorldClickListener(this);
}

// WidgetManagerDelegate.WorldClickListener

@Override
public void onWorldClick() {
onDismiss();
}

}

0 comments on commit 20c8ac2

Please sign in to comment.