SlideShare a Scribd company logo
݇†ó£Œ´ ÜQ«ñû¬ù
à¼õ£‚°õ ðô API
è¬÷ õöƒA»œ÷¶. Þî¡ Íô‹
2® ñŸÁ‹ 3® à¼õƒè¬÷ à¼
õ£‚è º®»‹. ÜQ«ñû¬ù
݇†ó£Œ´ 3.0 -™ Þ¼‰¶
Šó£Šð˜†® ÜQ«ñû¡ ñŸÁ‹
MÎ ÜQ«ñû¡ â¡Á Þó‡´
º¬øè¬÷ õöƒA»œ÷¶. Šó£Š
ð†® ÜQ«ñûQ™ MÎ ÜQ
«ñû¬ù‚ 裆®½‹ ÜFè ðò¡
𣴠º¬ø Þ¼Šð Šó£Š
𘮠ÜQ«ñû¬ù«ò ÜFè‹
«ð˜ ðò¡ð´ˆ¶Aø£˜èœ. Draw
able Resource-™ àœ÷ ðìƒ
è¬÷ ªè£‡´‹, ðìƒè¬÷
å¡ø¡ H¡ å¡ø£è 裇Hˆ¶
ÜQ«ñû¬ù à¼õ£‚èô£‹.
âO¬ñò£ù ÜQ«ñû¡ å¡P¬ù à¼
õ£‚°‹ º¬øJ¬ù 𣘊«ð£‹. ¹Fò Šó£
ü‚† å¡P¬ù ªî£ìƒA Üî¡ ªðò¬ó
݇†ó£Œ®™ ÜQ«ñû¡
animation text âù ªðòK´«õ£‹.
Þ‰î ꣡P™ main xme-™ â‰î
Mî ñ£Ÿøƒè¬÷»‹ ªêŒò «ð£õ
F™¬ô. on draw º¬ø Íô‹ õ†ì
ñ£è îèõ™ ²Ÿø «õ‡´‹ â¡ð¬î
°P‚è ðò¡ð´Aø¶. Þƒ° canvas
J¬ù Parameter Ýè ªè£´‚è
«õ‡´‹. «è¡õ£v â¡ð¶ ®ó£
ªñˆî®™ Þ¼‰¶ (Draw) ãŸð´‹
call è¬÷ ¬èò£÷ ðò¡ð´Aø¶.
®ó£M¬ù ðò¡ð´ˆ¶õ 4
裋«ð£ù†èœ (Componets) ðò¡
ð´Aø¶.ܬõ H‚ê™è¬÷¬èò£÷
H†«ñŠ ®ó£‚è¬÷ ¬èò£÷
canvas âŠð® õ¬óò «õ‡´‹,
recet, path, text,bitmap ñŸÁ‹ paint
(õ¬óîL¡ õ‡íƒèœ ñŸÁ‹ v¬ì™
è¬÷ °P‚è)
Þ‰î ꣡P™ ⿈¶è¬÷ circular path-™
ðò¡ð´ˆîŠð´‹. on draw MŸè£ù Gó™-1™
ªè£´‚èŠð†´œ÷¶.
Path circle = new Path();
int centerX = canvas.getWidth() / 2;
int centerY = canvas.getHeight() / 2;
int r = Math.min(centerX, centerY);
circle.addCircle(centerX, centerY, r,
Direction.CW);
Paint paint = new Paint();
paint.setColor(Color.GREEN);
paint.setTextSize(30);
paint.setAntiAlias(true);
canvas.drawTextOnPath(AnimatedTxt, circle,
0, 30, paint);
private void createAnim(Canvas canvas) {
rotateAnim = new RotateAnimation(0,
360, canvas.getWidth() / 2,
canvas.getHeight() / 2);
rotateAnim.setRepeatMode(Animation.REVER
SE);
rotateAnim.setRepeatCount(Animation.INFINI
TE);
rotateAnim.setDuration(10000L);
rotateAnim.setInterpolator(new
AccelerateDecelerateInterpolator());
startAnimation(rotateAnim);
Gó™-1
Gó™-2
ðì‹-1
ðì‹-2
ðì‹-3
Ý¡†ó£Œ´ -2
Þ󣋰ñ£˜ ªô†²Iï£ó£òí¡
20
ÜQ«ñû¬ù õ†ìñ£è ªêò™ð´ˆFì,
create animation ªñˆî† ðò¡ð´ˆîŠð´‹.
rotate animation Íô‹ ¹Fò rotate animation
à¼õ£‚è «õ‡´‹. rotation Ýù¶ x,ypane-™
ãŸð´‹. â‰î ¹œO¬ò ªè£‡´ ÜQ«ñû¡
ãŸðìô£‹ â¡ðî¬ù °PŠHìô£‹. 0,0 â¡
ð¶ Þì¶ ð‚èˆF™ àœ÷ ºî™ ¹œO«ò
Ý°‹. â‰î ¹œO¬ò»‹ °PŠHìM™¬ô
â¡ø£™ 0,0 J¬ù ¹œOò£è ªè£‡´ ÜQ
«ñû¡ à¼õ£‚èŠð´‹. AK«ò† ÜQ«ñû
QŸè£ù Gó™ 2-™ ªè£´‚èŠð†´œ÷¶.
Þ‰î ꣡P™ ªìv‚†®Ÿè£ù îèõL¬ù
package com.ram.animationtext;
import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.os.Bundle;
import android.view.View;
import
android.view.animation.AccelerateDecelerateIn
terpolator;
import android.view.animation.Animation;
import
android.view.animation.RotateAnimation;
public class AnimationtextActivity extends
Activity {
@Override
public void onCreate(Bundle
savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new
GraphicsView(this));
}
private static class GraphicsView extends
View {
private static final String AnimatedTxt
=
"This Sample Program Shows,
Aniamtion Using Path. This is very simple and
easy to understand.";
private Animation rotateAnim;
public GraphicsView(Context context)
{
super(context);
}
private void createAnim(Canvas
canvas) {
rotateAnim = new
RotateAnimation(0, 360, canvas.getWidth() / 2,
canvas.getHeight() / 2);
rotateAnim.setRepeatMode(Animation.REVERS
E);
rotateAnim.setRepeatCount(Animation.INFINIT
E);
rotateAnim.setDuration(10000L);
rotateAnim.setInterpolator(new
AccelerateDecelerateInterpolator());
startAnimation(rotateAnim);
}
@Override
protected void onDraw(Canvas canvas)
{
super.onDraw(canvas);
// creates the animation the first
time
if (rotateAnim == null) {
createAnim(canvas);
}
Path circle = new Path();
int centerX = canvas.getWidth() /
2;
int centerY = canvas.getHeight() /
2;
int r = Math.min(centerX,
centerY);
circle.addCircle(centerX, centerY,
r, Direction.CW);
Paint paint = new Paint();
paint.setColor(Color.GREEN);
paint.setTextSize(30);
paint.setAntiAlias(true);
canvas.drawTextOnPath(AnimatedTxt, circle, 0,
30, paint);
}
}
animated text â¡ø ñ£PLJ™ ªè£´ˆ¶œ
«÷£‹. Gó™-3-™ ªì‚v† ÜQ«ñûQŸè£ù
º¿ Gó¬ô»‹ ªè£´ˆ¶œ«÷£‹. Þ‰î
GóL¬ù 苬ð™ (Compile) ªêŒ¶ ó¡ ªêŒ
Gó™-3
package ram.com.graphiceffect;
import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ComposePathEffect;
import android.graphics.CornerPathEffect;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathDashPathEffect;
import android.graphics.PathEffect;
import android.graphics.RectF;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
public class GraphiceffectexampleActivity
extends Activity {
/** Called when the activity is first created.
*/
@Override
protected void onCreate(Bundle
savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new SampleView(this));
}
private static class SampleView extends
View {
private Paint mPaint;
private Path mPath;
private PathEffect[] mEffects;
private int[] mColors;
private float mPhase;
private static PathEffect makeDash(float
phase) {
return new DashPathEffect(new
float[] { 15, 5, 8, 5 }, phase);
}
private static void
makeEffects(PathEffect[] e, float phase) {
e[0] = null; // no effect
e[1] = new CornerPathEffect(10);
e[2] = new DashPathEffect(new
float[] {10, 5, 5, 5}, phase);
e[3] = new
PathDashPathEffect(makePathDash(), 12,
phase,
PathDashPathEffect.Style.ROTATE);
e[4] = new ComposePathEffect(e[2],
e[1]);
e[5] = new ComposePathEffect(e[3],
e[1]);
}
public SampleView(Context context) {
super(context);
setFocusable(true);
setFocusableInTouchMode(true);
mPaint = new
Paint(Paint.ANTI_ALIAS_FLAG);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeWidth(6);
mPath = makeFollowPath();
mEffects = new PathEffect[6];
mColors = new int[] { Color.BLACK,
Color.RED, Color.BLUE,
Color.GREEN,
Color.MAGENTA, Color.BLACK
};
}
@Override protected void
onDraw(Canvas canvas) {
canvas.drawColor(Color.WHITE);
RectF bounds = new RectF();
mPath.computeBounds(bounds, false);
canvas.translate(10 - bounds.left, 10 -
bounds.top);
makeEffects(mEffects, mPhase);
mPhase += 1;
invalidate();
for (int i = 0; i < mEffects.length;
i++) {
mPaint.setPathEffect(mEffects[i]);
mPaint.setColor(mColors[i]);
canvas.drawPath(mPath, mPaint);
canvas.translate(0, 28);
}
}
@Override public boolean onKeyDown(int
keyCode, KeyEvent event) {
switch (keyCode) {
case
KeyEvent.KEYCODE_DPAD_CENTER:
mPath = makeFollowPath();
return true;
}
return super.onKeyDown(keyCode,
event);
}
private static Path makeFollowPath() {
Path p = new Path();
p.moveTo(0, 0);
for (int i = 1; i <= 15; i++) {
p.lineTo(i*20, (float)Math.random()
* 35);
}
return p;
}
private static Path makePathDash() {
Path p = new Path();
p.moveTo(4, 0);
p.lineTo(0, -4);
p.lineTo(8, -4);
p.lineTo(12, 0);
p.lineTo(8, 4);
p.lineTo(0, 4);
return p;
}
}
} Gó™-4
- ªî£ì¼‹
 ðì‹ 1-™ àœ÷¶ «ð£¡ø ÜQ«ñû¡
«î£¡Á‹.
Ü´ˆî ꣡ø£è Aó£çH‚ â炆 J¬ù
à¼õ£‚°‹ º¬øJ¬ùŠ 𣘊«ð£‹. path
effect A÷£ê£ù¶ ݇†ó£Œ´ Aó£çH‚C¡
A÷£vC¬ù Ü®Šð¬ìò£è‚ ªè£‡´œ÷¶.
«ðˆ âçªð‚†®¡ «ïó®ò£ù êŠ A÷£vèœ
compose path effect ,corner path effect, dash
path effect, dis create path effect, path dash path
effect ñŸÁ‹ sum path effect «ð£¡ø¬õò£°‹.
¹Fò Šó£ªü‚† å¡P¬ù ªî£ìƒA Üî¡
ªðòK¬ù graphiceffectexample âù ªðòK´ƒ
èœ. Þ‰î ꣡P½‹ main xme-™ â‰î ñ£Ÿø
º‹ ªêŒòŠ«ð£õF™¬ô. graphiceffectexample
activity -J¬ù extend ªêŒ»ñ£Á à¼õ£‚è
«õ‡´‹. Ü´ˆîî£è sample view â¡ø extend
private static class J¬ù à¼õ£‚A MÎM¬ù
extend ªêŒ»ñ£Á à¼õ£‚è «õ‡´‹. on
create º¬øJ™ set content view(new sample
view(this) â¡Á ªè£´ˆ¶ sample view
-M¬ù ðò¡ð´ˆ¶ñ£Á à¼õ£‚è «õ‡´‹.
sample view M™ paint path ñŸÁ‹ path effect
è¬÷ ðò¡ð´ˆF ÜõŸPŸè£ù ñFŠ¹è¬÷
ªè£´‚è «õ‡´‹. make effect º¬ø Íô‹
patheffect-¡ ܬñŠH¬ù °PŠHì «õ‡´‹.
on draw method Íô‹ canvasJ¬ù ðò¡
ð´ˆF ÜQ«ñû¡ ªêò™ð£†´ º¬øJ¬ù
°PŠHì «õ‡´‹ Þî¬ù îMó on key down
eventJ¬ù ¬èò£À‹ º¬ø»‹ ðò¡ð´ˆîŠ
ð†´œ÷¶. on key down-™ KEY CODE-DPAD-
CENTER J¬ù Ü¿ˆFù£™ path J¬ù ñ£ŸP
ܬñ‚°‹ Gó™ ðò¡ð´ˆîŠ ð†´œ÷¶.KEY
CODE-DPAD-CENTER ⃰ Þ¼‚°‹ â¡ðî¬ù
ðì‹ 2™ 裇H‚èŠ ð†´œ÷¶. Aó£çH‚v
âçªð‚†®Ÿè£ù Gó™4-™ 裇H‚èŠð†´œ
÷¶. ÜŠO«èû¡ ó¡ ªêŒî¾ì¡ ðì‹ 2
ñŸÁ‹ 3-™ àœ÷¶ «ð£¡Á «î£¡Á‹.

More Related Content

What's hot

Rushed to Victory Gardens' stage, An Issue of Blood is more effusion than play
Rushed to Victory Gardens' stage, An Issue of Blood is more effusion than playRushed to Victory Gardens' stage, An Issue of Blood is more effusion than play
Rushed to Victory Gardens' stage, An Issue of Blood is more effusion than play
chicagonewsyesterday
 
The Ring programming language version 1.10 book - Part 70 of 212
The Ring programming language version 1.10 book - Part 70 of 212The Ring programming language version 1.10 book - Part 70 of 212
The Ring programming language version 1.10 book - Part 70 of 212
Mahmoud Samir Fayed
 
Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
Jenchoke Tachagomain
 
Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2ME
Jenchoke Tachagomain
 
Convidar para page !!
Convidar para page !!Convidar para page !!
Convidar para page !!
Jhonny Batista
 
Mad Max is back, plus the rest of our new reviews and notable screenings
Mad Max is back, plus the rest of our new reviews and notable screeningsMad Max is back, plus the rest of our new reviews and notable screenings
Mad Max is back, plus the rest of our new reviews and notable screenings
chicagonewsonlineradio
 
The Ring programming language version 1.5 book - Part 9 of 31
The Ring programming language version 1.5 book - Part 9 of 31The Ring programming language version 1.5 book - Part 9 of 31
The Ring programming language version 1.5 book - Part 9 of 31
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 50 of 181
The Ring programming language version 1.5.2 book - Part 50 of 181The Ring programming language version 1.5.2 book - Part 50 of 181
The Ring programming language version 1.5.2 book - Part 50 of 181
Mahmoud Samir Fayed
 
Flow of events during Media Player creation in Android
Flow of events during Media Player creation in AndroidFlow of events during Media Player creation in Android
Flow of events during Media Player creation in Android
Somenath Mukhopadhyay
 
J2 me 07_5
J2 me 07_5J2 me 07_5
J2 me 07_5
vanliemtb
 
The Ring programming language version 1.10 book - Part 63 of 212
The Ring programming language version 1.10 book - Part 63 of 212The Ring programming language version 1.10 book - Part 63 of 212
The Ring programming language version 1.10 book - Part 63 of 212
Mahmoud Samir Fayed
 
Property-based testing
Property-based testingProperty-based testing
Property-based testing
Dmitriy Morozov
 
What the FUF?
What the FUF?What the FUF?
What the FUF?
An Doan
 
The Ring programming language version 1.6 book - Part 53 of 189
The Ring programming language version 1.6 book - Part 53 of 189The Ring programming language version 1.6 book - Part 53 of 189
The Ring programming language version 1.6 book - Part 53 of 189
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 60 of 210
The Ring programming language version 1.9 book - Part 60 of 210The Ring programming language version 1.9 book - Part 60 of 210
The Ring programming language version 1.9 book - Part 60 of 210
Mahmoud Samir Fayed
 
Vidéo approche en immobilier
Vidéo approche en immobilierVidéo approche en immobilier
Vidéo approche en immobilier
hervepouliot
 
Magnetic grapher-coding
Magnetic grapher-codingMagnetic grapher-coding
Magnetic grapher-coding
ingeass
 
Creating custom views
Creating custom viewsCreating custom views
Creating custom views
Mu Chun Wang
 
Pemrograman visual
Pemrograman visualPemrograman visual
Pemrograman visual
Univ. State of Surabaya
 
The Ring programming language version 1.2 book - Part 39 of 84
The Ring programming language version 1.2 book - Part 39 of 84The Ring programming language version 1.2 book - Part 39 of 84
The Ring programming language version 1.2 book - Part 39 of 84
Mahmoud Samir Fayed
 

What's hot (20)

Rushed to Victory Gardens' stage, An Issue of Blood is more effusion than play
Rushed to Victory Gardens' stage, An Issue of Blood is more effusion than playRushed to Victory Gardens' stage, An Issue of Blood is more effusion than play
Rushed to Victory Gardens' stage, An Issue of Blood is more effusion than play
 
The Ring programming language version 1.10 book - Part 70 of 212
The Ring programming language version 1.10 book - Part 70 of 212The Ring programming language version 1.10 book - Part 70 of 212
The Ring programming language version 1.10 book - Part 70 of 212
 
Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
 
Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2ME
 
Convidar para page !!
Convidar para page !!Convidar para page !!
Convidar para page !!
 
Mad Max is back, plus the rest of our new reviews and notable screenings
Mad Max is back, plus the rest of our new reviews and notable screeningsMad Max is back, plus the rest of our new reviews and notable screenings
Mad Max is back, plus the rest of our new reviews and notable screenings
 
The Ring programming language version 1.5 book - Part 9 of 31
The Ring programming language version 1.5 book - Part 9 of 31The Ring programming language version 1.5 book - Part 9 of 31
The Ring programming language version 1.5 book - Part 9 of 31
 
The Ring programming language version 1.5.2 book - Part 50 of 181
The Ring programming language version 1.5.2 book - Part 50 of 181The Ring programming language version 1.5.2 book - Part 50 of 181
The Ring programming language version 1.5.2 book - Part 50 of 181
 
Flow of events during Media Player creation in Android
Flow of events during Media Player creation in AndroidFlow of events during Media Player creation in Android
Flow of events during Media Player creation in Android
 
J2 me 07_5
J2 me 07_5J2 me 07_5
J2 me 07_5
 
The Ring programming language version 1.10 book - Part 63 of 212
The Ring programming language version 1.10 book - Part 63 of 212The Ring programming language version 1.10 book - Part 63 of 212
The Ring programming language version 1.10 book - Part 63 of 212
 
Property-based testing
Property-based testingProperty-based testing
Property-based testing
 
What the FUF?
What the FUF?What the FUF?
What the FUF?
 
The Ring programming language version 1.6 book - Part 53 of 189
The Ring programming language version 1.6 book - Part 53 of 189The Ring programming language version 1.6 book - Part 53 of 189
The Ring programming language version 1.6 book - Part 53 of 189
 
The Ring programming language version 1.9 book - Part 60 of 210
The Ring programming language version 1.9 book - Part 60 of 210The Ring programming language version 1.9 book - Part 60 of 210
The Ring programming language version 1.9 book - Part 60 of 210
 
Vidéo approche en immobilier
Vidéo approche en immobilierVidéo approche en immobilier
Vidéo approche en immobilier
 
Magnetic grapher-coding
Magnetic grapher-codingMagnetic grapher-coding
Magnetic grapher-coding
 
Creating custom views
Creating custom viewsCreating custom views
Creating custom views
 
Pemrograman visual
Pemrograman visualPemrograman visual
Pemrograman visual
 
The Ring programming language version 1.2 book - Part 39 of 84
The Ring programming language version 1.2 book - Part 39 of 84The Ring programming language version 1.2 book - Part 39 of 84
The Ring programming language version 1.2 book - Part 39 of 84
 

Viewers also liked

föreläsning Ungas Världar
föreläsning Ungas Världarföreläsning Ungas Världar
föreläsning Ungas Världar
patrik hernwall
 
MN DNR "Plants That Eat Animals"
MN DNR "Plants That Eat Animals"MN DNR "Plants That Eat Animals"
MN DNR "Plants That Eat Animals"
Dan O'Brien
 
Como se mide la calidad de la proteína
Como se mide la calidad de la proteína Como se mide la calidad de la proteína
Como se mide la calidad de la proteína
Raul Retuerto
 
Kimbernews Outubro
Kimbernews OutubroKimbernews Outubro
Kimbernews Outubro
ANDRE BONILHA
 
Final DEF
Final DEFFinal DEF
Buying Model 3G
Buying Model 3GBuying Model 3G
Buying Model 3G
Val Slastnikov
 
Programuje w Delphi i C Builder
Programuje w Delphi i C BuilderProgramuje w Delphi i C Builder
Programuje w Delphi i C BuilderEbooki za darmo
 
Zaragoza 2010 homenaje a labordeta
Zaragoza 2010 homenaje a labordetaZaragoza 2010 homenaje a labordeta
Zaragoza 2010 homenaje a labordeta
pilarandres
 
CONTAMINAÇÃO TOXICA
CONTAMINAÇÃO TOXICACONTAMINAÇÃO TOXICA
CONTAMINAÇÃO TOXICA
Jose Geraldo Salvador Silva
 
Antropologia trabalho final
Antropologia trabalho finalAntropologia trabalho final
Antropologia trabalho final
Estêvão Henriques Tamele
 
Formularul 230 - A treia cafea
Formularul 230 - A treia cafeaFormularul 230 - A treia cafea
Formularul 230 - A treia cafea
PFA Breda Olivian-Claudiu
 
Gravitação-JP-João Paulo
Gravitação-JP-João PauloGravitação-JP-João Paulo
Gravitação-JP-João Paulo
João Paulo Souza Simão da Silva
 
Power Point Of How To What Opening Titles Could Look Like
Power Point Of How To What Opening Titles Could Look LikePower Point Of How To What Opening Titles Could Look Like
Power Point Of How To What Opening Titles Could Look Like
guest4483409
 
Publishing for impact; elements for a publication strategy
Publishing for impact; elements for a publication strategyPublishing for impact; elements for a publication strategy
Publishing for impact; elements for a publication strategy
Wouter Gerritsma
 
ПРЕДПРИНИМАТЕЛЬ-ИННОВАТОР: вдохновляющие истории успеха и уроки
ПРЕДПРИНИМАТЕЛЬ-ИННОВАТОР: вдохновляющие истории успеха и урокиПРЕДПРИНИМАТЕЛЬ-ИННОВАТОР: вдохновляющие истории успеха и уроки
ПРЕДПРИНИМАТЕЛЬ-ИННОВАТОР: вдохновляющие истории успеха и уроки
Vadim Kotelnikov
 
Chamber Quantification 2015
Chamber Quantification 2015Chamber Quantification 2015
Chamber Quantification 2015
David Gonzales
 

Viewers also liked (20)

föreläsning Ungas Världar
föreläsning Ungas Världarföreläsning Ungas Världar
föreläsning Ungas Världar
 
MN DNR "Plants That Eat Animals"
MN DNR "Plants That Eat Animals"MN DNR "Plants That Eat Animals"
MN DNR "Plants That Eat Animals"
 
CERTIFICATE SERVE SAFE
CERTIFICATE SERVE SAFECERTIFICATE SERVE SAFE
CERTIFICATE SERVE SAFE
 
Como se mide la calidad de la proteína
Como se mide la calidad de la proteína Como se mide la calidad de la proteína
Como se mide la calidad de la proteína
 
Kimbernews Outubro
Kimbernews OutubroKimbernews Outubro
Kimbernews Outubro
 
Final DEF
Final DEFFinal DEF
Final DEF
 
Buying Model 3G
Buying Model 3GBuying Model 3G
Buying Model 3G
 
Programuje w Delphi i C Builder
Programuje w Delphi i C BuilderProgramuje w Delphi i C Builder
Programuje w Delphi i C Builder
 
Zaragoza 2010 homenaje a labordeta
Zaragoza 2010 homenaje a labordetaZaragoza 2010 homenaje a labordeta
Zaragoza 2010 homenaje a labordeta
 
SCTC Transcript.PDF
SCTC Transcript.PDFSCTC Transcript.PDF
SCTC Transcript.PDF
 
CONTAMINAÇÃO TOXICA
CONTAMINAÇÃO TOXICACONTAMINAÇÃO TOXICA
CONTAMINAÇÃO TOXICA
 
Antropologia trabalho final
Antropologia trabalho finalAntropologia trabalho final
Antropologia trabalho final
 
Formularul 230 - A treia cafea
Formularul 230 - A treia cafeaFormularul 230 - A treia cafea
Formularul 230 - A treia cafea
 
Certificate_KNU
Certificate_KNUCertificate_KNU
Certificate_KNU
 
TTC Recomendation Letter
TTC Recomendation LetterTTC Recomendation Letter
TTC Recomendation Letter
 
Gravitação-JP-João Paulo
Gravitação-JP-João PauloGravitação-JP-João Paulo
Gravitação-JP-João Paulo
 
Power Point Of How To What Opening Titles Could Look Like
Power Point Of How To What Opening Titles Could Look LikePower Point Of How To What Opening Titles Could Look Like
Power Point Of How To What Opening Titles Could Look Like
 
Publishing for impact; elements for a publication strategy
Publishing for impact; elements for a publication strategyPublishing for impact; elements for a publication strategy
Publishing for impact; elements for a publication strategy
 
ПРЕДПРИНИМАТЕЛЬ-ИННОВАТОР: вдохновляющие истории успеха и уроки
ПРЕДПРИНИМАТЕЛЬ-ИННОВАТОР: вдохновляющие истории успеха и урокиПРЕДПРИНИМАТЕЛЬ-ИННОВАТОР: вдохновляющие истории успеха и уроки
ПРЕДПРИНИМАТЕЛЬ-ИННОВАТОР: вдохновляющие истории успеха и уроки
 
Chamber Quantification 2015
Chamber Quantification 2015Chamber Quantification 2015
Chamber Quantification 2015
 

Similar to Android Animation (in tamil)

Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
DroidConTLV
 
Sbaw091117
Sbaw091117Sbaw091117
Sbaw091117
Atsushi Tadokoro
 
DOSUG Intro to JQuery JavaScript Framework
DOSUG Intro to JQuery JavaScript FrameworkDOSUG Intro to JQuery JavaScript Framework
DOSUG Intro to JQuery JavaScript Framework
Matthew McCullough
 
You will learn RxJS in 2017
You will learn RxJS in 2017You will learn RxJS in 2017
You will learn RxJS in 2017
名辰 洪
 
JSplash - Adobe MAX 2009
JSplash - Adobe MAX 2009JSplash - Adobe MAX 2009
JSplash - Adobe MAX 2009
gyuque
 
Leaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLLeaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGL
gerbille
 
Y Map Mashup Camp
Y Map Mashup CampY Map Mashup Camp
Y Map Mashup Camp
Jinho Jung
 
Clean coding-practices
Clean coding-practicesClean coding-practices
Clean coding-practices
John Ferguson Smart Limited
 
662305 LAB13
662305 LAB13662305 LAB13
662305 LAB13
Nitigan Nakjuatong
 
I wanted to change the cloudsrectangles into an actuall image it do.pdf
I wanted to change the cloudsrectangles into an actuall image it do.pdfI wanted to change the cloudsrectangles into an actuall image it do.pdf
I wanted to change the cloudsrectangles into an actuall image it do.pdf
feelinggifts
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
Yekmer Simsek
 
Improving android experience for both users and developers
Improving android experience for both users and developersImproving android experience for both users and developers
Improving android experience for both users and developers
Pavel Lahoda
 
Droidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon2013 android experience lahoda
Droidcon2013 android experience lahoda
Droidcon Berlin
 
Compose로 Android:Desktop 멀티플랫폼 만들기.pdf
Compose로 Android:Desktop 멀티플랫폼 만들기.pdfCompose로 Android:Desktop 멀티플랫폼 만들기.pdf
Compose로 Android:Desktop 멀티플랫폼 만들기.pdf
ssuserb6c2641
 
google play service 7.8 & new tech in M
google play service 7.8 & new tech in M google play service 7.8 & new tech in M
google play service 7.8 & new tech in M
Ted Liang
 
GAE/J 開発環境でJDO入門
GAE/J 開発環境でJDO入門GAE/J 開発環境でJDO入門
GAE/J 開発環境でJDO入門
bose999
 
A More Flash Like Web?
A More Flash Like Web?A More Flash Like Web?
A More Flash Like Web?
Murat Can ALPAY
 
事件模型探究
事件模型探究事件模型探究
事件模型探究
ematrix
 
Developing Google Glass
Developing Google GlassDeveloping Google Glass
Developing Google Glass
Johnny Sung
 
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxsrcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
whitneyleman54422
 

Similar to Android Animation (in tamil) (20)

Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
 
Sbaw091117
Sbaw091117Sbaw091117
Sbaw091117
 
DOSUG Intro to JQuery JavaScript Framework
DOSUG Intro to JQuery JavaScript FrameworkDOSUG Intro to JQuery JavaScript Framework
DOSUG Intro to JQuery JavaScript Framework
 
You will learn RxJS in 2017
You will learn RxJS in 2017You will learn RxJS in 2017
You will learn RxJS in 2017
 
JSplash - Adobe MAX 2009
JSplash - Adobe MAX 2009JSplash - Adobe MAX 2009
JSplash - Adobe MAX 2009
 
Leaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLLeaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGL
 
Y Map Mashup Camp
Y Map Mashup CampY Map Mashup Camp
Y Map Mashup Camp
 
Clean coding-practices
Clean coding-practicesClean coding-practices
Clean coding-practices
 
662305 LAB13
662305 LAB13662305 LAB13
662305 LAB13
 
I wanted to change the cloudsrectangles into an actuall image it do.pdf
I wanted to change the cloudsrectangles into an actuall image it do.pdfI wanted to change the cloudsrectangles into an actuall image it do.pdf
I wanted to change the cloudsrectangles into an actuall image it do.pdf
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
 
Improving android experience for both users and developers
Improving android experience for both users and developersImproving android experience for both users and developers
Improving android experience for both users and developers
 
Droidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon2013 android experience lahoda
Droidcon2013 android experience lahoda
 
Compose로 Android:Desktop 멀티플랫폼 만들기.pdf
Compose로 Android:Desktop 멀티플랫폼 만들기.pdfCompose로 Android:Desktop 멀티플랫폼 만들기.pdf
Compose로 Android:Desktop 멀티플랫폼 만들기.pdf
 
google play service 7.8 & new tech in M
google play service 7.8 & new tech in M google play service 7.8 & new tech in M
google play service 7.8 & new tech in M
 
GAE/J 開発環境でJDO入門
GAE/J 開発環境でJDO入門GAE/J 開発環境でJDO入門
GAE/J 開発環境でJDO入門
 
A More Flash Like Web?
A More Flash Like Web?A More Flash Like Web?
A More Flash Like Web?
 
事件模型探究
事件模型探究事件模型探究
事件模型探究
 
Developing Google Glass
Developing Google GlassDeveloping Google Glass
Developing Google Glass
 
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxsrcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
 

More from Dr. Ramkumar Lakshminarayanan

IT security awareness
IT security awarenessIT security awareness
IT security awareness
Dr. Ramkumar Lakshminarayanan
 
Basics of IT security
Basics of IT securityBasics of IT security
Basics of IT security
Dr. Ramkumar Lakshminarayanan
 
IT Security Awareness Posters
IT Security Awareness PostersIT Security Awareness Posters
IT Security Awareness Posters
Dr. Ramkumar Lakshminarayanan
 
Normalisation revision
Normalisation revisionNormalisation revision
Normalisation revision
Dr. Ramkumar Lakshminarayanan
 
Windows mobile programming
Windows mobile programmingWindows mobile programming
Windows mobile programming
Dr. Ramkumar Lakshminarayanan
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
Dr. Ramkumar Lakshminarayanan
 
Web technology today
Web technology todayWeb technology today
Web technology today
Dr. Ramkumar Lakshminarayanan
 
Php Tutorial
Php TutorialPhp Tutorial
Phonegap for Android
Phonegap for AndroidPhonegap for Android
Phonegap for Android
Dr. Ramkumar Lakshminarayanan
 
Create and Sell Android App (in tamil)
Create and Sell Android App (in tamil)Create and Sell Android App (in tamil)
Create and Sell Android App (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Android app - Creating Live Wallpaper (tamil)
Android app - Creating Live Wallpaper (tamil)Android app - Creating Live Wallpaper (tamil)
Android app - Creating Live Wallpaper (tamil)
Dr. Ramkumar Lakshminarayanan
 
Android Tips (Tamil)
Android Tips (Tamil)Android Tips (Tamil)
Android Tips (Tamil)
Dr. Ramkumar Lakshminarayanan
 
Creating List in Android App (in tamil)
Creating List in Android App (in tamil)Creating List in Android App (in tamil)
Creating List in Android App (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Single Touch event view in Android (in tamil)
Single Touch event view in Android (in tamil)Single Touch event view in Android (in tamil)
Single Touch event view in Android (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Android Application using seekbar (in tamil)
Android Application using seekbar (in tamil)Android Application using seekbar (in tamil)
Android Application using seekbar (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Rating Bar in Android Example
Rating Bar in Android ExampleRating Bar in Android Example
Rating Bar in Android Example
Dr. Ramkumar Lakshminarayanan
 
Creating Image Gallery - Android app (in tamil)
Creating Image Gallery - Android app (in tamil)Creating Image Gallery - Android app (in tamil)
Creating Image Gallery - Android app (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Create Android App using web view (in tamil)
Create Android App using web view (in tamil)Create Android App using web view (in tamil)
Create Android App using web view (in tamil)
Dr. Ramkumar Lakshminarayanan
 
Hardware Interface in Android (in tamil)
Hardware Interface in Android (in tamil)Hardware Interface in Android (in tamil)
Hardware Interface in Android (in tamil)
Dr. Ramkumar Lakshminarayanan
 
GPS in Android (in tamil)
GPS in Android (in tamil)GPS in Android (in tamil)
GPS in Android (in tamil)
Dr. Ramkumar Lakshminarayanan
 

More from Dr. Ramkumar Lakshminarayanan (20)

IT security awareness
IT security awarenessIT security awareness
IT security awareness
 
Basics of IT security
Basics of IT securityBasics of IT security
Basics of IT security
 
IT Security Awareness Posters
IT Security Awareness PostersIT Security Awareness Posters
IT Security Awareness Posters
 
Normalisation revision
Normalisation revisionNormalisation revision
Normalisation revision
 
Windows mobile programming
Windows mobile programmingWindows mobile programming
Windows mobile programming
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Web technology today
Web technology todayWeb technology today
Web technology today
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
Phonegap for Android
Phonegap for AndroidPhonegap for Android
Phonegap for Android
 
Create and Sell Android App (in tamil)
Create and Sell Android App (in tamil)Create and Sell Android App (in tamil)
Create and Sell Android App (in tamil)
 
Android app - Creating Live Wallpaper (tamil)
Android app - Creating Live Wallpaper (tamil)Android app - Creating Live Wallpaper (tamil)
Android app - Creating Live Wallpaper (tamil)
 
Android Tips (Tamil)
Android Tips (Tamil)Android Tips (Tamil)
Android Tips (Tamil)
 
Creating List in Android App (in tamil)
Creating List in Android App (in tamil)Creating List in Android App (in tamil)
Creating List in Android App (in tamil)
 
Single Touch event view in Android (in tamil)
Single Touch event view in Android (in tamil)Single Touch event view in Android (in tamil)
Single Touch event view in Android (in tamil)
 
Android Application using seekbar (in tamil)
Android Application using seekbar (in tamil)Android Application using seekbar (in tamil)
Android Application using seekbar (in tamil)
 
Rating Bar in Android Example
Rating Bar in Android ExampleRating Bar in Android Example
Rating Bar in Android Example
 
Creating Image Gallery - Android app (in tamil)
Creating Image Gallery - Android app (in tamil)Creating Image Gallery - Android app (in tamil)
Creating Image Gallery - Android app (in tamil)
 
Create Android App using web view (in tamil)
Create Android App using web view (in tamil)Create Android App using web view (in tamil)
Create Android App using web view (in tamil)
 
Hardware Interface in Android (in tamil)
Hardware Interface in Android (in tamil)Hardware Interface in Android (in tamil)
Hardware Interface in Android (in tamil)
 
GPS in Android (in tamil)
GPS in Android (in tamil)GPS in Android (in tamil)
GPS in Android (in tamil)
 

Android Animation (in tamil)

  • 1. ݇†ó£Œ´ ÜQ«ñû¬ù à¼õ£‚°õ ðô API è¬÷ õöƒA»œ÷¶. Þî¡ Íô‹ 2® ñŸÁ‹ 3® à¼õƒè¬÷ ༠õ£‚è º®»‹. ÜQ«ñû¬ù ݇†ó£Œ´ 3.0 -™ Þ¼‰¶ Šó£Šð˜†® ÜQ«ñû¡ ñŸÁ‹ MÎ ÜQ«ñû¡ â¡Á Þó‡´ º¬øè¬÷ õöƒA»œ÷¶. Šó£Š ð†® ÜQ«ñûQ™ MÎ ÜQ «ñû¬ù‚ 裆®½‹ ÜFè ðò¡ 𣴠º¬ø Þ¼Šð Šó£Š 𘮠ÜQ«ñû¬ù«ò ÜFè‹ «ð˜ ðò¡ð´ˆ¶Aø£˜èœ. Draw able Resource-™ àœ÷ ðìƒ è¬÷ ªè£‡´‹, ðìƒè¬÷ å¡ø¡ H¡ å¡ø£è 裇Hˆ¶ ÜQ«ñû¬ù à¼õ£‚èô£‹. âO¬ñò£ù ÜQ«ñû¡ å¡P¬ù ༠õ£‚°‹ º¬øJ¬ù 𣘊«ð£‹. ¹Fò Šó£ ü‚† å¡P¬ù ªî£ìƒA Üî¡ ªðò¬ó ݇†ó£Œ®™ ÜQ«ñû¡ animation text âù ªðòK´«õ£‹. Þ‰î ꣡P™ main xme-™ â‰î Mî ñ£Ÿøƒè¬÷»‹ ªêŒò «ð£õ F™¬ô. on draw º¬ø Íô‹ õ†ì ñ£è îèõ™ ²Ÿø «õ‡´‹ â¡ð¬î °P‚è ðò¡ð´Aø¶. Þƒ° canvas J¬ù Parameter Ýè ªè£´‚è «õ‡´‹. «è¡õ£v â¡ð¶ ®ó£ ªñˆî®™ Þ¼‰¶ (Draw) ãŸð´‹ call è¬÷ ¬èò£÷ ðò¡ð´Aø¶. ®ó£M¬ù ðò¡ð´ˆ¶õ 4 裋«ð£ù†èœ (Componets) ðò¡ ð´Aø¶.ܬõ H‚ê™è¬÷¬èò£÷ H†«ñŠ ®ó£‚è¬÷ ¬èò£÷ canvas âŠð® õ¬óò «õ‡´‹, recet, path, text,bitmap ñŸÁ‹ paint (õ¬óîL¡ õ‡íƒèœ ñŸÁ‹ v¬ì™ è¬÷ °P‚è) Þ‰î ꣡P™ ⿈¶è¬÷ circular path-™ ðò¡ð´ˆîŠð´‹. on draw MŸè£ù Gó™-1™ ªè£´‚èŠð†´œ÷¶. Path circle = new Path(); int centerX = canvas.getWidth() / 2; int centerY = canvas.getHeight() / 2; int r = Math.min(centerX, centerY); circle.addCircle(centerX, centerY, r, Direction.CW); Paint paint = new Paint(); paint.setColor(Color.GREEN); paint.setTextSize(30); paint.setAntiAlias(true); canvas.drawTextOnPath(AnimatedTxt, circle, 0, 30, paint); private void createAnim(Canvas canvas) { rotateAnim = new RotateAnimation(0, 360, canvas.getWidth() / 2, canvas.getHeight() / 2); rotateAnim.setRepeatMode(Animation.REVER SE); rotateAnim.setRepeatCount(Animation.INFINI TE); rotateAnim.setDuration(10000L); rotateAnim.setInterpolator(new AccelerateDecelerateInterpolator()); startAnimation(rotateAnim); Gó™-1 Gó™-2 ðì‹-1 ðì‹-2 ðì‹-3
  • 2. Ý¡†ó£Œ´ -2 Þ󣋰ñ£˜ ªô†²Iï£ó£òí¡ 20 ÜQ«ñû¬ù õ†ìñ£è ªêò™ð´ˆFì, create animation ªñˆî† ðò¡ð´ˆîŠð´‹. rotate animation Íô‹ ¹Fò rotate animation à¼õ£‚è «õ‡´‹. rotation Ýù¶ x,ypane-™ ãŸð´‹. â‰î ¹œO¬ò ªè£‡´ ÜQ«ñû¡ ãŸðìô£‹ â¡ðî¬ù °PŠHìô£‹. 0,0 â¡ ð¶ Þì¶ ð‚èˆF™ àœ÷ ºî™ ¹œO«ò Ý°‹. â‰î ¹œO¬ò»‹ °PŠHìM™¬ô â¡ø£™ 0,0 J¬ù ¹œOò£è ªè£‡´ ÜQ «ñû¡ à¼õ£‚èŠð´‹. AK«ò† ÜQ«ñû QŸè£ù Gó™ 2-™ ªè£´‚èŠð†´œ÷¶. Þ‰î ꣡P™ ªìv‚†®Ÿè£ù îèõL¬ù package com.ram.animationtext; import android.app.Activity; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Path.Direction; import android.os.Bundle; import android.view.View; import android.view.animation.AccelerateDecelerateIn terpolator; import android.view.animation.Animation; import android.view.animation.RotateAnimation; public class AnimationtextActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new GraphicsView(this)); } private static class GraphicsView extends View { private static final String AnimatedTxt = "This Sample Program Shows, Aniamtion Using Path. This is very simple and easy to understand."; private Animation rotateAnim; public GraphicsView(Context context) { super(context); } private void createAnim(Canvas canvas) { rotateAnim = new RotateAnimation(0, 360, canvas.getWidth() / 2, canvas.getHeight() / 2); rotateAnim.setRepeatMode(Animation.REVERS E); rotateAnim.setRepeatCount(Animation.INFINIT E); rotateAnim.setDuration(10000L); rotateAnim.setInterpolator(new AccelerateDecelerateInterpolator()); startAnimation(rotateAnim); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); // creates the animation the first time if (rotateAnim == null) { createAnim(canvas); } Path circle = new Path(); int centerX = canvas.getWidth() / 2; int centerY = canvas.getHeight() / 2; int r = Math.min(centerX, centerY); circle.addCircle(centerX, centerY, r, Direction.CW); Paint paint = new Paint(); paint.setColor(Color.GREEN); paint.setTextSize(30); paint.setAntiAlias(true); canvas.drawTextOnPath(AnimatedTxt, circle, 0, 30, paint); } } animated text â¡ø ñ£PLJ™ ªè£´ˆ¶œ «÷£‹. Gó™-3-™ ªì‚v† ÜQ«ñûQŸè£ù º¿ Gó¬ô»‹ ªè£´ˆ¶œ«÷£‹. Þ‰î GóL¬ù 苬ð™ (Compile) ªêŒ¶ ó¡ ªêŒ Gó™-3
  • 3. package ram.com.graphiceffect; import android.app.Activity; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.ComposePathEffect; import android.graphics.CornerPathEffect; import android.graphics.DashPathEffect; import android.graphics.Paint; import android.graphics.Path; import android.graphics.PathDashPathEffect; import android.graphics.PathEffect; import android.graphics.RectF; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; public class GraphiceffectexampleActivity extends Activity { /** Called when the activity is first created. */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); } private static class SampleView extends View { private Paint mPaint; private Path mPath; private PathEffect[] mEffects; private int[] mColors; private float mPhase; private static PathEffect makeDash(float phase) { return new DashPathEffect(new float[] { 15, 5, 8, 5 }, phase); } private static void makeEffects(PathEffect[] e, float phase) { e[0] = null; // no effect e[1] = new CornerPathEffect(10); e[2] = new DashPathEffect(new float[] {10, 5, 5, 5}, phase); e[3] = new PathDashPathEffect(makePathDash(), 12, phase, PathDashPathEffect.Style.ROTATE); e[4] = new ComposePathEffect(e[2], e[1]); e[5] = new ComposePathEffect(e[3], e[1]); } public SampleView(Context context) { super(context); setFocusable(true); setFocusableInTouchMode(true); mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(6); mPath = makeFollowPath(); mEffects = new PathEffect[6]; mColors = new int[] { Color.BLACK, Color.RED, Color.BLUE, Color.GREEN, Color.MAGENTA, Color.BLACK }; } @Override protected void onDraw(Canvas canvas) { canvas.drawColor(Color.WHITE); RectF bounds = new RectF(); mPath.computeBounds(bounds, false); canvas.translate(10 - bounds.left, 10 - bounds.top); makeEffects(mEffects, mPhase); mPhase += 1; invalidate(); for (int i = 0; i < mEffects.length; i++) { mPaint.setPathEffect(mEffects[i]); mPaint.setColor(mColors[i]); canvas.drawPath(mPath, mPaint); canvas.translate(0, 28); } } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_DPAD_CENTER: mPath = makeFollowPath(); return true; } return super.onKeyDown(keyCode, event); } private static Path makeFollowPath() { Path p = new Path(); p.moveTo(0, 0); for (int i = 1; i <= 15; i++) { p.lineTo(i*20, (float)Math.random() * 35); } return p; } private static Path makePathDash() { Path p = new Path(); p.moveTo(4, 0); p.lineTo(0, -4); p.lineTo(8, -4); p.lineTo(12, 0); p.lineTo(8, 4); p.lineTo(0, 4); return p; } } } Gó™-4
  • 4. - ªî£ì¼‹  ðì‹ 1-™ àœ÷¶ «ð£¡ø ÜQ«ñû¡ «î£¡Á‹. Ü´ˆî ꣡ø£è Aó£çH‚ â炆 J¬ù à¼õ£‚°‹ º¬øJ¬ùŠ 𣘊«ð£‹. path effect A÷£ê£ù¶ ݇†ó£Œ´ Aó£çH‚C¡ A÷£vC¬ù Ü®Šð¬ìò£è‚ ªè£‡´œ÷¶. «ðˆ âçªð‚†®¡ «ïó®ò£ù êŠ A÷£vèœ compose path effect ,corner path effect, dash path effect, dis create path effect, path dash path effect ñŸÁ‹ sum path effect «ð£¡ø¬õò£°‹. ¹Fò Šó£ªü‚† å¡P¬ù ªî£ìƒA Üî¡ ªðòK¬ù graphiceffectexample âù ªðòK´ƒ èœ. Þ‰î ꣡P½‹ main xme-™ â‰î ñ£Ÿø º‹ ªêŒòŠ«ð£õF™¬ô. graphiceffectexample activity -J¬ù extend ªêŒ»ñ£Á à¼õ£‚è «õ‡´‹. Ü´ˆîî£è sample view â¡ø extend private static class J¬ù à¼õ£‚A MÎM¬ù extend ªêŒ»ñ£Á à¼õ£‚è «õ‡´‹. on create º¬øJ™ set content view(new sample view(this) â¡Á ªè£´ˆ¶ sample view -M¬ù ðò¡ð´ˆ¶ñ£Á à¼õ£‚è «õ‡´‹. sample view M™ paint path ñŸÁ‹ path effect è¬÷ ðò¡ð´ˆF ÜõŸPŸè£ù ñFŠ¹è¬÷ ªè£´‚è «õ‡´‹. make effect º¬ø Íô‹ patheffect-¡ ܬñŠH¬ù °PŠHì «õ‡´‹. on draw method Íô‹ canvasJ¬ù ðò¡ ð´ˆF ÜQ«ñû¡ ªêò™ð£†´ º¬øJ¬ù °PŠHì «õ‡´‹ Þî¬ù îMó on key down eventJ¬ù ¬èò£À‹ º¬ø»‹ ðò¡ð´ˆîŠ ð†´œ÷¶. on key down-™ KEY CODE-DPAD- CENTER J¬ù Ü¿ˆFù£™ path J¬ù ñ£ŸP ܬñ‚°‹ Gó™ ðò¡ð´ˆîŠ ð†´œ÷¶.KEY CODE-DPAD-CENTER ⃰ Þ¼‚°‹ â¡ðî¬ù ðì‹ 2™ 裇H‚èŠ ð†´œ÷¶. Aó£çH‚v âçªð‚†®Ÿè£ù Gó™4-™ 裇H‚èŠð†´œ ÷¶. ÜŠO«èû¡ ó¡ ªêŒî¾ì¡ ðì‹ 2 ñŸÁ‹ 3-™ àœ÷¶ «ð£¡Á «î£¡Á‹.