SlideShare a Scribd company logo
1 of 12
Android
Animation
Android Training
By Khaled Anaqwa
Animation
 The Android framework provides two
animation systems:
 property animation (introduced in Android
3.0)
 view animation. (using XML)
 Both animation systems are viable
options, but the property animation
system, in general, is the preferred
method to use, because it is more flexible
and offers more features.
Property Animation
 Introduced in Android 3.0 (API level 11)
 lets you animate properties of any object,
including ones that are not rendered to
the screen.
 The system is extensible and lets you
animate properties of custom types as
well.
Property Animation
 Is a robust framework that allows you to
animate almost anything.
 You can define an animation to change
any object property over time, regardless
of whether it draws to the screen or not.
 it’s changes a property's (a field in an
object) value over a specified length of
time.
Property Animation
characteristics
 Duration (The default length is 300 ms)
 Time interpolation (function of the animation’s)
 Repeat count and behavior
 Animator sets (You can group animations into
logical sets that play together or sequentially or
after specified delays)
 Frame refresh delay (The default is set to
refresh every 10 ms)
Animator
 The Animator class provides the basic
structure for creating animations.
 You normally do not use this class directly
as it only provides minimal functionality
that must be extended to fully support
animating values.
Subclasses of Animator used
 ValueAnimator
This class provides a simple timing engine for running animations which
calculate animated values and set them on target objects.
 ObjectAnimator
 This subclass of ValueAnimator provides support for animating
properties on target objects.
 The constructors of this class take parameters to define the target
object that will be animated as well as the name of the property that
will be animated.
 it makes the process of animating values on target objects much
easier
 ObjectAnimator has a few more restrictions(Use ValueAnimator).
 AnimatorSet
 Provides a mechanism to group animations together so that they run
in relation to one another.
 You can set animations to play together, sequentially, or after a
specified delay
Animating with ValueAnimator
ValueAnimator animation= ValueAnimator.ofFloat(0f, 1f);
animation.setDuration(2000);
animation.addUpdateListener(new
ValueAnimator.AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator
animation) {
Float value = (Float)
animation.getAnimatedValue();
Float frac =
animation.getAnimatedFraction();
textView.setAlpha(value);}
});
Animating with
ObjectAnimator
ObjectAnimator anim =
ObjectAnimator.ofFloat(textview, "alpha", 0f, 1f);
anim.setDuration(1000);
anim.start();
AnimatorSet
 AnimatorSet set1= new AnimatorSet();
 Play()
 Before()
 With()
 After()
 Note : you can play set into another set
AnimatorSet set2= new AnimatorSet();
Set2.paly(set1).before(anim);
Declaring Animations in XML
<set android:ordering="sequentially">
<set>
<objectAnimator
android:propertyName="x"
android:duration="500"
android:valueTo="400"
android:valueType="intType"/>
<objectAnimator
android:propertyName="y"
android:duration="500"
android:valueTo="300"
android:valueType="intType"/>
</set>
<objectAnimator
android:propertyName="alpha"
android:duration="500"
android:valueTo="1f"/>
</set>
ValueAnimator - <animator>
ObjectAnimator - <objectAnimator>
AnimatorSet - <set>
Load Animation
AnimatorSet set = (AnimatorSet)
AnimatorInflater.loadAnimator(myContext,
R.anim.property_animator);
set.setTarget(myObject);
set.start();

More Related Content

What's hot

Procedure of animation in 3 d autodesk maya tools &amp; techniques
Procedure of animation in 3 d autodesk maya tools &amp; techniquesProcedure of animation in 3 d autodesk maya tools &amp; techniques
Procedure of animation in 3 d autodesk maya tools &amp; techniquesijcga
 
Animate The Web With Ember.js - Jessica Jordan
Animate The Web With Ember.js - Jessica JordanAnimate The Web With Ember.js - Jessica Jordan
Animate The Web With Ember.js - Jessica JordanJessica Jordan
 
Stop running from animations droidcon London
Stop running from animations droidcon LondonStop running from animations droidcon London
Stop running from animations droidcon Londonmaric_iv
 
Google I/O 2013 - Android Graphics Performance
Google I/O 2013 - Android Graphics PerformanceGoogle I/O 2013 - Android Graphics Performance
Google I/O 2013 - Android Graphics PerformanceDouO
 
Core Animation
Core AnimationCore Animation
Core AnimationBob McCune
 
TMD2063 | Digital Animation - Chapter 2
TMD2063 | Digital Animation - Chapter 2TMD2063 | Digital Animation - Chapter 2
TMD2063 | Digital Animation - Chapter 2Diyana Harithuddin
 
Animation 2013 bis_taj
Animation 2013 bis_tajAnimation 2013 bis_taj
Animation 2013 bis_tajmaaz hamed
 
Android animation and color state list resources-chapter 10
Android animation and color state list resources-chapter 10Android animation and color state list resources-chapter 10
Android animation and color state list resources-chapter 10Dr. Ramkumar Lakshminarayanan
 
Raster animation
Raster animationRaster animation
Raster animationabhijit754
 

What's hot (16)

Procedure of animation in 3 d autodesk maya tools &amp; techniques
Procedure of animation in 3 d autodesk maya tools &amp; techniquesProcedure of animation in 3 d autodesk maya tools &amp; techniques
Procedure of animation in 3 d autodesk maya tools &amp; techniques
 
Animations & swift
Animations & swiftAnimations & swift
Animations & swift
 
Animation in iOS
Animation in iOSAnimation in iOS
Animation in iOS
 
Animate The Web With Ember.js - Jessica Jordan
Animate The Web With Ember.js - Jessica JordanAnimate The Web With Ember.js - Jessica Jordan
Animate The Web With Ember.js - Jessica Jordan
 
Stop running from animations droidcon London
Stop running from animations droidcon LondonStop running from animations droidcon London
Stop running from animations droidcon London
 
Google I/O 2013 - Android Graphics Performance
Google I/O 2013 - Android Graphics PerformanceGoogle I/O 2013 - Android Graphics Performance
Google I/O 2013 - Android Graphics Performance
 
Core Animation
Core AnimationCore Animation
Core Animation
 
Chap18 19
Chap18 19Chap18 19
Chap18 19
 
TMD2063 | Digital Animation - Chapter 2
TMD2063 | Digital Animation - Chapter 2TMD2063 | Digital Animation - Chapter 2
TMD2063 | Digital Animation - Chapter 2
 
Animation 2013 bis_taj
Animation 2013 bis_tajAnimation 2013 bis_taj
Animation 2013 bis_taj
 
Android animation and color state list resources-chapter 10
Android animation and color state list resources-chapter 10Android animation and color state list resources-chapter 10
Android animation and color state list resources-chapter 10
 
ANIMATION SEQUENCE
ANIMATION SEQUENCEANIMATION SEQUENCE
ANIMATION SEQUENCE
 
Animation
AnimationAnimation
Animation
 
Ani mation
Ani mationAni mation
Ani mation
 
iOS Core Animation
iOS Core AnimationiOS Core Animation
iOS Core Animation
 
Raster animation
Raster animationRaster animation
Raster animation
 

Viewers also liked

Android Transition
Android TransitionAndroid Transition
Android TransitionCharile Tsai
 
Android design and Custom views
Android design and Custom views Android design and Custom views
Android design and Custom views Lars Vogel
 
ppt based on android technology with great animations
ppt based on android technology with great animationsppt based on android technology with great animations
ppt based on android technology with great animationsHriday Garg
 
Android AIDL Concept
Android AIDL ConceptAndroid AIDL Concept
Android AIDL ConceptCharile Tsai
 
Material design for android
Material design for androidMaterial design for android
Material design for androidVmoksha Admin
 
Android with dagger_2
Android with dagger_2Android with dagger_2
Android with dagger_2Kros Huang
 
就職 創業 即戰力_20161214
就職 創業 即戰力_20161214就職 創業 即戰力_20161214
就職 創業 即戰力_20161214信宏 陳
 
Android training (android style)
Android training (android style)Android training (android style)
Android training (android style)Khaled Anaqwa
 
Android Training (Broadcast Receiver)
Android Training (Broadcast Receiver)Android Training (Broadcast Receiver)
Android Training (Broadcast Receiver)Khaled Anaqwa
 
Android Training (Services)
Android Training (Services)Android Training (Services)
Android Training (Services)Khaled Anaqwa
 
Android Training (android fundamental)
Android Training (android fundamental)Android Training (android fundamental)
Android Training (android fundamental)Khaled Anaqwa
 
Android Training (Touch)
Android Training (Touch)Android Training (Touch)
Android Training (Touch)Khaled Anaqwa
 
School Management System in Android
School Management System in AndroidSchool Management System in Android
School Management System in AndroidTeam Codingparks
 
Android Material Design APIs/Tips
Android Material Design APIs/TipsAndroid Material Design APIs/Tips
Android Material Design APIs/TipsKen Yee
 
Android Training (Notifications)
Android Training (Notifications)Android Training (Notifications)
Android Training (Notifications)Khaled Anaqwa
 
Android Training (ScrollView , Horizontal ScrollView WebView)
Android Training (ScrollView , Horizontal ScrollView  WebView)Android Training (ScrollView , Horizontal ScrollView  WebView)
Android Training (ScrollView , Horizontal ScrollView WebView)Khaled Anaqwa
 
Material design - AndroidosDay 2015
Material design - AndroidosDay 2015Material design - AndroidosDay 2015
Material design - AndroidosDay 2015rlecheta
 
Chapter 5 ms access-1
Chapter 5   ms access-1Chapter 5   ms access-1
Chapter 5 ms access-1Pratik Gupta
 

Viewers also liked (20)

Android Transition
Android TransitionAndroid Transition
Android Transition
 
Android design and Custom views
Android design and Custom views Android design and Custom views
Android design and Custom views
 
Android Animator
Android AnimatorAndroid Animator
Android Animator
 
ppt based on android technology with great animations
ppt based on android technology with great animationsppt based on android technology with great animations
ppt based on android technology with great animations
 
Android AIDL Concept
Android AIDL ConceptAndroid AIDL Concept
Android AIDL Concept
 
Android Service
Android ServiceAndroid Service
Android Service
 
Material design for android
Material design for androidMaterial design for android
Material design for android
 
Android with dagger_2
Android with dagger_2Android with dagger_2
Android with dagger_2
 
就職 創業 即戰力_20161214
就職 創業 即戰力_20161214就職 創業 即戰力_20161214
就職 創業 即戰力_20161214
 
Android training (android style)
Android training (android style)Android training (android style)
Android training (android style)
 
Android Training (Broadcast Receiver)
Android Training (Broadcast Receiver)Android Training (Broadcast Receiver)
Android Training (Broadcast Receiver)
 
Android Training (Services)
Android Training (Services)Android Training (Services)
Android Training (Services)
 
Android Training (android fundamental)
Android Training (android fundamental)Android Training (android fundamental)
Android Training (android fundamental)
 
Android Training (Touch)
Android Training (Touch)Android Training (Touch)
Android Training (Touch)
 
School Management System in Android
School Management System in AndroidSchool Management System in Android
School Management System in Android
 
Android Material Design APIs/Tips
Android Material Design APIs/TipsAndroid Material Design APIs/Tips
Android Material Design APIs/Tips
 
Android Training (Notifications)
Android Training (Notifications)Android Training (Notifications)
Android Training (Notifications)
 
Android Training (ScrollView , Horizontal ScrollView WebView)
Android Training (ScrollView , Horizontal ScrollView  WebView)Android Training (ScrollView , Horizontal ScrollView  WebView)
Android Training (ScrollView , Horizontal ScrollView WebView)
 
Material design - AndroidosDay 2015
Material design - AndroidosDay 2015Material design - AndroidosDay 2015
Material design - AndroidosDay 2015
 
Chapter 5 ms access-1
Chapter 5   ms access-1Chapter 5   ms access-1
Chapter 5 ms access-1
 

Similar to Android Training (Animation)

How to implement react native animations using animated api
How to implement react native animations using animated apiHow to implement react native animations using animated api
How to implement react native animations using animated apiKaty Slemon
 
Seven Peaks Speaks - Android Jetpack Compose Animation
Seven Peaks Speaks - Android Jetpack Compose AnimationSeven Peaks Speaks - Android Jetpack Compose Animation
Seven Peaks Speaks - Android Jetpack Compose AnimationSeven Peaks Speaks
 
Neoito — Animations in Angular 5
Neoito — Animations in Angular 5Neoito — Animations in Angular 5
Neoito — Animations in Angular 5Neoito
 
How to Animate a Widget Across Screens in Flutter.pptx
How to Animate a Widget Across Screens in Flutter.pptxHow to Animate a Widget Across Screens in Flutter.pptx
How to Animate a Widget Across Screens in Flutter.pptxFlutter Agency
 
How to Create Animation Using the AnimatedAlign Widget.pptx
How to Create Animation Using the AnimatedAlign Widget.pptxHow to Create Animation Using the AnimatedAlign Widget.pptx
How to Create Animation Using the AnimatedAlign Widget.pptxFlutter Agency
 
How to Create Custom Animations in Flutter – A Step-by-Step Guide.pdf
How to Create Custom Animations in Flutter – A Step-by-Step Guide.pdfHow to Create Custom Animations in Flutter – A Step-by-Step Guide.pdf
How to Create Custom Animations in Flutter – A Step-by-Step Guide.pdfBOSC Tech Labs
 
Microsoft silverlight
Microsoft silverlightMicrosoft silverlight
Microsoft silverlightNguyen Tran
 
Advance ui development and design
Advance ui  development and design Advance ui  development and design
Advance ui development and design Rakesh Jha
 
IRJET- 3D Vision System using Calibrated Stereo Camera
IRJET- 3D Vision System using Calibrated Stereo CameraIRJET- 3D Vision System using Calibrated Stereo Camera
IRJET- 3D Vision System using Calibrated Stereo CameraIRJET Journal
 
Web Design & Development - Session 6
Web Design & Development - Session 6Web Design & Development - Session 6
Web Design & Development - Session 6Shahrzad Peyman
 
Top Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsTop Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsMotorola Mobility - MOTODEV
 
Invalidation Routines Pounded Into Your Cranium
Invalidation Routines Pounded Into Your CraniumInvalidation Routines Pounded Into Your Cranium
Invalidation Routines Pounded Into Your Craniumsakrirosenstrom
 

Similar to Android Training (Animation) (20)

Android animation in android-chapter17
Android animation in android-chapter17Android animation in android-chapter17
Android animation in android-chapter17
 
How to implement react native animations using animated api
How to implement react native animations using animated apiHow to implement react native animations using animated api
How to implement react native animations using animated api
 
Android view animation in android-chapter18
Android view animation in android-chapter18Android view animation in android-chapter18
Android view animation in android-chapter18
 
Seven Peaks Speaks - Android Jetpack Compose Animation
Seven Peaks Speaks - Android Jetpack Compose AnimationSeven Peaks Speaks - Android Jetpack Compose Animation
Seven Peaks Speaks - Android Jetpack Compose Animation
 
Neoito — Animations in Angular 5
Neoito — Animations in Angular 5Neoito — Animations in Angular 5
Neoito — Animations in Angular 5
 
Scmad Chapter07
Scmad Chapter07Scmad Chapter07
Scmad Chapter07
 
How to Animate a Widget Across Screens in Flutter.pptx
How to Animate a Widget Across Screens in Flutter.pptxHow to Animate a Widget Across Screens in Flutter.pptx
How to Animate a Widget Across Screens in Flutter.pptx
 
How to Create Animation Using the AnimatedAlign Widget.pptx
How to Create Animation Using the AnimatedAlign Widget.pptxHow to Create Animation Using the AnimatedAlign Widget.pptx
How to Create Animation Using the AnimatedAlign Widget.pptx
 
How to Create Custom Animations in Flutter – A Step-by-Step Guide.pdf
How to Create Custom Animations in Flutter – A Step-by-Step Guide.pdfHow to Create Custom Animations in Flutter – A Step-by-Step Guide.pdf
How to Create Custom Animations in Flutter – A Step-by-Step Guide.pdf
 
Microsoft silverlight
Microsoft silverlightMicrosoft silverlight
Microsoft silverlight
 
First kinectslides
First kinectslidesFirst kinectslides
First kinectslides
 
cs247 slides
cs247 slidescs247 slides
cs247 slides
 
Advance ui development and design
Advance ui  development and design Advance ui  development and design
Advance ui development and design
 
AdvancedJava.pptx
AdvancedJava.pptxAdvancedJava.pptx
AdvancedJava.pptx
 
IRJET- 3D Vision System using Calibrated Stereo Camera
IRJET- 3D Vision System using Calibrated Stereo CameraIRJET- 3D Vision System using Calibrated Stereo Camera
IRJET- 3D Vision System using Calibrated Stereo Camera
 
Day seven
Day sevenDay seven
Day seven
 
Web Design & Development - Session 6
Web Design & Development - Session 6Web Design & Development - Session 6
Web Design & Development - Session 6
 
Animation
AnimationAnimation
Animation
 
Top Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsTop Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on Tablets
 
Invalidation Routines Pounded Into Your Cranium
Invalidation Routines Pounded Into Your CraniumInvalidation Routines Pounded Into Your Cranium
Invalidation Routines Pounded Into Your Cranium
 

More from Khaled Anaqwa

Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Khaled Anaqwa
 
Android Training (Content Provider)
Android Training (Content Provider)Android Training (Content Provider)
Android Training (Content Provider)Khaled Anaqwa
 
Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)Khaled Anaqwa
 
Android Training (Sensors)
Android Training (Sensors)Android Training (Sensors)
Android Training (Sensors)Khaled Anaqwa
 
Android Training (Media)
Android Training (Media)Android Training (Media)
Android Training (Media)Khaled Anaqwa
 
Android Training (AdapterView & Adapter)
Android Training (AdapterView & Adapter)Android Training (AdapterView & Adapter)
Android Training (AdapterView & Adapter)Khaled Anaqwa
 
Android Training (Android UI)
Android Training (Android UI)Android Training (Android UI)
Android Training (Android UI)Khaled Anaqwa
 
Android Training (Intro)
Android Training (Intro)Android Training (Intro)
Android Training (Intro)Khaled Anaqwa
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)Khaled Anaqwa
 

More from Khaled Anaqwa (9)

Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)
 
Android Training (Content Provider)
Android Training (Content Provider)Android Training (Content Provider)
Android Training (Content Provider)
 
Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)
 
Android Training (Sensors)
Android Training (Sensors)Android Training (Sensors)
Android Training (Sensors)
 
Android Training (Media)
Android Training (Media)Android Training (Media)
Android Training (Media)
 
Android Training (AdapterView & Adapter)
Android Training (AdapterView & Adapter)Android Training (AdapterView & Adapter)
Android Training (AdapterView & Adapter)
 
Android Training (Android UI)
Android Training (Android UI)Android Training (Android UI)
Android Training (Android UI)
 
Android Training (Intro)
Android Training (Intro)Android Training (Intro)
Android Training (Intro)
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)
 

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Android Training (Animation)

  • 2. Animation  The Android framework provides two animation systems:  property animation (introduced in Android 3.0)  view animation. (using XML)  Both animation systems are viable options, but the property animation system, in general, is the preferred method to use, because it is more flexible and offers more features.
  • 3. Property Animation  Introduced in Android 3.0 (API level 11)  lets you animate properties of any object, including ones that are not rendered to the screen.  The system is extensible and lets you animate properties of custom types as well.
  • 4. Property Animation  Is a robust framework that allows you to animate almost anything.  You can define an animation to change any object property over time, regardless of whether it draws to the screen or not.  it’s changes a property's (a field in an object) value over a specified length of time.
  • 5. Property Animation characteristics  Duration (The default length is 300 ms)  Time interpolation (function of the animation’s)  Repeat count and behavior  Animator sets (You can group animations into logical sets that play together or sequentially or after specified delays)  Frame refresh delay (The default is set to refresh every 10 ms)
  • 6. Animator  The Animator class provides the basic structure for creating animations.  You normally do not use this class directly as it only provides minimal functionality that must be extended to fully support animating values.
  • 7. Subclasses of Animator used  ValueAnimator This class provides a simple timing engine for running animations which calculate animated values and set them on target objects.  ObjectAnimator  This subclass of ValueAnimator provides support for animating properties on target objects.  The constructors of this class take parameters to define the target object that will be animated as well as the name of the property that will be animated.  it makes the process of animating values on target objects much easier  ObjectAnimator has a few more restrictions(Use ValueAnimator).  AnimatorSet  Provides a mechanism to group animations together so that they run in relation to one another.  You can set animations to play together, sequentially, or after a specified delay
  • 8. Animating with ValueAnimator ValueAnimator animation= ValueAnimator.ofFloat(0f, 1f); animation.setDuration(2000); animation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { public void onAnimationUpdate(ValueAnimator animation) { Float value = (Float) animation.getAnimatedValue(); Float frac = animation.getAnimatedFraction(); textView.setAlpha(value);} });
  • 9. Animating with ObjectAnimator ObjectAnimator anim = ObjectAnimator.ofFloat(textview, "alpha", 0f, 1f); anim.setDuration(1000); anim.start();
  • 10. AnimatorSet  AnimatorSet set1= new AnimatorSet();  Play()  Before()  With()  After()  Note : you can play set into another set AnimatorSet set2= new AnimatorSet(); Set2.paly(set1).before(anim);
  • 11. Declaring Animations in XML <set android:ordering="sequentially"> <set> <objectAnimator android:propertyName="x" android:duration="500" android:valueTo="400" android:valueType="intType"/> <objectAnimator android:propertyName="y" android:duration="500" android:valueTo="300" android:valueType="intType"/> </set> <objectAnimator android:propertyName="alpha" android:duration="500" android:valueTo="1f"/> </set> ValueAnimator - <animator> ObjectAnimator - <objectAnimator> AnimatorSet - <set>
  • 12. Load Animation AnimatorSet set = (AnimatorSet) AnimatorInflater.loadAnimator(myContext, R.anim.property_animator); set.setTarget(myObject); set.start();