'Drawable'에 해당되는 글 3건

  1. 2010.05.26 Frame Animation (1)
  2. 2010.05.26 ShapeDrawable
  3. 2010.05.26 TransitionDrawable
2010.05.26 00:56

An object used to create frame-by-frame animations, defined by a series of Drawable objects, which can be used as a View object's background.

The simplest way to create a frame-by-frame animation is to define the animation in an XML file, placed in the res/drawable/ folder, and set it as the background to a View object. Then, call run() to start the animation.

An AnimationDrawable defined in XML consists of a single <animation-list> element, and a series of nested <item> tags. Each item defines a frame of the animation. See the example below.

spin_animation.xml file in res/drawable/ folder:

'Android' 카테고리의 다른 글

가속도 센서 이용한 그림 이동  (0) 2010.05.27
가속도 센서 좌표축  (0) 2010.05.26
Frame Animation  (1) 2010.05.26
ShapeDrawable  (0) 2010.05.26
TransitionDrawable  (0) 2010.05.26
날씨 Widget 만들기  (0) 2010.05.13
Posted by hyunny82
2010.05.26 00:29
A Drawable object that draws primitive shapes. A ShapeDrawable takes a Shape object and manages its presence on the screen. If no Shape is given, then the ShapeDrawable will default to a RectShape.


class OvalShape
Defines an oval shape. The oval can be drawn to a Canvas with its own draw() method, but more graphical control is available if you instead pass the OvalShape to a ShapeDrawable

생성
xml로 생성 alpha transparency, color filter, dither, opacity and color 등 조절가능

'Android' 카테고리의 다른 글

가속도 센서 좌표축  (0) 2010.05.26
Frame Animation  (1) 2010.05.26
ShapeDrawable  (0) 2010.05.26
TransitionDrawable  (0) 2010.05.26
날씨 Widget 만들기  (0) 2010.05.13
타이머 사용  (0) 2010.05.02
Posted by hyunny82
2010.05.26 00:25

An extension of LayerDrawables that is intended to cross-fade between the first and second layer. To start the transition, call startTransition(int). To display just the first layer, call resetTransition().

It can be defined in an XML file with the <transition> element. Each Drawable in the transition is defined in a nested <item>.

<transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/image_xx1" />
<item android:drawable="@drawable/image_xx2" />
</transition>

Resources res = mContext.getResources();
TransitionDrawable transition
= (TransitionDrawable) res.getDrawable(R.drawable.expand_collapse);
ImageView image = (ImageView) findViewById(R.id.toggle_image);
image.setImageDrawable(transition);

1초 간격으로...

transition.startTransition(1000);

'Android' 카테고리의 다른 글

Frame Animation  (1) 2010.05.26
ShapeDrawable  (0) 2010.05.26
TransitionDrawable  (0) 2010.05.26
날씨 Widget 만들기  (0) 2010.05.13
타이머 사용  (0) 2010.05.02
몽키 툴  (0) 2010.05.02
Posted by hyunny82
이전버튼 1 이전버튼

티스토리 툴바