drawable

Android : Customizing tabs on state : How do I make a selector a drawable

I know how to put the icon on each tab, that is no problem. I also ran across this : Stack Overflow thread on pretty much same thing I followed one of the links from that question, and found this Pretty much, it said use a selector defined in the xml, sure, did that. But there is no id associated w/ it so I am not sure how to get the s...

Can The Android drawable directory contain subdirectories?

In the Android SDK documentation, all of the examples used with the @drawable/my_image xml syntax directly address images that are stored in the res/drawable directory in my project. I am wondering if it is explicitly not okay to create a sub directory within the drawable directory. For example, if I had the following directory layout:...

Create GLX context in specific region of a window

I would like to create an OpenGL context with GLX inside a window. However, I do not want it to span over the whole window region. Instead, it should only cover a subregion. For example, GLUT provides a function for this behaviour. Also major toolkits like GTK+ or QT provide GL widgets, which are only subregions of X windows. However I ...

Optimizing paging between ImageViews in Android?

Hello, everyone, For the application I'm currently working on, I created something like ImageSwitcher for multiple images (imagine iPhone's UIScrollView with paging enabled). At first, I hardcoded some ImageViews and loaded their drawable resources on creation/inflation, but after some tweaks (and what I thought were improvements), I r...

Standard Android Button with a different color

I'd like to change the color of a standard Android button slightly in order to better match a client's branding. For example, see the "Find a Table" button for the OpenTable application: The best way I've found to do this so far is to change the Button's drawable to the following drawable located in res/drawable/red_button.xml: <?xm...

Saving Drawable to Disk and retrieving - Android

how would I save a drawable to the SDcard (custom folder) and later retrieve it assuming im keeping track of the path of the saved item. Thanks, Faisal ...

Drawable => grayscale

What would be the right way to turn a color Drawable into a grayscale one (to indicate disabled state)? EDIT: B/W => grayscale ...

How can I use graphical resources (stored in res\drawable folders) from NDK?

Hello! I need to use openGL in NDK, and I need to load and use some images (PNG), and maybe other files. These files are stored in res\drawable, res\drawable-hdpi, but I cannot access them with fopen()... There is a way to do this? Can somebody give me a piece of code for my problem, because it is quite urgent. Thank you very much, and...

Android: view/ drawable custom styles possible?

What I'd like to do is change the state (really, the background) of an EditText to reflect validity of its contents. E.g. if the user enters 999 where 999 is contextually invalid, the EditText should have a red border in place of the default orange border, likewise once the text is valid it should have a green border. Methods I've expl...

BitmapDrawable with unexpected size in Android 2.0.1 WVGA854

I want to display a 480x320 JPEG file stored in the SD card in Android 2.0.1 with WVGA854 skin and 240 lcd density (Motorola Droid). However, when I create a BitmapDrawable through Drawable.createFromPath(), the resulting BitmapDrawable has the following values: mBitmapWidth = 320 mBitmapHeight = 213 mTargetDensity = 160 The manife...

memory of drawables, is it better to have resources inside APK, outside APK or is it the same for memory?

Hi I have an application that draws a lot of graphics and change them. Since I have many graphics, I thought of having the images outside the APK, downloaded from the internet as needed, and saved on the files application folder. But I started to get outOfMemory exceptions. The question is: Does android handle memory different if I l...

Android - ClipDrawable, ScaleDrawable, how does it work?

I'm having quite a problem here and I hope for someone here to able to help me. let's go. Let's say, I have quite a big image ( 1500x2000 ), i load it as a drawable, fine so far. Now I have a SurfaceView and I want to draw a certain region ( lets say the top-left-most region ) onto a canvas, in a non-scaled version. I thought using Cli...

How do I set the rounded corner radius of a color drawable using xml?

On the android website, there is a section about color drawables. Defining these drawables in xml looks like this: <resources> <drawable name="solid_red">#f00</drawable> <drawable name="solid_blue">#0000ff</drawable> <drawable name="solid_green">#f0f0</drawable> </resources> In the java api, they have thr following method...

android cropping drawable

hi friends... I have a small project in which i download images from internet in the form of drawable and use them in Imageview for which i have provided functionality similar to an Imagebutton but without the gray edges. The question is that is there any functionality in Android(similar to iphone) by which we can crop the drawable fro...

Multiple shapes on Android

Hi Hi I'm trying to build a layout where some shapes will popup every 2 seconds. If the user will click one of these shapes, they have to disappear. What is the correct way of doing this? I thought about a thread, but i missed out. Here's my code at the moment (is not working): public void onCreate(Bundle savedInstanceState) { ...

Refreshing a LinearLayout after adding a view

Hi I'm trying to add views dynamically to a linearlayout. I see through getChildCount() that the views are added to the layout, but even calling invalidate() on the layout doesn't give me the childs showed up. Am I missing something? ...

Drawable folders in res folder?

What is the difference between the three drawable folders in the res folder in the project hierarchy? If I have an image to put into a folder, which folder do I put it in? ...

How do i make multiple url links show in array?

Im new to droid programming and i got a simple retrieve image from url working but confused on how to make it so i can load multiple images from my webpages url. Someone informed me change the drawable to string but not sure 100% how to do so here is most of my code so far: public class Gallery extends Activity { /** Called when the act...

Applying successive animations to ImageView in Android

I would like to apply successive animations (say ScaleAnimation) to an ImageView showing a resource image. The animation is triggered by a button. For example, I would like to incrementally enlarge an image upon each button click. I've set fillAfter="true" on the animation. However, all the animations start from the original state of th...

Masking a Drawable/Bitmap on Android

I'm currently looking for a way to use a black and white bitmap to mask the alpha channel of another bitmap or Drawable on Android. I'm curious as to what the best way to do this is. I certainly have a couple of ideas for how to do this, but they are not optimal. I need to be able to apply a new mask to the image every so often (the b...