SlideShare une entreprise Scribd logo
1  sur  4
Télécharger pour lire hors ligne
݇†ó£Œ´ Ü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-™ àœ÷¶ «ð£¡Á «î£¡Á‹.

Contenu connexe

Tendances

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 playchicagonewsyesterday
 
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 212Mahmoud 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 DetectionJenchoke Tachagomain
 
Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2MEJenchoke Tachagomain
 
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 screeningschicagonewsonlineradio
 
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 31Mahmoud 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 181Mahmoud 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 AndroidSomenath Mukhopadhyay
 
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 212Mahmoud Samir Fayed
 
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 189Mahmoud 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 210Mahmoud Samir Fayed
 
Vidéo approche en immobilier
Vidéo approche en immobilierVidéo approche en immobilier
Vidéo approche en immobilierhervepouliot
 
Magnetic grapher-coding
Magnetic grapher-codingMagnetic grapher-coding
Magnetic grapher-codingingeass
 
Creating custom views
Creating custom viewsCreating custom views
Creating custom viewsMu Chun Wang
 
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 84Mahmoud Samir Fayed
 

Tendances (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
 

En vedette

föreläsning Ungas Världar
föreläsning Ungas Världarföreläsning Ungas Världar
föreläsning Ungas Världarpatrik 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
 
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 labordetapilarandres
 
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 Likeguest4483409
 
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 strategyWouter Gerritsma
 
ПРЕДПРИНИМАТЕЛЬ-ИННОВАТОР: вдохновляющие истории успеха и уроки
ПРЕДПРИНИМАТЕЛЬ-ИННОВАТОР: вдохновляющие истории успеха и урокиПРЕДПРИНИМАТЕЛЬ-ИННОВАТОР: вдохновляющие истории успеха и уроки
ПРЕДПРИНИМАТЕЛЬ-ИННОВАТОР: вдохновляющие истории успеха и урокиVadim Kotelnikov
 
Chamber Quantification 2015
Chamber Quantification 2015Chamber Quantification 2015
Chamber Quantification 2015David Gonzales
 

En vedette (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
 

Similaire à 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
 
DOSUG Intro to JQuery JavaScript Framework
DOSUG Intro to JQuery JavaScript FrameworkDOSUG Intro to JQuery JavaScript Framework
DOSUG Intro to JQuery JavaScript FrameworkMatthew 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 2009gyuque
 
Leaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLLeaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLgerbille
 
Y Map Mashup Camp
Y Map Mashup CampY Map Mashup Camp
Y Map Mashup CampJinho Jung
 
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.pdffeelinggifts
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best PracticesYekmer 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 developersPavel Lahoda
 
Droidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon Berlin
 
Compose로 Android:Desktop 멀티플랫폼 만들기.pdf
Compose로 Android:Desktop 멀티플랫폼 만들기.pdfCompose로 Android:Desktop 멀티플랫폼 만들기.pdf
Compose로 Android:Desktop 멀티플랫폼 만들기.pdfssuserb6c2641
 
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
 
事件模型探究
事件模型探究事件模型探究
事件模型探究ematrix
 
Developing Google Glass
Developing Google GlassDeveloping Google Glass
Developing Google GlassJohnny Sung
 
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxsrcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxwhitneyleman54422
 

Similaire à 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
 

Plus de Dr. Ramkumar Lakshminarayanan

Plus de 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-™ àœ÷¶ «ð£¡Á «î£¡Á‹.