SlideShare a Scribd company logo
Pull To Refresh Training
2014/03/11 John
Outline
● Introduction
● Design
● How to implement
○ Touch Event
○ Adding view
○ On Touching
○ Smooth Scrolling
○ Window Manager
● Summary
● Homework
Introduction
Introduction
There is a patent application
for the “pull-to-refresh”
feature that Loren Brichter
pioneered in Tweetie and is
now an extremely popular UI
gesture used in a lot of iOS,
Mac and Android apps.
ref: http://goo.gl/PjTjMA
Design
1. The user pulls down a list.
2. A message appears, telling the user
who can pull down the list to refresh.
3. The user pulls the list further down.
4. A new message appears, telling the
user that the list will refresh when he
releases it.
5. A refreshing or loading message
appears.
6. The refreshing message disappears
and a new list is shown, with the new
items at the top of the list.
Design
i.e. LinearLayout
How to implement
Touch event
Touch Event
How to implement
Touch event
The onInterceptTouchEvent() method is called whenever a
touch event is detected on the surface of a ViewGroup,
including on the surface of its children.
The onInterceptTouchEvent() method gives a parent the
chance to see any touch event before its children do.
How to implement
Managing Touch events
Use
ViewConfiguration
Constants
ref: http://goo.gl/JJN80z
How to implement
Managing Touch events
Extend a Child
View's Touchable
Area
ref: http://goo.gl/JJN80z
How to implement
Adding View
How to implement
On Touching
● Touch event filter.
● Setting variable up.
How to implement
On Touching
● Doing actions.
How to implement
Smooth scrolling
Ref: http://goo.gl/eb3DQH
SmoothScrollRunnable:
● Get next position from
Interpolator.
● Set scroll to position.
● Post(this).
How to implement
Window Manager
● Every display has a
WindowManager.
● WindowManager is a
System Manager.
How to implement
Window Manager
Ref: http://goo.gl/sWHpp
Summary
● “Make it a little simpler”
● How dose Touch event transit.
● How to implement smooth scrolling.
Homework
Sample source code: (You can also fInd it at the video record nearby if this link is invalid.)
https://www.dropbox.com/s/9zqt60tf7drppyi/TrainingPullToRefresh.zip
Basic:
● Let it be pulled from left.
Advance:
● Let it be pulled from both top and bottom.

More Related Content

Viewers also liked

I tuoi dipendenti sono stressati? La causa sei (anche) tu!
I tuoi dipendenti sono stressati? La causa sei (anche) tu!I tuoi dipendenti sono stressati? La causa sei (anche) tu!
I tuoi dipendenti sono stressati? La causa sei (anche) tu!
Cezanne HR Italia
 
Regularização de dívidas em atraso cai 5,74% em setembro
Regularização de dívidas em atraso cai 5,74% em setembroRegularização de dívidas em atraso cai 5,74% em setembro
Regularização de dívidas em atraso cai 5,74% em setembro
SPC Brasil
 
Santos et al 2012 JEB
Santos et al 2012 JEBSantos et al 2012 JEB
Santos et al 2012 JEB
Josiane Santos
 
Eleições Sind-RedeBH - Parte 1
Eleições Sind-RedeBH - Parte 1Eleições Sind-RedeBH - Parte 1
Eleições Sind-RedeBH - Parte 1
coletivofortalecer
 
Mapa de formacion
Mapa de formacionMapa de formacion
Mapa de formacion
kariperezc
 
Academic Event Notification System
Academic Event Notification SystemAcademic Event Notification System
Academic Event Notification System
Ashwini Natbhaje
 
Social Bookmarking
Social BookmarkingSocial Bookmarking
Social Bookmarking
tmichae1
 
General+Rules+Pertaining+To+Contracts
General+Rules+Pertaining+To+ContractsGeneral+Rules+Pertaining+To+Contracts
General+Rules+Pertaining+To+Contracts
varun23oct
 
Android IPC: Binder
Android IPC: BinderAndroid IPC: Binder
Android IPC: Binder
Kan-Han (John) Lu
 
Implosion Study
Implosion StudyImplosion Study
Implosion Study
DAX_THINK
 
A princesa arrogante
A princesa arroganteA princesa arrogante
A princesa arrogante
rita fernandes
 
Boletim de outubro
Boletim de outubroBoletim de outubro
Boletim de outubro
becastanheiradepera
 
Old works v pintura de ricardo monteiro - março 2016
Old works v  pintura de ricardo monteiro - março 2016Old works v  pintura de ricardo monteiro - março 2016
Old works v pintura de ricardo monteiro - março 2016
Ricardo Monteiro
 
Cómo hacer el proceso perfecto de cuentas a pagar
Cómo hacer el proceso perfecto de cuentas a pagarCómo hacer el proceso perfecto de cuentas a pagar
Cómo hacer el proceso perfecto de cuentas a pagar
Esker Ibérica
 
Seminar report on third generation solid state drive
Seminar report on third generation solid state driveSeminar report on third generation solid state drive
Seminar report on third generation solid state drive
Atishay Jain
 
ADV1100 Workshop for Faculty
ADV1100 Workshop for FacultyADV1100 Workshop for Faculty
ADV1100 Workshop for Faculty
jspevack
 
Facturas de proveedores, 5 KPIs a seguir
Facturas de proveedores, 5 KPIs a seguirFacturas de proveedores, 5 KPIs a seguir
Facturas de proveedores, 5 KPIs a seguir
Esker Ibérica
 
Utopia Theme Park Presentation
Utopia Theme Park PresentationUtopia Theme Park Presentation
Utopia Theme Park Presentation
Utopia Entertainment
 

Viewers also liked (18)

I tuoi dipendenti sono stressati? La causa sei (anche) tu!
I tuoi dipendenti sono stressati? La causa sei (anche) tu!I tuoi dipendenti sono stressati? La causa sei (anche) tu!
I tuoi dipendenti sono stressati? La causa sei (anche) tu!
 
Regularização de dívidas em atraso cai 5,74% em setembro
Regularização de dívidas em atraso cai 5,74% em setembroRegularização de dívidas em atraso cai 5,74% em setembro
Regularização de dívidas em atraso cai 5,74% em setembro
 
Santos et al 2012 JEB
Santos et al 2012 JEBSantos et al 2012 JEB
Santos et al 2012 JEB
 
Eleições Sind-RedeBH - Parte 1
Eleições Sind-RedeBH - Parte 1Eleições Sind-RedeBH - Parte 1
Eleições Sind-RedeBH - Parte 1
 
Mapa de formacion
Mapa de formacionMapa de formacion
Mapa de formacion
 
Academic Event Notification System
Academic Event Notification SystemAcademic Event Notification System
Academic Event Notification System
 
Social Bookmarking
Social BookmarkingSocial Bookmarking
Social Bookmarking
 
General+Rules+Pertaining+To+Contracts
General+Rules+Pertaining+To+ContractsGeneral+Rules+Pertaining+To+Contracts
General+Rules+Pertaining+To+Contracts
 
Android IPC: Binder
Android IPC: BinderAndroid IPC: Binder
Android IPC: Binder
 
Implosion Study
Implosion StudyImplosion Study
Implosion Study
 
A princesa arrogante
A princesa arroganteA princesa arrogante
A princesa arrogante
 
Boletim de outubro
Boletim de outubroBoletim de outubro
Boletim de outubro
 
Old works v pintura de ricardo monteiro - março 2016
Old works v  pintura de ricardo monteiro - março 2016Old works v  pintura de ricardo monteiro - março 2016
Old works v pintura de ricardo monteiro - março 2016
 
Cómo hacer el proceso perfecto de cuentas a pagar
Cómo hacer el proceso perfecto de cuentas a pagarCómo hacer el proceso perfecto de cuentas a pagar
Cómo hacer el proceso perfecto de cuentas a pagar
 
Seminar report on third generation solid state drive
Seminar report on third generation solid state driveSeminar report on third generation solid state drive
Seminar report on third generation solid state drive
 
ADV1100 Workshop for Faculty
ADV1100 Workshop for FacultyADV1100 Workshop for Faculty
ADV1100 Workshop for Faculty
 
Facturas de proveedores, 5 KPIs a seguir
Facturas de proveedores, 5 KPIs a seguirFacturas de proveedores, 5 KPIs a seguir
Facturas de proveedores, 5 KPIs a seguir
 
Utopia Theme Park Presentation
Utopia Theme Park PresentationUtopia Theme Park Presentation
Utopia Theme Park Presentation
 

Similar to Android Training - Pull to Refresh

Lecture #3 activities and intents
Lecture #3  activities and intentsLecture #3  activities and intents
Lecture #3 activities and intents
Vitali Pekelis
 
Tips for building fast multi touch enabled web sites
 Tips for building fast multi touch enabled web sites Tips for building fast multi touch enabled web sites
Tips for building fast multi touch enabled web sites
Aspenware
 
Fast multi touch enabled web sites
Fast multi touch enabled web sitesFast multi touch enabled web sites
Fast multi touch enabled web sites
Aspenware
 
B2. activity and intent
B2. activity and intentB2. activity and intent
B2. activity and intent
PERKYTORIALS
 
ANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.doc
Palakjaiswal43
 
Application Design - Part 2
Application Design - Part 2Application Design - Part 2
Application Design - Part 2
Kelley Howell
 
FirefoxOS Window Management
FirefoxOS Window ManagementFirefoxOS Window Management
FirefoxOS Window Management
Alive Kuo
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
ShahDhruv21
 
Events and Listeners in Android
Events and Listeners in AndroidEvents and Listeners in Android
Events and Listeners in Android
ma-polimi
 
Nearsoft Mobile Onboarding Workshop
Nearsoft Mobile Onboarding WorkshopNearsoft Mobile Onboarding Workshop
Nearsoft Mobile Onboarding Workshop
Misael Leon
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Development
Muhammad Sajid
 
Cucumber meets iPhone
Cucumber meets iPhoneCucumber meets iPhone
Cucumber meets iPhone
Erin Dees
 
Multi Touch presentation
Multi Touch presentationMulti Touch presentation
Multi Touch presentation
senthil0809
 
Presentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestatePresentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestate
Osahon Gino Ediagbonya
 
Guidelines for Android application design.pptx
Guidelines for Android application design.pptxGuidelines for Android application design.pptx
Guidelines for Android application design.pptx
debasish duarah
 
iLabs Toolbox Javashare 2008
iLabs Toolbox Javashare 2008iLabs Toolbox Javashare 2008
iLabs Toolbox Javashare 2008
rmzdotno
 
Android by Swecha
Android by SwechaAndroid by Swecha
Androd Listeners
Androd ListenersAndrod Listeners
Androd Listeners
ksheerod shri toshniwal
 
Scratching the Surface with JavaFX
Scratching the Surface with JavaFXScratching the Surface with JavaFX
Scratching the Surface with JavaFX
javafxpert
 
Event oriented programming
Event oriented programmingEvent oriented programming
Event oriented programming
Ashwini Awatare
 

Similar to Android Training - Pull to Refresh (20)

Lecture #3 activities and intents
Lecture #3  activities and intentsLecture #3  activities and intents
Lecture #3 activities and intents
 
Tips for building fast multi touch enabled web sites
 Tips for building fast multi touch enabled web sites Tips for building fast multi touch enabled web sites
Tips for building fast multi touch enabled web sites
 
Fast multi touch enabled web sites
Fast multi touch enabled web sitesFast multi touch enabled web sites
Fast multi touch enabled web sites
 
B2. activity and intent
B2. activity and intentB2. activity and intent
B2. activity and intent
 
ANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.doc
 
Application Design - Part 2
Application Design - Part 2Application Design - Part 2
Application Design - Part 2
 
FirefoxOS Window Management
FirefoxOS Window ManagementFirefoxOS Window Management
FirefoxOS Window Management
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
 
Events and Listeners in Android
Events and Listeners in AndroidEvents and Listeners in Android
Events and Listeners in Android
 
Nearsoft Mobile Onboarding Workshop
Nearsoft Mobile Onboarding WorkshopNearsoft Mobile Onboarding Workshop
Nearsoft Mobile Onboarding Workshop
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Development
 
Cucumber meets iPhone
Cucumber meets iPhoneCucumber meets iPhone
Cucumber meets iPhone
 
Multi Touch presentation
Multi Touch presentationMulti Touch presentation
Multi Touch presentation
 
Presentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestatePresentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestate
 
Guidelines for Android application design.pptx
Guidelines for Android application design.pptxGuidelines for Android application design.pptx
Guidelines for Android application design.pptx
 
iLabs Toolbox Javashare 2008
iLabs Toolbox Javashare 2008iLabs Toolbox Javashare 2008
iLabs Toolbox Javashare 2008
 
Android by Swecha
Android by SwechaAndroid by Swecha
Android by Swecha
 
Androd Listeners
Androd ListenersAndrod Listeners
Androd Listeners
 
Scratching the Surface with JavaFX
Scratching the Surface with JavaFXScratching the Surface with JavaFX
Scratching the Surface with JavaFX
 
Event oriented programming
Event oriented programmingEvent oriented programming
Event oriented programming
 

More from Kan-Han (John) Lu

Dagger for android
Dagger for androidDagger for android
Dagger for android
Kan-Han (John) Lu
 
Android develop guideline
Android develop guidelineAndroid develop guideline
Android develop guideline
Kan-Han (John) Lu
 
Working process and git branch strategy
Working process and git branch strategyWorking process and git branch strategy
Working process and git branch strategy
Kan-Han (John) Lu
 
Deep neural network for youtube recommendations
Deep neural network for youtube recommendationsDeep neural network for youtube recommendations
Deep neural network for youtube recommendations
Kan-Han (John) Lu
 
Android testing part i
Android testing part iAndroid testing part i
Android testing part i
Kan-Han (John) Lu
 
Cuda project paper
Cuda project paperCuda project paper
Cuda project paper
Kan-Han (John) Lu
 
Twitter as a personalizable information service ii
Twitter as a personalizable information service iiTwitter as a personalizable information service ii
Twitter as a personalizable information service ii
Kan-Han (John) Lu
 
Multimedia data minig and analytics sentiment analysis using social multimedia
Multimedia data minig and analytics sentiment analysis using social multimediaMultimedia data minig and analytics sentiment analysis using social multimedia
Multimedia data minig and analytics sentiment analysis using social multimedia
Kan-Han (John) Lu
 
ARM: Trusted Zone on Android
ARM: Trusted Zone on AndroidARM: Trusted Zone on Android
ARM: Trusted Zone on Android
Kan-Han (John) Lu
 
Android Training - Card Style
Android Training - Card StyleAndroid Training - Card Style
Android Training - Card Style
Kan-Han (John) Lu
 
Android Training - View Pager
Android Training - View PagerAndroid Training - View Pager
Android Training - View Pager
Kan-Han (John) Lu
 
Android Training - Sliding Menu
Android Training - Sliding MenuAndroid Training - Sliding Menu
Android Training - Sliding Menu
Kan-Han (John) Lu
 
Java: Exception Handling
Java: Exception HandlingJava: Exception Handling
Java: Exception Handling
Kan-Han (John) Lu
 
Dynamic Proxy by Java
Dynamic Proxy by JavaDynamic Proxy by Java
Dynamic Proxy by Java
Kan-Han (John) Lu
 
Code analyzer: FindBugs and PMD
Code analyzer: FindBugs and PMDCode analyzer: FindBugs and PMD
Code analyzer: FindBugs and PMD
Kan-Han (John) Lu
 
Android UI System
Android UI SystemAndroid UI System
Android UI System
Kan-Han (John) Lu
 
Android Fragment
Android FragmentAndroid Fragment
Android Fragment
Kan-Han (John) Lu
 
Android Training - Content Sharing
Android Training - Content SharingAndroid Training - Content Sharing
Android Training - Content Sharing
Kan-Han (John) Lu
 
Android Training - Action Bar
Android Training - Action BarAndroid Training - Action Bar
Android Training - Action Bar
Kan-Han (John) Lu
 
Explaination of angular
Explaination of angularExplaination of angular
Explaination of angular
Kan-Han (John) Lu
 

More from Kan-Han (John) Lu (20)

Dagger for android
Dagger for androidDagger for android
Dagger for android
 
Android develop guideline
Android develop guidelineAndroid develop guideline
Android develop guideline
 
Working process and git branch strategy
Working process and git branch strategyWorking process and git branch strategy
Working process and git branch strategy
 
Deep neural network for youtube recommendations
Deep neural network for youtube recommendationsDeep neural network for youtube recommendations
Deep neural network for youtube recommendations
 
Android testing part i
Android testing part iAndroid testing part i
Android testing part i
 
Cuda project paper
Cuda project paperCuda project paper
Cuda project paper
 
Twitter as a personalizable information service ii
Twitter as a personalizable information service iiTwitter as a personalizable information service ii
Twitter as a personalizable information service ii
 
Multimedia data minig and analytics sentiment analysis using social multimedia
Multimedia data minig and analytics sentiment analysis using social multimediaMultimedia data minig and analytics sentiment analysis using social multimedia
Multimedia data minig and analytics sentiment analysis using social multimedia
 
ARM: Trusted Zone on Android
ARM: Trusted Zone on AndroidARM: Trusted Zone on Android
ARM: Trusted Zone on Android
 
Android Training - Card Style
Android Training - Card StyleAndroid Training - Card Style
Android Training - Card Style
 
Android Training - View Pager
Android Training - View PagerAndroid Training - View Pager
Android Training - View Pager
 
Android Training - Sliding Menu
Android Training - Sliding MenuAndroid Training - Sliding Menu
Android Training - Sliding Menu
 
Java: Exception Handling
Java: Exception HandlingJava: Exception Handling
Java: Exception Handling
 
Dynamic Proxy by Java
Dynamic Proxy by JavaDynamic Proxy by Java
Dynamic Proxy by Java
 
Code analyzer: FindBugs and PMD
Code analyzer: FindBugs and PMDCode analyzer: FindBugs and PMD
Code analyzer: FindBugs and PMD
 
Android UI System
Android UI SystemAndroid UI System
Android UI System
 
Android Fragment
Android FragmentAndroid Fragment
Android Fragment
 
Android Training - Content Sharing
Android Training - Content SharingAndroid Training - Content Sharing
Android Training - Content Sharing
 
Android Training - Action Bar
Android Training - Action BarAndroid Training - Action Bar
Android Training - Action Bar
 
Explaination of angular
Explaination of angularExplaination of angular
Explaination of angular
 

Recently uploaded

Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
University of Maribor
 
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
yqqaatn0
 
Medical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptxMedical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptx
terusbelajar5
 
20240520 Planning a Circuit Simulator in JavaScript.pptx
20240520 Planning a Circuit Simulator in JavaScript.pptx20240520 Planning a Circuit Simulator in JavaScript.pptx
20240520 Planning a Circuit Simulator in JavaScript.pptx
Sharon Liu
 
Deep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless ReproducibilityDeep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless Reproducibility
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
Abdul Wali Khan University Mardan,kP,Pakistan
 
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốtmô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
HongcNguyn6
 
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
vluwdy49
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
Sérgio Sacani
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
Anagha Prasad
 
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Leonel Morgado
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
RitabrataSarkar3
 
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero WaterSharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Texas Alliance of Groundwater Districts
 
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdfTopic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
TinyAnderson
 
Thornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdfThornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdf
European Sustainable Phosphorus Platform
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
University of Maribor
 
ESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptxESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptx
PRIYANKA PATEL
 
Bob Reedy - Nitrate in Texas Groundwater.pdf
Bob Reedy - Nitrate in Texas Groundwater.pdfBob Reedy - Nitrate in Texas Groundwater.pdf
Bob Reedy - Nitrate in Texas Groundwater.pdf
Texas Alliance of Groundwater Districts
 
bordetella pertussis.................................ppt
bordetella pertussis.................................pptbordetella pertussis.................................ppt
bordetella pertussis.................................ppt
kejapriya1
 
Compexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titrationCompexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titration
Vandana Devesh Sharma
 

Recently uploaded (20)

Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
 
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
 
Medical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptxMedical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptx
 
20240520 Planning a Circuit Simulator in JavaScript.pptx
20240520 Planning a Circuit Simulator in JavaScript.pptx20240520 Planning a Circuit Simulator in JavaScript.pptx
20240520 Planning a Circuit Simulator in JavaScript.pptx
 
Deep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless ReproducibilityDeep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless Reproducibility
 
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
 
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốtmô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
 
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
 
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
 
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero WaterSharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
 
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdfTopic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
 
Thornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdfThornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdf
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
 
ESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptxESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptx
 
Bob Reedy - Nitrate in Texas Groundwater.pdf
Bob Reedy - Nitrate in Texas Groundwater.pdfBob Reedy - Nitrate in Texas Groundwater.pdf
Bob Reedy - Nitrate in Texas Groundwater.pdf
 
bordetella pertussis.................................ppt
bordetella pertussis.................................pptbordetella pertussis.................................ppt
bordetella pertussis.................................ppt
 
Compexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titrationCompexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titration
 

Android Training - Pull to Refresh

  • 1. Pull To Refresh Training 2014/03/11 John
  • 2. Outline ● Introduction ● Design ● How to implement ○ Touch Event ○ Adding view ○ On Touching ○ Smooth Scrolling ○ Window Manager ● Summary ● Homework
  • 4. Introduction There is a patent application for the “pull-to-refresh” feature that Loren Brichter pioneered in Tweetie and is now an extremely popular UI gesture used in a lot of iOS, Mac and Android apps. ref: http://goo.gl/PjTjMA
  • 5. Design 1. The user pulls down a list. 2. A message appears, telling the user who can pull down the list to refresh. 3. The user pulls the list further down. 4. A new message appears, telling the user that the list will refresh when he releases it. 5. A refreshing or loading message appears. 6. The refreshing message disappears and a new list is shown, with the new items at the top of the list.
  • 7. How to implement Touch event Touch Event
  • 8. How to implement Touch event The onInterceptTouchEvent() method is called whenever a touch event is detected on the surface of a ViewGroup, including on the surface of its children. The onInterceptTouchEvent() method gives a parent the chance to see any touch event before its children do.
  • 9. How to implement Managing Touch events Use ViewConfiguration Constants ref: http://goo.gl/JJN80z
  • 10. How to implement Managing Touch events Extend a Child View's Touchable Area ref: http://goo.gl/JJN80z
  • 12. How to implement On Touching ● Touch event filter. ● Setting variable up.
  • 13. How to implement On Touching ● Doing actions.
  • 14. How to implement Smooth scrolling Ref: http://goo.gl/eb3DQH SmoothScrollRunnable: ● Get next position from Interpolator. ● Set scroll to position. ● Post(this).
  • 15. How to implement Window Manager ● Every display has a WindowManager. ● WindowManager is a System Manager.
  • 16. How to implement Window Manager Ref: http://goo.gl/sWHpp
  • 17. Summary ● “Make it a little simpler” ● How dose Touch event transit. ● How to implement smooth scrolling.
  • 18. Homework Sample source code: (You can also fInd it at the video record nearby if this link is invalid.) https://www.dropbox.com/s/9zqt60tf7drppyi/TrainingPullToRefresh.zip Basic: ● Let it be pulled from left. Advance: ● Let it be pulled from both top and bottom.