Skip to main content

Posts

Showing posts from 2012

Android Studio ListView with Speech Bubble

Hi, Android Speech Bubble example Today I'm going to discuss how to make a ListView with speech bubble same as native android message app or some other apps out there. First of all we need to discuss the making of a row layout with speech bubble. How to make Speech Bubble? Well that is the most interesting part of the development. I've already posted a blog post about how to make 9 patch image of speech bubble, you can find that post here. Android How to use 9 patch png? Here we will discuss how to use them in our application. You will copy them into your project in relevant  hdpi, ldpi, xhdpi and mdpi folders accordingly. Now we come to the coding part. We need to make simple ListActivity with ListView . There are lot of tutorials available: Vogella ListView Tutorial TechnoTalkative ListView and lot more. You can f ind customizat ion of the ListView there too. Here I'll discuss the Adapter part of the ListView  only. What is Adapter in A

Android Studio How to use 9 patch png?

Hi, 2nd blog post after almost 1.5 year :) Today I'm going to discuss about 9 patch image and how to use 9 patch png in android apps. What is 9 patch? 9 patch is technique used to scale the image in such a way that the 4 corners remain unscaled, but the four edges are scaled in one axis and the middle is scaled in both axis. So the graphical representation of this scenario will be something like this: Icon when divided into 9  patch Simple Icon file The image at left side when divided into 9 patch will look like the image at the right side. Now the interesting part, the four corners of the image will be remain unscaled and the edges will be scaled in single axis, which may be X or Y. and the center of the 9 patch image will be scaled in both axis. Now we include an image which will represent the parts of image unscaled, scaled into Y axis and scaled into Y and scaled into both direction with color differentiation. Here it is. 9 patch parts represented w