screen

How do you tell Android not to scale images?

这一生的挚爱 提交于 2019-12-30 11:17:10
问题 I have some pictures in the /drawable folder, which to my understanding is intepreted as /drawable-mdpi. Now these images are scaled when being used (depending on the device). I don't want to add more pictures, because they don't exist. And I don't have the resources to create different res pictures. I just want the pictures to appear smaller on bigger devices. Is there a way of not scaling the images? I'd hate to have to hard-code all the picture sizes. This is the second question, as edits

Android get full View as Bitmap [duplicate]

浪尽此生 提交于 2019-12-30 11:13:10
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Android 2.1 View's getDrawingCache() method always returns null I hava a Layout which I want to save an bitmap. If my Layout is smaller than the screen everything is fine. But if my Layout is bigger, the bitmap (b) is null. This is my code: layout.setDrawingCacheEnabled(true); int wt = layout.getMeasuredWidth(); int ht = layout.getMeasuredHeight(); layout.layout(0, 0, wt, ht); Bitmap b = layout.getDrawingCache

Screenshot while using the camera (Android)

喜你入骨 提交于 2019-12-30 07:21:08
问题 I'm trying to make a snapshot of my app. The problem I have is that this app is intented to be a augmented reality app and I have a view with some layers and the background layer is the camera view. I tried it by enabling and getting root view drawing cache but the result was a bitmap with a black background and the rest of the layers on it. Also, to get the camera os a background again I had to disable the cache and restart the camera. (i.e. How to programmatically take a screenshot in

PHP function to grab all links inside a <DIV> on remote site using scrape method

亡梦爱人 提交于 2019-12-30 07:18:45
问题 Anyone has a PHP function that can grab all links inside a specific DIV on a remote site? So usage might be: $links = grab_links($url,$divname); And return an array I can use. Grabbing links I can figure out but not sure how to make it only do it within a specific div. Thanks! Scott 回答1: Check out PHP XPath. It will let you query a document for the contents of specific tags and so on. The example on the php site is pretty straightforward: http://php.net/manual/en/simplexmlelement.xpath.php

How to position 400 x 400px popup div relative to click, keeping in screen view

北城以北 提交于 2019-12-30 06:55:27
问题 Preferably with jQuery since it's so much easier to understand. The following works great for horizontal. The issue is vertical can be cut off on top requiring the user to scroll up to see the entire popup. function pop_IT(X,event){ dist_to_right_edge = $('body').innerWidth()-(x-$.scrollbarWidth()); dist_to_bottom = $(window).height()-y; X=$('#'+X).get(0); X.style.left = 5+x+"px"; X.style.top = 5+y+"px"; if(dist_to_right_edge < (X.offsetWidth+5)){X.style.left = x - X.offsetWidth-5+"px";} if

Custom Lock Screen Delay When Wake

天涯浪子 提交于 2019-12-30 05:35:07
问题 I'm trying to make a custom lock screen app, but I'm not sure if I'm going about it the right way. I have a broadcast receiver that listens to when the screen is turned on and starts my lock screen activity. This receiver is registered inside a service, which also disables the default lock screen. The problem is, there is a slight delay between when the screen is turned on and the lock screen activity shows up. How would I go about doing it so that it shows up right away? My code for the

how to get total screen size on an android device programmatically

耗尽温柔 提交于 2019-12-30 04:40:18
问题 if i use the code shown here to get the total screen size it is always short on height to the total screen size as shown in the documented specs for the device. for example I tried to get the screen size by using the code to get the size for a tablet listed as 1280 X 800 and the result from the code is: 1216 X 800. so where is the missing 64 pixels going to? i can guess that it could be the bar at the bottom of the screen that holds the back and home buttons. but that does not sound right as

Display UIView Above Apple Status Bar in iOS 8

可紊 提交于 2019-12-29 08:20:10
问题 I know there have been some questions posted about this, but none have helped me with my specific issue. I would like to display a custom modal above the entire screen, but I would like to keep the Apple status bar visible. For the modal, I am using one UIView for the dimming effect and another for the actual view that the user would interact with. The entire modal is then added as a subview to the current view and brought to the front. Essentially, I am trying to replicate the behavior of

screen.width + android

荒凉一梦 提交于 2019-12-28 13:57:09
问题 If I trace out the screen.width with my DroidX native browser, I first receive 320 as expected, but on subsequent reloads (without changing orientation) I receive 800... why is this? 回答1: It is an Android bug. Sometimes when page first loads the window.screen.width and window.screen.height are wrong. You can try to make a timeout and then run your code. setTimeout(YourFunction, 200); Also see here android issue 来源: https://stackoverflow.com/questions/5021090/screen-width-android

Android Market filters app - Telephony?

醉酒当歌 提交于 2019-12-28 13:53:32
问题 I have the following Manifest: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.myapp.MainActivity" android:versionCode="1" android:versionName="1.0.0" > <supports-screens android:anyDensity="false" android:largeScreens="true" android:normalScreens="true" android:resizeable="false" android:smallScreens="true" android:xlargeScreens="true" > </supports-screens> <uses-permission android:name="android.permission.RECEIVE_SMS" android:required="false" > </uses