FileDocCategorySizeDatePackage
NinePatchTest.javaAPI DocAndroid 1.5 API888Wed May 06 22:42:02 BST 2009com.android.layoutlib.bridge

NinePatchTest

public class NinePatchTest extends TestCase

Fields Summary
private com.android.ninepatch.NinePatch
mPatch
Constructors Summary
Methods Summary
protected voidsetUp()

        URL url = this.getClass().getClassLoader().getResource("data/button.9.png");

        mPatch = NinePatch.load(url, false /* convert */);
    
public voidtest9PatchLoad()

        assertNotNull(mPatch);
    
public voidtest9PatchMinSize()

        int[] padding = new int[4];
        mPatch.getPadding(padding);
        assertEquals(13, padding[0]);
        assertEquals(3, padding[1]);
        assertEquals(13, padding[2]);
        assertEquals(4, padding[3]);
        assertEquals(38, mPatch.getWidth());
        assertEquals(27, mPatch.getHeight());