android-windowmanager

Is possible remove an overlay with WindowManager when press back or home button in android?

两盒软妹~` 提交于 2020-01-07 03:00:10
问题 I'm trying to find some answer to my question in the site but I don't found anything, and I'm not sure if is possible remove or hide the overlay with windowManager when press back or home button. This is that I have now. I put an overlay using accessibility service that cover all the screen when the user go to setting screen of my app. WindowManager show the overlay, but when I try to press back button or home button it doesn't work. Seems like is blocked. Only disappear the overlay when the

Keeping Android camera open across activities

人盡茶涼 提交于 2020-01-06 03:05:40
问题 I'm trying to open the Android camera and keep it running in the background constantly across multiple activities for a variety of long-running frame consumers for both Glass and non-Glass devices. This means I can not simply close the camera when one activity stops and re-open it when the next one starts; it must stay open the entire time. I've tried creating a SurfaceView using the Application as the Context (rather than an Activity) and adding it directly to the WindowManager. This does

How can I display a code drawn line over other apps?

不羁岁月 提交于 2020-01-02 09:28:12
问题 Details: I would like to add a code drawn line (like you draw with canvas/paint) and display it over other applications. I currently have an application that allows me to display an image over other application. See my Stackoverflow answer for my code. I have implemented the permission to do so: android.permission.SYSTEM_ALERT_WINDOW I have tried to add a canvas/paint to the WindowManager without errors, but my app crashed. I have tried searching for an answer, but have turned up empty. If

How can I display a code drawn line over other apps?

萝らか妹 提交于 2020-01-02 09:28:05
问题 Details: I would like to add a code drawn line (like you draw with canvas/paint) and display it over other applications. I currently have an application that allows me to display an image over other application. See my Stackoverflow answer for my code. I have implemented the permission to do so: android.permission.SYSTEM_ALERT_WINDOW I have tried to add a canvas/paint to the WindowManager without errors, but my app crashed. I have tried searching for an answer, but have turned up empty. If

Avoid layout change animations in custom view, that's updated in the WindowManager

馋奶兔 提交于 2020-01-01 06:43:39
问题 I have a custom RelativeLayout and I even have set setLayoutTransition(null); . I add this custom view to the WindowManager with ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).updateViewLayout(this, layoutParams); I change views in the custom view AND I change the LayoutParams for the WindowManager and afterwards call updateViewLayout ... I think, the chang of the LayoutParams for the WindowManager is animated, but I'm not sure... How can I disable ALL animations? 回答1:

Getting window display from service android

僤鯓⒐⒋嵵緔 提交于 2019-12-30 06:33:53
问题 I am trying to display a window from service but don't getting it how to do this Here is my code-- In onStart method of Service LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.main1, null); WindowManager manager = (WindowManager) getSystemService(WINDOW_SERVICE); WindowManager.LayoutParams params = new WindowManager.LayoutParams(); params.type = 2002; params.format = 1; params.flags = 40; params.height = WindowManager

Getting window display from service android

谁说胖子不能爱 提交于 2019-12-30 06:33:27
问题 I am trying to display a window from service but don't getting it how to do this Here is my code-- In onStart method of Service LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.main1, null); WindowManager manager = (WindowManager) getSystemService(WINDOW_SERVICE); WindowManager.LayoutParams params = new WindowManager.LayoutParams(); params.type = 2002; params.format = 1; params.flags = 40; params.height = WindowManager

Receiving hidden status bar/entering a full screen activity event on a Service

两盒软妹~` 提交于 2019-12-29 00:40:51
问题 I have a service that adds some views to the window manager (something like facebook's chat heads). This views stay on top of everything all the time, even when I'm on the camera app. Is it possible to know when some activity (like the camera or a video player) is using full screen so I can hide my views? Edit: There's something called View.OnSystemUiVisibilityChangeListener but it requires API 11. My target is 9, but it looks like this is exactly what I need. Any alternative for API 9? 回答1:

Receiving hidden status bar/entering a full screen activity event on a Service

限于喜欢 提交于 2019-12-29 00:40:36
问题 I have a service that adds some views to the window manager (something like facebook's chat heads). This views stay on top of everything all the time, even when I'm on the camera app. Is it possible to know when some activity (like the camera or a video player) is using full screen so I can hide my views? Edit: There's something called View.OnSystemUiVisibilityChangeListener but it requires API 11. My target is 9, but it looks like this is exactly what I need. Any alternative for API 9? 回答1:

Android View resize and WindowManager: unwanted transition during child view placement

夙愿已清 提交于 2019-12-25 18:14:39
问题 I'm having some problems in avoiding an unwanted transition during child view placement in a custom ViewGroup after parent view resizing. This problem seems to be only present when using the WindowManager instead of the call to setContentView() . Here is a short example: MainActivity : public class MainActivity extends AppCompatActivity { private static final int MY_PERMISSIONS_DRAW_OVER_OTHER_APPS = 1; CustomViewGroup mCustomViewGroup; WindowManager mWindowManager; @Override protected void