android-imageview

ImageView not keeping max height and width

与世无争的帅哥 提交于 2019-12-20 10:58:50
问题 I load an image into an ImageView using .setImageURI(selectedImageUri) that is retrieved from the user's photo gallery. I have the image view restrict the size with android:maxHeight="150dp" android:minHeight="150dp" android:maxWidth="150dp" android:minWidth="150dp" It's fine up until the you add the image from the gallery. The image then forgets about the max height and width. It is as wide as the display and there is a lot of space above and below the image. I had to add a scrollview just

How to fade in picture in ImageView loaded from url

ぐ巨炮叔叔 提交于 2019-12-20 10:55:25
问题 I would like to apply a fade-in animation to an ImageView to create the effect that the image, which is loaded from a url, fades in when the download is completed. I know how to download an image from a url to an ImageView, like in this answer, and I know how to apply a fade-in animation to an imageView like here. This attempt Drawable d = ImageUtils.fetchDrawable("the url"); imageView.setImageDrawable(d); imageView.startAnimation(fadeInAnimation); results in a blink effect (see, not see,

Gif not animated in custom listview

感情迁移 提交于 2019-12-20 09:45:39
问题 I want to display animated GIF images in my custom listview.my GIF image is get in web service url.GIF image displayed but not animated. public class NewsScreenAdapter extends BaseAdapter { LayoutInflater inflater; public GifDecoderView webview1; public static viewholder holder; View view = null; public static Context context; public ImageLoader IL; public String imgUrl; public static String addurl; public Activity activity; String image; public static Date parsed; public static String ac,

Rotate an Imagewith Animation

一笑奈何 提交于 2019-12-20 09:15:14
问题 What I Have I have an arrow image (like the left one). When the user clicks on it, it should rotate 180 degree with an animation and should look like the right one. What I Have Done private void rotate(float degree, final int toggleV) { final RotateAnimation rotateAnim = new RotateAnimation(0.0f, degree, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f); rotateAnim.setDuration(500); toggle.startAnimation(rotateAnim); rotateAnim.setAnimationListener(new Animation

How can I share images from an Array that uses ImageView feature?

心已入冬 提交于 2019-12-20 07:32:17
问题 I have a doubt. How can I share images from an Array that uses ImageView feature? My array has more than 100 images, an example: Final int [] photos = { R.drawable.abrir_a_boca, R.drawable.rooms, R.drawable.firmly, R.drawable.agradeca, R.drawable.alfaiate, R.drawable.ancora, } To share I'm trying to use Intent.ACTION_SEND Set.setOnClickListener (new View.OnClickListener () { @Override Public void onClick (View v) { Intent sharingIntent = new Intent (Intent.ACTION_SEND); Uri screenshotUri =

How to adjust background image size to fit the app screen size in android

有些话、适合烂在心里 提交于 2019-12-20 04:10:34
问题 I am using a s4 galaxy and I downloaded the following wallpaper wallpaper http://www.sswallpaper.com/get/samsung-galaxy-s4-wallpapers/Keep-Running-1080x1920/595-2.jpg I trying to use this wallpaper as the background image but the image does not fit into my screen. How do I adjust the size to fit the screen size of my app? Here is my Xml code: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

Fragment for Image Viewer (Android)

痞子三分冷 提交于 2019-12-20 04:06:10
问题 I'm trying to create a simple fragment that merely displays an image when clicked. I'm getting numerous errors inlcuding "the method findViewbyId(int) is undefined for the type ExampleFragment", "Inflater cannot be resolved", and "imageview_main cannot be resolved or is not a field." imageview_main is a layout I have created, imageView1 is an image contained in that layout. Here is the fragment code: package com.firstproject.simplemenu; import android.app.Activity; import android.os.Bundle;

Fragment for Image Viewer (Android)

巧了我就是萌 提交于 2019-12-20 04:06:01
问题 I'm trying to create a simple fragment that merely displays an image when clicked. I'm getting numerous errors inlcuding "the method findViewbyId(int) is undefined for the type ExampleFragment", "Inflater cannot be resolved", and "imageview_main cannot be resolved or is not a field." imageview_main is a layout I have created, imageView1 is an image contained in that layout. Here is the fragment code: package com.firstproject.simplemenu; import android.app.Activity; import android.os.Bundle;

Dynamically setting ImageView.setImageUri not displaying image

雨燕双飞 提交于 2019-12-20 03:02:36
问题 I have the following scenario: I am dynamically assigning an image URI to an ImageView, and then dynamically adding this ImageView to a HorizontalView. The problem is, I don't see these images loaded in the ImageView, inside the HorizontalView. Here is my code: <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="100dp"> <LinearLayout android:id="@+id/imageDisplayer" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation=

Save image from ImageView to device gallery

自古美人都是妖i 提交于 2019-12-20 01:07:21
问题 I'm trying to save an image from ImageView to devices gallery. I tried this code Code Edit: URL url = new URL(getIntent().getStringExtra("imageURL")); File f = new File(url.getPath()); addImageToGallery(f.getPath(), this); public static void addImageToGallery(final String filePath, final Context context) { ContentValues values = new ContentValues(); values.put(MediaStore.Images.Media.DATE_TAKEN, System.currentTimeMillis()); values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg"); values