android-image

How to filter out unwanted files using Intent.ACTION_GET_CONTENT

我的未来我决定 提交于 2019-12-07 16:42:41
问题 I'm using intent.ACTION_GET_CONTENT to allow a user to select images or video files only. this is the way am preparing my intent Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("image/* | video/*"); intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true); intent.addCategory(Intent.CATEGORY_OPENABLE); XActivity.startActivityForResult(intent, ACQUIRE_IMAGE_AND_VIDEOS_CODE); When i click the button that start this intent, the following apps are display in my customized dialog below

Why do we (have) to use different launcher icons (xhdpi, hdpi, etc)

扶醉桌前 提交于 2019-12-07 10:21:02
问题 I was wondering, why are we using different launcher icons (sizes) in android. Currently you "have" to resize your icon to: LDPI - 36 x 36 MDPI - 48 x 48 HDPI - 72 x 72 XHDPI - 96 x 96 And put them in the desired folder. But does it really matter if you would only put a xhdpi icon in your android application, and if you just leave the ldpi, mdpi and hdpi folder empty. If you try the app with this configuration (only a xhdpi icon) on a mdpi device, automatically the xhdpi icon is used (I

Error No resource found that matches the given name (at 'src' with value '@drawable/button1')

ぐ巨炮叔叔 提交于 2019-12-07 05:19:44
问题 I thought the book had incorrect code. Tried at my home location and it worked. Found out that my eclipse was actually broken. Had to remove and re install eclipse. This is my first post here so if I didn't follow some of the rules please let me know. I tried to search and found a few post with the same error but they dealt with strings. I'm following Android Apps for Absolute Beginners (2nd Edition) and on page 179 you bring button1.xml into your res/drawable. When I go in layout/activity

Animate image's saturation

心不动则不痛 提交于 2019-12-07 02:30:35
问题 Is it possible to animate the saturation of an image (e.g. png) over time? For example from grayscale to full color. Plus if I can use an Interpolator. I have seen the EffectFactory and the ColorMatrix classes but I cannot combine them with an animation/transition. E.g. applying grayscale saturation on a Drawable drawable : ColorMatrix matrix = new ColorMatrix(); matrix.setSaturation(0); ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix); drawable.setColorFilter(filter); and

Detect if resolution is too high on Android Lollipop

天大地大妈咪最大 提交于 2019-12-06 13:53:32
问题 I have to display some pictures in an ImageView. Some of them may have a resolution too high that gives me W/OpenGLRenderer﹕ Bitmap too large to be uploaded into a texture (3744x5616, max=4096x4096) I used this method to detect this situation: public boolean isResTooHigh() { int[] maxSize = new int[1]; GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSize, 0); return (maxSize[0] < width) || (maxSize[0] < height); } where width and height are provided by the source of the pictures. But now on

Picasso New Version 2.5.2: Not Working with Transformation

孤街醉人 提交于 2019-12-06 11:35:15
Hello Picasso+Android Users, I have used following version of Picasso and its working with following Transformation snippet: compile 'com.squareup.picasso:picasso:2.3.2' and created following Transformation for Image Transformation : public class ImageTransformation implements Transformation { int maxWidth; int maxHeight; public ImageTransformation(ImageView imageView) { this.maxWidth = imageView.getWidth(); this.maxHeight = imageView.getHeight(); } @Override public Bitmap transform(Bitmap source) { int targetWidth, targetHeight; double aspectRatio; if (source.getWidth() > source.getHeight())

How Can I Get Thumbnails For Picasa Images Selected From The Gallery?

折月煮酒 提交于 2019-12-06 10:49:11
问题 I'm working on an application where the user is able to select files, either a new image from the camera, an image from the gallery, or a plain old file. It then shows an icon and the name for the selected item. I have this working with one exception. The gallery application integrates picasaweb pictures. If the user selects a picture from a picasa album, I'm not able to get a thumbnail for it. I'm using the MediaStore.Images.Thumbnails.getThumbnail() method, and it works for other images in

Supporting multiple screens on Android

陌路散爱 提交于 2019-12-06 10:12:41
Have read the doc which is lengthy and still not clear. Assuming I have an image with size = 120px * 80px, under the default mdpi/160 density, I also need to prepare ldpi = 90 * 60 hdpi = 180 * 120 xhdpi = 240 * 160 Are the calculation above right? Assume I only have a single layout, so what I need is to prepare the images and place them under the corresponding drawable folders, right? Thanks Yes, those are the correct sizes. Yes, just put your various versions in the res/drawable-ldpi, -mdpi, -hdpi, and -xhdpi folders and you're done. Depending on your image -- specifically whether it still

Using the system image for “no picture” contacts on Android

亡梦爱人 提交于 2019-12-06 07:25:21
I found this question which is the same problem that I would like to address. Reading his question and the accepted answer though, it sound like his approach was to pull the actual image file from the resources, embed it in his app and use it as a local resource. What I'd prefer to be able to do is in the source property for my image, use an ID which would allow me to pull that image from the local system, so that whether my app is running on ICS, HC, GB or Froyo, or if the manufacturer of the device has altered the Android source and included their own image for empty contact photos, that my

android transition

為{幸葍}努か 提交于 2019-12-06 01:06:31
I am using the following code to set an animation between 2 images for my SplashScreen: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash); // Show A Transitions for Splash image here. TransitionDrawable transition = (TransitionDrawable) getResources() .getDrawable(R.drawable.splash_animation); //Set interval for the transition between two image. transition.startTransition(5000); //Fetch imageView from your layout and apply transition on the same. ImageView imageView= (ImageView) findViewById(R.id.splash_image); imageView