Android :: Tile A Drawable File In ImageView?
Sep 8, 2010Like the title. I have a small drawable file, but the ImageView is much larger than it. How I can fill it without left any extra space?
View 1 RepliesLike the title. I have a small drawable file, but the ImageView is much larger than it. How I can fill it without left any extra space?
View 1 RepliesI have a gridView generated using BaseAdaptor. (and implementing methods getView() , getCount() ,...) My problem is that i want to specify a drwable image for each ImageView created using BaseAdaptor.
i tried this line: myBaseAdapterInstance.getView(i, null, gridview).setImageDrawable(R.drawable.myimage);
where i is the position of the ImageView that i want.
But myImage isnt displayed on the gridView.
I have an ImageView object that I'm setting the android:src="@drawable/some_xml_file" instead of a standard png and it seems to not always render the drawable, as you can see in the first row here (it also happens intermittently in other rows as well):
I've tried setting the src & the background property but they both have the same effect. the source code from my list view row item is this:
CODE:...............
Then my res/drawable/action_box.xml is this:
CODE:................
I'm trying to add a drawable to a layout, using an ImageView, but the drawable doesn't maintain its size and is rendered at 1dp x 1dp. I've called ImageView.setAdjustViewBounds as per the android documentation but this doesn't seem to help. The Drawable is only visible when the ImageView's height and width are set and the drawable is then rendered at those dimensions.
View 2 Replies View RelatedIs related to: http://stackoverflow.com/questions/2307374/need-suggetsion-about-a-mixed-uri-int-id-images-ambient
My problem is:
CODE:......................
Does NOT work. why?
I know that
CODE:........................
work.
But that does NOT solve my problem. because I want to set the image with an uri independenty if this come from a resource or come from the camera ACTION_PICK intent...
I would like to be able to alter the size of some of my ImageViews based on what Drawable they are showing. I've not yet decided on whether I'll get them to read the new dimensions from the Drawable or if I will just have an array/enum storing the heights of these, but what I need help with is the actual changing of the ImageView size.Which of the many many function for altering sizes of things should I be using to change the size of an ImageView while still retaining it's relative positioning in the RelativeLayout it is a part of? I can't work out if I should be changing the bounds of the Drawable or if I should be redefining the LayoutParams of the ImageView or some other method altogether. The drawables are always going to be the same width, but their height will change depending on what is in each tile of a map (which this is rendering).
View 1 Replies View RelatedI have a file called nochart.png in /drawable.
How can I set this to an ImageView?
chartImageView.setImageDrawable(R.drawable.nochart);
Does not compile.
This is specifically about android UI xml.
Can a drawable ie the ,/drawable> tags accept a reference to a ninpatch xml file?
I have some problems finding the documentation of the definitions of shapes in XML for Android. I would like to define a simple circle filled with a solid color in an XML File to include it into my layout files.
Sadly the Documentation on android.com does not cover the XML attributes of the Shape classes. I think I should use an ArcShape to draw a circle but there is no explanation on how to set the size, the color, or the angle needed to make a circle out of an Arc.
I've got the URL of a .png image, that needs to be downloaded and set as a source of an ImageView. I'm a beginner so far, so there are a few things I don't understand:
1) Where do I store the file?
2) How do I set it to the ImageView in java code?
3) How to correctly override the AsyncTask methods?
I have valid JPG files and now I want to load them into a layout containing an ImageView. I have code to findViewId(R.id.myimage). I followed some sample code using File but it did not work. The file is stored at /data/data/com.myapp/files/someimage.jpg.
What is the easiest and efficient way to load and display?
I have an image on a private file.
I read the file, create the drawable, and assign it to an ImageView.
The ImageView has WRAP_CONTENT so the size is automatic.
On 320x480 screens, the image looks good
But on screens with more resolution and high density 480x800 or 480x854 (N1, droid) , when the image is for example 150x150, I see the image as 100x100.
Of course it has something to do with the density but not sure how should I resolve this.
This is my code...
if I then inspect the size of the icon, android thinks the size is 100x100, when really is 150x150.
Looks like its reducing the image by the density.
Can anybody explain this and how to avoid this.
I am running my application in the emulator using a high density skin (like WVGA800). However the ressources in my application are loaded from the drawable- mdpi folder instead of drawable-hdpi ... what else should I do so that android use the correct folder ?
View 4 Replies View RelatedIs there a way to load an image file into an ImageView object, and then define a transparent color for this object?
View 1 Replies View RelatedI'm putting together a simple test made up of two tutorials available online for OpenGL ES on Android. This is really just so that I can learn about the basics of OpenGL ES to better understand how I have to design my program.
Right now, when it tries to render, the mouse movement effect works, but I get no square drawn on the screen.
Here are the two source files I'm dealing with:
CODE:.......
The second one is the tile object itself:
CODE:........
I have a listlayout with items in it that looks like this:
There is first an ImageView (the light) and then two textViews. All of this inside a TableLayout. (source here: http://code.google.com/p/switchctrl/source/browse/trunk/android/res/layout/device_switch.xml)
I want to have a rotating animation of a loading indicator Ontop of this light when this particular device (light) performs an action or an action is performed on it.
How do I put an animation ontop of this light imageview?
I am developing checkers application for Android. I have drawn on Canvas gameboard and tiles for each side, also I have made selection of tiles by D-Pad. But what about, Android phone doesn't have D-Pad? There must be a way how to do that in touch (I touch a tile - it is selected now). Do you have any ideas?
View 2 Replies View RelatedThank to previous replies, and with a major inspiration from http://insanitydesign.com/wp/projects/nehe-android-ports/ , i started to build a simple Tile Generator for my simple 2D zelda-like game project.I can now generate a map with the same textured tile, using 2 for(..) imbricated iterations to draw horizontal and vertical tiles, and got some basic DPAD key input listeners to scroll over the x and y axis.but now im running into my first performance problems, just with one texture and one model.When trying to build a 10x10 map, scrolling is fine and smooth.When trying with 50x50, things get worse, and with a 100x100, its way unacceptable.Is there a way only to tell OpenGL to render the 'visible' part of my mapset and ignore the hidden tiles? im a totally new to this.
View 2 Replies View Relatedis it possible to draw a 9-patch that tile its border instead of stretching it?
View 2 Replies View RelatedI've been stuck for ages now trying to implement threading or background image loading for a custom tile overlay class I've been working on. I'm pretty useless when it comes to Java so threading isn't something I've had any experience with. Basically I have extended an ItemizedOverlay and in the draw() method calculate the tiles I need to display over the standard google tiles then fetch those images with a URLConnection and using BitmapFactory decode them and draw them to the canvas at the correct position on the screen so that the images are on top of the google tiles with about 50% opacity (the custom tiles are cellphone network coverage png's which are used for our web app). I initially got this all working with the tiles loading in the correct places but hit issues with memory and "freezing" while panning so implemented some basic caching and memory management to only store the tiles that are displayed on the map in memory and when downloading a tile store it to SD card.
Then I figured the freezing while panning is due to the blocking nature of downloading the images so, have been trying to implement threading. I created a class that extends AsyncTask to download the images in the background and store them to SD, in the onPostExecute method I then try to draw all the tiles. But onPostExecute never seems to fire, now I know that the AsyncTask has to be called in the main ui thread so tried to debug the execution with Thread.currentThread().getId() calls through out the code. The thread Ids through out is 1 and then 10 for the doInBackground method for the AsyncTask. Now I'm not sure if 1 is the main UI thread or not. In the extended MapActivity class I have, the onCreate method's Thread.currentThread().getId() returns 1 but I'm not sure if the MapActivity class is executed in the main ui thread? Here Romain Guy mentions that the onPostExecute method should have @Override but when I do that eclipse flags it as an error
"The method onPostExecute(Boolean...) of type TileCache.ImageLoadTask must override or implement a supertype method"
So I guess something is wrong there but the only fix eclipse offers is to remove the @Override
So I guess with out post all my source code, the question's I have are:
Is the MapActivity onCreate method called in the main ui thread?
What does the @Override error mean? or why does it show that error
Does anyone have an example of a custom tile overlay implementation with background image loading and tile caching?
how to add quick setting tile in statusbar?
View 1 Replies View RelatedI recently activated timecape and the Sony logo on my homepage was replaced with timescape stuff. How do I turn off timescape or more importantly how to get the Sony Ericsson tile back on my homepage?
View 1 Replies View RelatedI would really like to remove the timescape tile from my home page. I have some lovely pictures of my boys that I want to us as my wallpaper / display but timescape is right in the way.
View 2 Replies View RelatedJust got my Xperia X10 & I've already done that! Anyone got any idea why it wont like go away? Its connected up to the internet, facebooks set up etc contacts are all there
View 1 Replies View RelatedPAC-man ROM
Settings -> PAC-man -> Notification Drawer -> Tiles and layout
It allows me to add / remove tile. However, the quick settings remains unchanged.
Is there any way to fix this?
There's any app/widget that allows to display a live tile of images from gallery (or any other path) like the one found in launcher8?
View 1 Replies View RelatedWhen I press the home key on the X10 I get the usual stuff like Time and 4 buttons at the bottom of the screen, but at the top of the screen I get facebook stuff from the Timescape. How do I remove it with just the Sony Ericsson logo.
View 5 Replies View RelatedI've just got an X10 and although I'm sure it worked originally if I now click on a Facebook tile in Timescape it no longer loads facebook - the browser window appears but I just get no title in the progress bar thing and it goes a little bit across and then stays there forever.
View 7 Replies View RelatedIn timescape do you have to delete each tile sepaeartely?? or is there a delete all button. If you dont delete the tiles do they stay on for infinity? or is there a default amount before they are automatically binned.
View 1 Replies View RelatedI have a problem it here. I accidentally deleted the timescape tile on my home screen. Can anyone please tell me how may i restore it.
View 7 Replies View Related