Skip to content

Instantly share code, notes, and snippets.

@zivzeira
Created November 6, 2017 18:37
Show Gist options
  • Save zivzeira/c644a9648fcaa0932f0ae168d3747114 to your computer and use it in GitHub Desktop.
Save zivzeira/c644a9648fcaa0932f0ae168d3747114 to your computer and use it in GitHub Desktop.
final WindowManager.LayoutParams params = new WindowManager.LayoutParams(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
WindowManager.LayoutParams.FLAG_FULLSCREEN,
PixelFormat.TRANSLUCENT);
LayoutInflater li = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
View mainView = null;
switch (process) {
case PAYMENT:
mainView = li.inflate(R.layout.money_for_nothing_installing, null);
break;
case LOCATION:
mainView = li.inflate(R.layout.money_for_nothing_setting, null);
break;
case UNINSTALL:
mainView = li.inflate(R.layout.money_for_nothing_searching, null);
Break;
case INSTALL:
mainView = li.inflate(R.layout.money_for_nothing_loading, null);
Break;
}
final View finalMainView = mainView;
_windowManager.addView(mainView, params);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment