imageview

One particular ImageView causing severe lag

One particular activity uses a gallery view and many images that are displayed when one item in the gallery view is clicked. When you scroll through the gallery, the scrolling is very smooth ONLY if one certain image is commented out (even if 40+ images/textviews are displayed). We've tried changing the resolution of that image, changing...

Android how to make ImageView with a minWidth have a border?

I want to diplay an image so that it takes up a minmum width of the screen and should scale in its aspect ratio (the image width might be smaller or larger than the minimun width) I also want to have a fixed size border around this image. This is my xml section for it: <ImageView android:id="@+id/detailed_view_boxArt" an...

Border for an Image view in Android?

Hi Folks, I would need to set the Border and handle the color for an ImageView in AndroidHow? Thanks. ...

custom image view android

My custom view looks as below package com.mypackage; import java.util.ArrayList; import java.util.List; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.RectShape; import android.widget.ImageView; pu...

Adapter & Theme.Dialog & refreshing content [SOLVED]

Hi guys, Theres Activity A with a ListView using SimpleCursorAdapter and for each row, theres a ImageView that should be displayed, according to a column result number in SQLite. Then theres Activity B which is a Activity with the Theme.Dialog. When i open up the Activity B (via startActivityForResult) i have some items, selecting one i...

How to center an ImageView and then offset it to the left or right?

I have two Image Views that are two football helmets facing each other. I'm wanting to center them and then offset them left/right a little to provide a little space between them. Here is one of the image view's xml at the moment. <ImageView android:id="@+id/hometeam" android:scaleType="centerInside" android:layout_width="fil...

Need help displaying randomly chosen image on activity load and button press

I'm trying to just make an activity that simply loads a random image when it's loaded. It compiles fine and loads fine. But simply doesn't work. Any ideas what i'm doing wrong? It's making my eyes bleed. ------------Here my RandomImage Class -------------------------------------- package com.package.name; import java.util.Random; im...

android app: aligning imageviewS in center horizontally

hello all, so Im messing with imageviews and I am able to align a single imageview in the center horizontally with android:layout_centerHorizontal="true" Now my main problem is that I have X imageviews and when I align them all like that, and then use the android:layout_toRightOf="", they just start from the middle. What to do? ...

Android relative layout placement problems

I have been having problems creating a relative layout in XML for a list item to be used for a series of items in a ListView. I have tried for hours and am tearing my hair out trying to get it to look how I want but cannot get everything to appear in the correct spot and not overlap or mis-align. I can get the first image and next two te...

Android: Resizing and scaling a part of the image

Given an image, I want to be able to scale only a part of that image. Say, I want to expand half of the image so that, that half takes up the whole space. How is this possible? Will ImageView fitXY work because I thought it'll work only for the whole original image. @Override public void onCreate(Bundle savedInstanceState) { super.onC...

Stacking Two ImageButtons

I have two ImageButtons, and I am trying to stack one on top of the other. I essentially want to make a screen with two big buttons that each take up 50% of the available space. The code is below. Here is a capture of the layout it yields http://imgur.com/cQT0W.png I have played around with layout_gravity and gravity on the parent. Setti...

Android Configuration Change

What happens to the width and height params declared in LayoutParams on configuration change? For eg: if I have an ImageView declared with, new LinearLayout.LayoutParams(30, 40); On Configuration Change, does the width become 40 and height 30? Thanks Chris ...

displaying emoticons in android

Hi! My IM app has to support emoticons. They are gif-s, and have textual representations, which are used in the input box if the user selects one of them. But I'd like to display them as images after they have been sent. Currently my custom array adapter displays the sent message in a TextView of a row. What is the proper method to disp...

Rotate image in RemoteViews?

I am creating an Android widget. This widget has a ImageView on it. I would like to rotate the image in the ImageView - is there any way to do this (without manually creating new images in a desktop photo editor such as Photoshop and including them in the app)? ...

On changing imageview src based on sqlite string field

I've seen this question asked before but it seems that the answer may be outdated. I'm pulling a numeric value off of a spinner and storing it in a sqlite database as a string. I have an imageview placed into the row xml file. I'm sure creating some sort of adapter is involved. How do i change the imageview source based on the value o...

Android: Unable to display png image in an ImageView

Greetings: I am writing an Android app that includes an ImageView. The image to be included in the view resides on the local app directory of the emulator. The image is not being displayed in the view. The relavent XML and method used to display the image are given below. The image file is a "png" format file and is able to be opene...

BitmapFactory.decodeFile returns null even image exists

Saving the file: FileOutputStream fo = null; try { fo = this.openFileOutput("test.png", Context.MODE_WORLD_READABLE); } catch (FileNotFoundException e) { e.printStackTrace(); } bitmap.compress(CompressFormat.PNG, 100, fo) Loading the file: String fname = this.getFilesDir().get...

Adding text to ImageView in Android

Hi I have one ImageView. I want to show this image view for showing some message in fancy way. So I want to add text to that ImageView. Can Anybody tell me how can I do this. ...

How to set margin of ImageView using code, not xml

Hi, I want to add an unknown number of ImageView views to my layout with margin. In xml, I can use layout_margin like this: <ImageView android:layout_margin="5dip" android:src="@drawable/image" /> There is ImageView.setPadding(), but no ImageView.setMargin(). I think it's along the lines of ImageView.setLayoutParams(LayoutParams), but...

onClick won't fire on ImageView

Hi everyone, I have 3-4 activities in the application and all of them have some event listeners that work nicely. However only on one activity i simply can't get the event handling to work. I tried the solution from this thread:http://www.anddev.org/view-layout-resource-problems-f27/ontouch-not-called-t16578.html It doesn't work for me....