android-windowmanager

Pass through touch events on window overlay to an Activity behind it

荒凉一梦 提交于 2019-12-06 07:05:20
问题 Some context. I have a RelativeLayout that is added with a WindowManager the type is TYPE_SISTEM_ALERT with the flags FLAG_NOT_TOUCH_MODAL FLAG_WATCH_OUTSIDE_TOUCH . I'm able to get touch events either on this RelativeLayout or in the Activity "behind" it, but as long as it's not part of the "RelativeLayout window" added. * The black bars are the Views on my RelativeLayout; * the red rectangle is the whole container of this RelativeLayout; * the yellow stars are the spots of space that is

Can't remove overlay view

百般思念 提交于 2019-12-06 05:02:54
问题 Update I was able to fix this, The problem was dialogs and related could be initiated from broadcast receiver but not recommended, as the activity running ends before the view. Trying to implement overlay like fb messenger, truecaller etc. public class IncomingCall extends BroadcastReceiver { private Context pcontext; private static final String TAG = "CustomBroadcastReceiver"; TelephonyManager telephony; CustomPhoneStateListener customPhoneListener ; @Override public void onReceive(Context

Android navigation bar overlay

巧了我就是萌 提交于 2019-12-06 03:50:12
问题 For my application I have to draw a bitmap on top of the Navigation bar on the bottom of the android screen. I am curious to know if the WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY can be used to overlay the navigation bar? 回答1: Use the WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS should work :) 来源: https://stackoverflow.com/questions/21382283/android-navigation-bar-overlay

popup window like any.do

坚强是说给别人听的谎言 提交于 2019-12-06 03:45:42
问题 i am writing an app that shows missed calls and unread sms in a pop up window. it also has a reminder feature (to close the pop up window and open it after a specified time). its similar to the popup window of any.do. i was able to created such a window by using the WindowManger, but for some reasons which i dont understand so far, the pop up window disappears after some time (although it should be opened untill the user closes it, or clicks on the reminder button which could take hours).

With security keyguard active transition between activities is weird

穿精又带淫゛_ 提交于 2019-12-06 02:00:46
I have my main activity A and when the user presses a button i open another activity B. But when this happens B doesn't just appear on top of A: A disappears secure keyguard shows up B appears And when i get rid of B the same thing happens. This is annoying because there's a lot of flickering with no real purpose on the screen. Is there any way to achieve direct transition from A to B while keyguard is active without merging the 2 activities into 1? Here is what i'm doing in onCreate for both activities: getWindow().addFlags( WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager

Android Resize View in Windowmanager

不羁的心 提交于 2019-12-06 01:42:27
Here is my code : menubuttonClosed = li.inflate(R.layout.menu_button, null); menubutton = (ImageButton) menubuttonClosed.findViewById(R.id.menubutton); params = new WindowManager.LayoutParams( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_SYSTEM_ALERT, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,// | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, PixelFormat.TRANSLUCENT); params.x = 0; params.y = 0; params.gravity = Gravity.CENTER; menubutton.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch

Android overlay on top of software buttons

醉酒当歌 提交于 2019-12-05 18:01:32
I am trying to write an app that draws a custom mouse pointer. I currently have a service that creates a class that extends ViewGroup and uses the WindowManager system service to display it as a TYPE_SYSTEM_OVERLAY with the FLAG_LAYOUT_IN_SCREEN set. This almost works. On my tablet (Samsung Galaxy Tab 7.7) and in the emulator set to tablet mode, it is laid above everything except the bottom status bar (with the soft home, back keys and the notification area). In the emulator, there are no software buttons on screen, but it is laid on top of the notification bar. I've also tried the solution in

Cannot remove a view attached by windowManager.addView()

时间秒杀一切 提交于 2019-12-05 12:15:48
I'm trying to remove a layer added to WindowManager. But nothing happens when I call removeView(). Does anybody know how to remove it? My code looks like this. public class MainActivity extends Activity implements View.OnClickListener{ private WindowManager wm; private WindowManager.LayoutParams orientationLayout; private LinearLayout orientationChanger; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // init landscape things wm = (WindowManager) getApplicationContext().getSystemService(Service.WINDOW_SERVICE); orientationChanger = new

Oreo (API 26) - drawOverlay + draw over status bar

ぃ、小莉子 提交于 2019-12-04 16:25:47
问题 In android oreo, I can't use WindowManager.LayoutParams.TYPE_SYSTEM_ERROR anymore and must use WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY instead. The drawback is, that this mode does not draw over the statusbar. Is there anyway to achieve the old behaviour and be able to draw over the statusbar as well? I've a sidebar app and until now, I allowed the user to have trigger areas on top of the screen as well, which does not work anymore now, because the status bar is overlapping the

Can't remove overlay view

。_饼干妹妹 提交于 2019-12-04 11:27:01
Update I was able to fix this, The problem was dialogs and related could be initiated from broadcast receiver but not recommended, as the activity running ends before the view. Trying to implement overlay like fb messenger, truecaller etc. public class IncomingCall extends BroadcastReceiver { private Context pcontext; private static final String TAG = "CustomBroadcastReceiver"; TelephonyManager telephony; CustomPhoneStateListener customPhoneListener ; @Override public void onReceive(Context context, Intent intent) { pcontext = context; Bundle extras = intent.getExtras(); if (extras != null) {