Calculator Overlay

This commit is contained in:
Sergey Solovyev 2012-11-21 17:28:29 +04:00
parent 7643785919
commit c29863fa2f

View File

@ -46,6 +46,7 @@ public class CalculatorOverlayService extends Service implements ExternalCalcula
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
final WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE); final WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);
final LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); final LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
@ -72,8 +73,8 @@ public class CalculatorOverlayService extends Service implements ExternalCalcula
final WindowManager.LayoutParams params = new WindowManager.LayoutParams( final WindowManager.LayoutParams params = new WindowManager.LayoutParams(
300, Math.max(wm.getDefaultDisplay().getWidth() / 2, 300),
450, Math.max(wm.getDefaultDisplay().getHeight() / 2, 450),
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT, WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL|WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL|WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
PixelFormat.TRANSLUCENT); PixelFormat.TRANSLUCENT);