overlay

Settings.canDrawOverlays is returning false even after turning the permission on from settings

孤人 提交于 2019-12-10 15:22:47
问题 I am trying billow Code from this answer to check if the permission is enabled. but it is returning false even when the permission is enabled from the settings. public static boolean canDrawOverlayViews(Context con){ if(Build.VERSION.SDK_INT< Build.VERSION_CODES.LOLLIPOP){return true;} try { return Settings.canDrawOverlays(con); } catch(NoSuchMethodError e){ return canDrawOverlaysUsingReflection(con); } } public static boolean canDrawOverlaysUsingReflection(Context context) { try {

Capture screen shot on Android phone when playing video and camera preview

落爺英雄遲暮 提交于 2019-12-10 14:35:20
问题 I have two HTC phones, one is HTC desire and another is HTC aria. I'm using ddms to capture the screenshot on HTC desire before, it works fine. However recently I buy one HTC aria, and I found when doing screenshot on camera preview and video playing (e.g. youtube clips), the result goes black. I think that might be some overlay issue, but just can't figure out how do capture screenshots on camera preview. 回答1: Sorry, this is probably just not possible. Prior to Android 3.0, the DDMS

How to detect when device goes to multi-window mode of Android N

谁都会走 提交于 2019-12-10 14:34:28
问题 I want to get notified from my background service when the user switches to multi-window mode. Is there a way to get this information by a service other than the activities involved in the process. Also I have noticed that when an overlay is clicked on the area of the foreground window it automatically switches to the activity under the area. Can this be prevented? 回答1: You must add ViewTreeObserver. And check if device enter in Multi-Window mode getActivity().isInMultiWindowMode() 回答2:

Using a div as a clipping mask in css

北城余情 提交于 2019-12-10 13:49:45
问题 I have a background image that has background-size:cover; applied to it and then a series of divs overlaid which I would like to become individual clipping masks. I've looked at the feature clip: rect(20px, 20px, 20px, 20px,); however as the divs are brought in through a CMS system, it will be inappropriate to define set sizes. Is there a way of setting the div with a clipping mask property so that it clips the image anywhere the div is placed on the page? I don't particularly want to use an

MVC3 - Ajax actionlink - OnBegin, onComplete

≯℡__Kan透↙ 提交于 2019-12-10 13:43:33
问题 Using MVC3, C#, and the Razor View Engine: I have a form that has an Ajax Action link. In the options I'm trying to specify OnBegin and OnComplete javascript function calls. In this question, I took out the meat of the functions and simply added alerts so that I could verify that the functions where being hit. What I really want to do with these functions is to use $.blockUI for the duration of the ajax call. The pertinent code looks like this: @Ajax.ActionLink("my test link", "myAction", new

Google maps api not placing marker at fine location

白昼怎懂夜的黑 提交于 2019-12-10 13:08:31
问题 My code is supposed to find out the users location and place a marker on the map upon entering the application. My location value always equals null, and never receives a value. if (location != null) { lat = (int) (location.getLatitude() * 1E6); longi = (int) (location.getLongitude() * 1E6); GeoPoint ourLocation = new GeoPoint(lat, longi); OverlayItem overlayItem = new OverlayItem(ourLocation, "AYO", "Whats good yo"); CustomPinpoint custom = new CustomPinpoint(d, CampusMap.this); custom

There is no scroll after adding an Overlay to MapView

扶醉桌前 提交于 2019-12-10 10:41:42
问题 I'm fighting with following problem now: I add a simple overlay to my mapview. It doesn't draw anything, it is just a help overlay for detecting scroll is ended (see response) Here is the code of it: public class ScrollDetectionOverlay extends Overlay { private static GeoPoint lastLatLon = new GeoPoint(0, 0); private static GeoPoint currLatLon; protected boolean isMapMoving = false; private MapScrollingFinishedListener listener = null; public void setListener(MapScrollingFinishedListener

Prevent background scrolling when overlay appears

落花浮王杯 提交于 2019-12-10 10:37:40
问题 I have written my own modal classes using css and have used it in my application successfully. However the issue i'm facing is when the overlay is open i can still scroll the background contents. How can i stop scrolling background contents when my modal/overlay is open? This is my modal which opens on top of the overlay <div> <div className="overlay"></div> {this.props.openModal ? <div> <div className="polaroid sixten allcmnt_bg_clr horiz_center2"> {} <div className="mobile_header">

GestureDetector within a TYPE_SYSTEM_OVERLAY

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 10:36:46
问题 I have created a TYPE_SYSTEM_OVERLAY and i wish to capture finger/touch events on this overlay using a service . The overlay works fine, but the problem is it cannot capture touch events when i try to incorporate the GestureDetector in it. When i tap on screen, the toast msg "onDown" didnt show.. will appreciate if anyone tells me where have i went wrong :( I have tried implement the GestureDetector outside of the OverlayView class but also no result. public class NUSLogService extends

How to draw routes that aren't on roads, MKMapView

ε祈祈猫儿з 提交于 2019-12-10 10:35:33
问题 So i've been experimenting with the MKMapView and overlay to create "roads that aren't on roads". That may sound weird but what I was trying to do is that in my app for iOS i want to draw the excursion routes that a specific hotel offers, however all the posts i found so far were focusing on existing roads, since the excursions go through forests, over rivers etc. there are no roads to help me. Since there were no roads i had to improvise so I decided to make a plist(I probably could have