NinePatchDrawable constructor

by Rmac » Tue, 03 Mar 2009 09:38:03 GMT


Sponsored Links
 I am trying to create a NinePatchDrawable programmatically, but there
is no documentation on the constructor's argruments (Bitmap bitmap,
byte[] chunk, Rect padding, String srcName).  Does anyone know what
chunk and padding are... and how to specify them?

Thanks.
--~--~---------~--~----~------------~-------~--~----~



NinePatchDrawable constructor

by Dianne Hackborn » Tue, 03 Mar 2009 10:12:07 GMT


 This isn't really intended to be used much by apps.  The byte[] is the raw
data of the PNG 9-patch extension chunk that we defined for android, which
aapt generates; you'll have to build that all yourself, and look at the
ResourceTypes.h header file for a description of its contents.  The padding
is just the padding around the image, which is returned by the Drawable.






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


NinePatchDrawable constructor

by Romain Guy » Tue, 03 Mar 2009 10:14:18 GMT


 The nine patch chunk can be returned by the Bitmap class. Load a
Bitmap with BitmapFactory, then call getNinePatchChunk() to get the
chunks. The padding is a bit more complicated. You need to first
create a Rect and pass that Rect to the approprite
BitmapFactor.decode*() method. While decoding the 9patch,
BitmapFactory will fill that Rect with the padding as encoded in the
9patch.







-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~



NinePatchDrawable constructor

by Ron » Sun, 08 Mar 2009 02:06:58 GMT


 Does this work?  I took a 9patch png that works fine if I use it via
setBackgroundResource(), but instead loaded the png bytes and decoded
them via BitmapFactory to get a Bitmap and used the getNinePatchChunk
() method in an attempt to create a NinePatch object from the bitmap.
Everything runs ok until the constructor for NinePatch(bitmap, chunk,
src) causes the app to crash... no stacktrace, but a ton of internal
debug diagnostics are sent to logcat... none of which makes any sense
to me nor points to the problem.






--~--~---------~--~----~------------~-------~--~----~



NinePatchDrawable constructor

by Romain Guy » Sun, 08 Mar 2009 03:39:22 GMT


 > Everything runs ok until the constructor for NinePatch(bitmap, chunk,

It necessarily does. And without seeing the logs...







-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~



NinePatchDrawable constructor

by Ron » Tue, 10 Mar 2009 01:37:08 GMT


 orry, the last time I posted I couldn't figure out how to get the
logcat text... then I found it was relatively simple. Here is the
dump:

03-09 12:29:05.734: INFO/DEBUG(28): *** *** *** *** *** *** *** ***
*** *** *** *** *** *** *** ***
03-09 12:29:05.734: INFO/DEBUG(28): Build fingerprint: 'android-
devphone1/dream_devphone/dream/trout:1.0/UNLOCKED/116222:userdebug/
test-keys'
03-09 12:29:05.734: INFO/DEBUG(28): pid: 8966, tid: 8966 >>>
mobiliti.android.ui <<<
03-09 12:29:05.734: INFO/DEBUG(28): signal 11 (SIGSEGV), fault addr
00000008
03-09 12:29:05.734: INFO/DEBUG(28): r0 0000baf0 r1 00000007 r2
ad03e18d r3 00000000
03-09 12:29:05.734: INFO/DEBUG(28): r4 0000baf0 r5 00000000 r6
ad33f411 r7 4104d880
03-09 12:29:05.744: INFO/DEBUG(28): r8 bef5c630 r9 4104d878 10
4104d868 fp 00000000
03-09 12:29:05.744: INFO/DEBUG(28): ip ad33f411 sp bef5c610 lr
ad0471bd pc ad03e1a0 cpsr 00000030
03-09 12:29:06.194: INFO/DEBUG(28): #00 pc ad03e1a0 /system/
lib/libdvm.so
03-09 12:29:06.214: INFO/DEBUG(28): #01 pc ad33f426 /system/
lib/libandroid_runtime.so
03-09 12:29:06.224: INFO/DEBUG(28): #02 pc ad00d9f4 /system/
lib/libdvm.so
03-09 12:29:06.224: INFO/DEBUG(28): #03 pc ad04120e /system/
lib/libdvm.so
03-09 12:29:06.234: INFO/DEBUG(28): #04 pc ad012748 /system/
lib/libdvm.so
03-09 12:29:06.234: INFO/DEBUG(28): #05 pc ad02a92c /system/
lib/libdvm.so
03-09 12:29:06.234: INFO/DEBUG(28): #06 pc ad0169d0 /system/
lib/libdvm.so
03-09 12:29:06.244: INFO/DEBUG(28): #07 pc ad052096 /system/
lib/libdvm.so
03-09 12:29:06.244: INFO/DEBUG(28): #08 pc ad03ccbc /system/
lib/libdvm.so
03-09 12:29:06.254: INFO/DEBUG(28): #09 pc ad012748 /system/
lib/libdvm.so
03-09 12:29:06.254: INFO/DEBUG(28): #10 pc ad02a92c /system/
lib/libdvm.so
03-09 12:29:06.254: INFO/DEBUG(28): #11 pc ad0169d0 /system/
lib/libdvm.so
03-09 12:29:06.264: INFO/DEBUG(28): #12 pc ad051f10 /system/
lib/libdvm.so
03-09 12:29:06.264: INFO/DEBUG(28): #13 pc ad03f87a /system/
lib/libdvm.so
03-09 12:29:06.274: INFO/DEBUG(28): #14 pc ad3282b4 /system/
lib/libandroid_runtime.so
03-09 12:29:06.274: INFO/DEBUG(28): #15 pc ad328d40 /system/
lib/libandroid_runtime.so
03-09 12:29:06.274: INFO/DEBUG(28): #16 pc 00008c12 /system/
bin/app_process
03-09 12:29:06.284: INFO/DEBUG(28): #17 pc afe1dbd2 /system/
lib/libc.so
03-09 12:29:06.294: INFO/DEBUG(28): #18 pc afe0b010 /system/
lib/libc.so
03-09 12:29:06.304: INFO/DEBUG(28): #19 pc b0000d70 /system/
bin/linker
03-09 12:29:06.304: INFO/DEBUG(28): stack:
03-09 12:29:06.304: INFO/DEBUG(28): bef5c5d0 0000a000 [heap]
03-09 12:29:06.304: INFO/DEBUG(28): bef5c5d4 ad0481ab /system/
lib/libdvm.so
03-09 12:29:06.314: INFO/DEBUG(28): bef5c5d8 00000322
03-09 12:29:06.314: INFO/DEBUG(28): bef5c5dc 00000000
03-09 12:29:06.314: INFO/DEBUG(28): bef5c5e0 400240b8
03-09 12:29:06.314: INFO/DEBUG(28): bef5c5e4 ad060361 /system/
lib/libdvm.so
03-09 12:29:06.314: INFO/DEBUG(28): bef5c5e8 4476be28
03-09 12:29:06.314: INFO/DEBUG(28): bef5c5ec 00000003
03-09 12:29:06.314: INFO/DEBUG(28): bef5c5f0 0000baf0 [heap]
03-09 12:29:06.324: INFO/DEBUG(28): bef5c5f4 00000001
03-09 12:29:06.324: INFO/DEBUG(28): bef5c5



NinePatchDrawable constructor

by Romain Guy (Google) » Thu, 12 Mar 2009 09:18:45 GMT


  can't help you with native crashes unfortunately :(

On Mar 9, 10:36am, Ron <ry...@mac.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Aligning webview and buttons...

I want to put two buttons (not HTML) at the top of my view and the
webview below it...  Almost like frames in HTML, except the top frame
is android XML code, not an HTML frame.  I can get it somewhat like I
want, but whenever the HTML page is too big it goes up and under my
buttons, but at the bottom of the buttons I want the top of the
webview to start, all the time.  And the webview can scroll if
necessary.

Here's what I got, but it's not doing exactly what I was hoping
for....


<RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">

        <RelativeLayout
                android:id="@+id/webviewbox"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
        >

            <WebView
        android:id="@+id/webview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scrollbars="none"
    />

        </RelativeLayout>
                <Button
                        android:id="@+id/button1"
                        android:text="B1"
                        android:layout_height="wrap_content"
                        android:layout_width="100px"
                        android:layout_alignParentLeft="true"
                />
                <Button
                        android:id="@+id/button2"
                        android:text="B2"
                        android:layout_height="wrap_content"
                        android:layout_width="100px"
                        android:layout_alignParentRight="true"
                />

</RelativeLayout>

-- 

2. U R G E N T E - Cancele sua taxa de Telefone Fixo...

Subject: U R G E N T E - Cancele sua taxa de Telefone Fixo...
Date: Wed, 13 Jan 2010 13:39:09 -0200

*SER VOTADO EM MARO...*

*VAMOS L PESSOAL**...*



*D tambm o seu apoio a este Excelente projeto de Lei -  A Unio vai fazer
a Fora -**
*

*CANCELAMENTO DA TAXA TELEFNICA de: R$ 40,37 (residencial) e R$ 56,08
(comercial) **
*
*Quando se trata do interesse da populao, nada  divulgado. *

*
COMO PROCEDER:
**Ligue 0800-619619.**

Oua o menu, aperte 1 e Espere para falar com uma atendente. Diga que  para
votar a favor do cancelamento da taxa de telefone fixo.*
*
O Projeto de Lei  o de n. 5476/2001.

Esse tipo de assunto NO  veiculado na TV ou no rdio, porque eles no tm
interesse e no esto preocupados com isso. Ento ns  que temos de correr
atrs, afinal quem paga somos ns!

O telefone a ser discado (0800-619619, de segunda  sexta-feira das 08 s
20h00)  da Cmara dos Deputados Federal.*
*
Passe para frente esta mensagem para o maior nmero possvel.

LIGUE: 0800-619619. Vamos divulgar.

Entrando em vigor esta lei, voc s pagar pelas ligaes efetuadas,
acabando com esse roubo que  a assinatura mensal. Este projeto est
tramitando na 'COMISSO DE DEFESA DO CONSUMIDOR', na Cmara.

Quantos mais ligarem, maior a chance.

O BRASIL ( E A GENTE) AGRADECE!

No adianta ficar s reclamando.

Quando podemos, devemos tomar alguma atitude...

Envie uma cpia para TODOS OS SEUS CONTATOS AGORA!*



*Nota: A ligao tem de ser de um telefone fixo.*

--

3. Linker problem when compile android source on ubuntu 9.10

4. activity cannot be resolved

5. the files created by my aplication are deleted after turn off USB storage

6. Particular Tag Parsing

7. docs for shape xml syntax