Android

Android


8.GRÁFICOS

Página 71 de 286

e

V

i

e

w

:

g

e

t

M

e

a

s

u

r

e

d

W

i

d

t

h

(

)

;

g

e

t

M

e

a

s

u

r

e

d

H

e

i

g

h

t

(

)

;

o

a

l

t

e

r

n

a

t

i

v

a

m

e

n

t

e

c

o

n

g

e

t

B

o

t

t

o

m

(

)

;

g

e

t

R

i

g

h

t

(

)

;

F

i

g

u

r

a

8

.

4

.

E

x

a

m

i

n

a

n

d

o

l

a

a

l

t

u

r

a

e

f

e

c

t

i

v

a

d

e

l

c

a

n

v

a

s

.

E

n

l

a

f

i

g

u

r

a

8

.

4

v

e

m

o

s

q

u

e

o

n

D

r

a

w

(

)

d

i

b

u

j

a

d

o

s

l

í

n

e

a

s

u

n

i

e

n

d

o

l

a

s

e

s

q

u

i

n

a

s

o

p

u

e

s

t

a

s

d

e

l

c

a

n

v

a

s

y

e

s

c

r

i

b

e

l

o

s

v

a

l

o

r

e

s

o

b

t

e

n

i

d

o

s

c

o

n

l

o

s

a

n

t

e

r

i

o

r

e

s

m

é

t

o

d

o

s

:

 

 

p

u

b

l

i

c

c

l

a

s

s

F

o

r

m

a

s

e

x

t

e

n

d

s

A

c

t

i

v

i

t

y

{

 

 

 

 

/

*

*

C

a

l

l

e

d

w

h

e

n

t

h

e

a

c

t

i

v

i

t

y

i

s

f

i

r

s

t

c

r

e

a

t

e

d

.

*

/

 

 

 

 

@

O

v

e

r

r

i

d

e

 

 

 

 

p

u

b

l

i

c

v

o

i

d

o

n

C

r

e

a

t

e

(

B

u

n

d

l

e

s

a

v

e

d

I

n

s

t

a

n

c

e

S

t

a

t

e

)

{

 

 

 

 

 

 

 

 

s

u

p

e

r

.

o

n

C

r

e

a

t

e

(

s

a

v

e

d

I

n

s

t

a

n

c

e

S

t

a

t

e

)

;

 

 

 

 

 

 

 

 

S

p

e

c

i

a

l

V

i

e

w

m

y

V

i

e

w

=

n

e

w

S

p

e

c

i

a

l

V

i

e

w

(

t

h

i

s

)

;

 

 

 

 

 

 

 

 

s

e

t

C

o

n

t

e

n

t

V

i

e

w

(

m

y

V

i

e

w

)

;

 

 

 

 

}

 

 

 

 

c

l

a

s

s

S

p

e

c

i

a

l

V

i

e

w

e

x

t

e

n

d

s

V

i

e

w

{

 

 

 

 

 

 

p

u

b

l

i

c

S

p

e

c

i

a

l

V

i

e

w

(

C

o

n

t

e

x

t

c

o

n

t

e

x

t

)

{

 

 

 

 

 

 

 

 

 

s

u

p

e

r

(

c

o

n

t

e

x

t

)

;

 

 

 

 

 

 

 

 

 

/

/

T

O

D

O

A

u

t

o

-

g

e

n

e

r

a

t

e

d

c

o

n

s

t

r

u

c

t

o

r

s

t

u

b

 

 

 

 

 

 

}

 

 

 

 

 

 

@

O

v

e

r

r

i

d

e

 

 

 

 

 

 

p

r

o

t

e

c

t

e

d

v

o

i

d

o

n

D

r

a

w

(

C

a

n

v

a

s

c

a

n

v

a

s

)

{

 

 

 

 

 

 

 

 

 

c

a

n

v

a

s

.

d

r

a

w

C

o

l

o

r

(

C

o

l

o

r

.

W

H

I

T

E

)

;

 

 

 

 

 

 

 

 

 

P

a

i

n

t

p

a

i

n

t

=

n

e

w

P

a

i

n

t

(

)

;

 

 

 

 

 

 

 

 

 

p

a

i

n

t

.

s

e

t

C

o

l

o

r

(

C

o

l

o

r

.

B

L

A

C

K

)

;

 

 

 

 

 

 

 

 

 

p

a

i

n

t

.

s

e

t

T

e

x

t

S

i

z

e

(

3

0

)

;

 

 

 

 

 

 

 

 

 

p

a

i

n

t

.

s

e

t

A

n

t

i

A

l

i

a

s

(

t

r

u

e

)

;

 

 

 

 

 

 

 

 

 

i

n

t

w

i

d

t

h

=

g

e

t

M

e

a

s

u

r

e

d

W

i

d

t

h

(

)

;

 

 

 

 

 

 

 

 

 

i

n

t

h

e

i

g

h

t

=

g

e

t

M

e

a

s

u

r

e

d

H

e

i

g

h

t

(

)

;

 

 

 

 

 

 

 

 

 

i

n

t

b

o

t

t

o

m

=

g

e

t

B

o

t

t

o

m

(

)

;

 

 

 

 

 

 

 

 

 

i

Ir a la siguiente página

Report Page