9patch with custom background image - android

I've been working on this problem for 2 days now. What I'm trying to achieve is to make a bitmap fill the complete non-transparent background of a 9patch drawable (a speech bubble in this case).
Instead of this
I want something like this
(Yes, bad photoshopping, but serves its purpose.)
Is that even possible? I cannot provide any code, as I don't have any that would make my problem more clear. Sorry about that.
Regards,
D.

Related

Android 9-patch image usage

OK, I've read a lot of tutorials and even downloaded some examples, but for the love of Stackoverflow, I can't get my image to stretch like I want it to and I'm hoping that someone can help me out here.
I create an image that is to be the background of a button object in Android. Here is the image:
Now, I'd like for it to stretch to the desire size of the button, whether the button is 50x50dp or 200x100dp. One thing I don't want is the border to stretch as it will look distorted, so I want to specify not to include the border, but stretch everything else to the desired size of the button.
Can someone please show me where the black lines need to go in order to achieve my goal? Do I have to change my original image in order to achieve my goal?
Thank you in advanced.
David
It's very simple using this tool Android Asset Studio: Simple 9-Path Generator. Although no matter how you do it you will have stretching and distortion due to the textured (non-patterned) background. I would stay away from that style both personally and for usability.

Stretch button with unstretchable central region

Is there any way to stretch the button so that the central part remained intact? 9-patch doesn't allow to do this.
EDIT: I used 9-patch as Benito recommended. And it works fine. It is strange that the first time I couldn't get it.
You could do something like the image below
But make sure you make the background transparent.

How to achieve glossy look in android

One of the applications in my mobile has this glossy and transparent look(refer the snapshot below), which is quite beautiful. Just want to know how I can achieve this.
I am developing an application for myself and want to implement similar kind of GUI. Although I can create a layout, I am still not good in creating beautiful icons like the one shown above. Any information (or) a link to icon development related tutorials should also be quite helpful. Thanks everyone in advance.
Those are just PNG images with transparency and glossy effect... it almost has nothing to do with programming. Just find a good designer and tell him/her to do a 9patch image like that.
By the way... background buttons, in that case should have the border only. The icon and text can be then added easily.
You have to combine multiple techniques. You can use Button where the background will be defined with a nine-patch image, with rounded corners. Then you can use android:drawableLeft parameter of the Button, to define the icon it will have.
As also Cristian suggests, this is not hard to implement. You need a good designer and get to know the basic techniques like 9patch png images, transparency and basic layout definitions. Good luck

Recreating a specific Edit Text Effect in WunderList in Android

I recently downloaded an app from the market called WunderList and it has this neat effect on a Edit Text for transparency
I am trying to recreating the same effect for one of my applications but I am not really getting anywhere. I initially thought it is just transparency but I was wrong. Now I have put an image with shadow as the EditText's BG an trying to set it's alpha. I am not sure If I am on the right path. I would appreciate any guidance on this.
I got this done through a custom 9patch image. Here's a sample result.
It's not close but I am getting closer.
That's actually the way we do it.
We use a 9patch PNG with transparency.

Creating a 9 Patch with repeatining pattern

iam stuck with the creation of a nine patch for a progressbar background.
It has a repeating pattern like a ruler-scala and that given me headache.
here is a image of what i want(at the bottom) and what i have (top).
can someone give me a hint how to acomplish my goal?
edit: or is it generelly possible to do this with a 9patch?
my other attempt was to make a with android:tileMode="repeat" but there i get problems with the height of my image (repeating in the second line), i need something like repeat-x.
Thanks in advance
edit2: ok i managed to do my repeating 9patch by stretching the whole repeating pattern, but its not ideal :(
You seem to be overestimating the power of 9-patches. The most you could do is have a ruler image with expanding space between the ticks. You can't, however, make a 9-patch that automatically tiles parts of your image.
On the other hand, if you create a BitmapDrawable programatically, you can set the tile mode separately for the X and Y axes.
I used to do this in my webview project using border image which provides both options (repeat, stretch, fill).
As webview has kind of it's own problems in android (mostly fixed element) I decided to be more android for the next project and I found out that it's not possible to have the repeated border using 9Patch. It's so awkward as it's needy but not implemented.
In a word android development area makes me crazy, one option here one option there is a usual thing here.

Categories

Resources