SlideShare a Scribd company logo
1 of 33
Thaana on Android - 
Introduction & Best Practices 
Naail Abdul Rahman 
@kudanai
Overview 
• Thaana Support across devices 
– API Versions 
• Using custom fonts 
– Android Views 
– Memory optimization 
• Layout Direction 
– Setting specific views or entire application for 
RTL 
• Handling Input 
• aThaanaUtils
Demo App 
• Download the demo app 
http://github.com/kudanai/aThaanaUtils/releases
Demo App
API Versions 
• Android 1.0 started off 2007 
• Android 2.3 “Ginger Bread” 
– API 10 
• Android 3.0 “Honeycomb” 
– API 11 
• Android 4.0 “Ice Cream Sandwich” 
– API 14 
• Android 4.2 “Jelly Bean MR1” 
– API 17
API Versions 
• Android 3+ 
– Proper Unicode support started 
– New UI paradigms 
– Not seen in the wild a lot 
• Android 4+ (API 14) 
– Action Bar pattern 
– Roboto Fonts 
• Android 4.2+ (API 17) 
– Proper RTL support
API Versions
API Versions
API Versions 
• Android is not like iOS, where we can safely 
expect a large % of the user-base to 
upgrade. 
• Stick to API 14+ 
– Lower versions limit potential 
– Not enough users to justify going there anyway. 
• If you Dare, stick to 17+
Using Custom Fonts 
• Android allows embedding your own 
application fonts. 
• Read UI guidelines on using custom fonts. 
• Any well formed TTF or OTF font is valid.
Using Custom Fonts 
• Throw them in the Assets folder
Android Views 
• Two main classes of views commonly 
used. 
– TextView subclasses 
– WebView
TextView Subclasses
TextView Subclasses 
• Obtain a Typeface object from the Assets 
• Set typeface to the TextView using the 
TextView.setTypeFace() method.
WebView 
• Backed by WebKit rendering engine. 
• Can render Thaana on Android 2.3 as 
well. 
• There are some bugs in android 4.2 - 4.3
WebView 
• CSS3 @font-face 
• Reference Assets folder using 
file:///android_asset/ 
• Apply the font-face to html elements. 
Webkit does the rest.
Memory Optimization 
• Typeface objects consume memory. 
• Views will hold strong references to 
Typeface objects. 
• More Views with custom fonts = More 
memory… naturally. 
– Careful while using ListView’s 
• Despite view recycling mechanisms, improper 
handling can bloat memory use.
Memory Optimization 
• DON’T 
– Use a lot of different fonts or create a new 
Typeface object for ever view 
– Instantiate a typeface for every row of a 
ListView 
– use custom views that call 
Typeface.createFromAsset() in their 
constructor, in ListViews
Memory Optimization 
• DO 
– Share the Typeface as much as possible. 
Avoid instantiating too many. 
– If using a list view, let the Adapter own the 
Typeface objects. 
– If using custom views… (see next)
Memory Optimization 
• Use a Resource Manager pattern 
– Basically a Singleton which will cache 
Typeface objects 
– Cache can use weak referencing for further 
optimization, if required 
– Lazy instantiate Typefaces as required 
– Only one object per Typeface, throughout the 
entire application scope.
Layout Direction 
• Proper RTL since API 17+ 
– Add android:supportsRtl="true” to the 
manifest to enable RTL methods 
– Some RTL specific methods have no effect 
without this.
Layout Direction 
• Pre 17, 
– Align everything to the right and hope for the 
best.
Layout Direction 
• Usually you either flip specific views or flip 
everything. 
– onCreate() of activities
Layout Direction 
• View direction RTL will flip ActionBar and 
NavigationDrawer correctly to the right. As 
expected. 
• For Navigation Drawer, 
– Can either use “start” or “right” for 
layout_gravity
Layout Direction 
• Prefer “start” to “right”… 
• ActionBar title can be set using setTitle() 
method. However, won’t display correctly. 
– Must set a custom view, which uses a custom 
typeface.
Layout Direction
Handling Input 
• Input mainly done into EditText (or 
subclasses) 
• Can use two methods to handle Thaana 
Input 
– Use an InputFilter or a TextWatcher to modify 
user input (substitute latin->thaana) on the fly. 
– Use a custom KeyboardView
Handling Input 
• Must apply typefaces and direction hints to 
EditText as before. 
• InputFilter 
– Single method, filter() 
• Receives the user input. Can modify the input as 
necessary. 
• Clean. 
• Disable Autocorrect !important 
– Does not always work.
Handling Input 
• TextWatcher 
– Attached to an Editable, will get called when 
modified. 
– More flexible, but risky.
Handling Input 
• TextWatcher 
– Modifications will trigger itself. 
– Will race unless recursion is checked. 
• Less error prone to use a proper 
TextWatcher than an InputFilter. 
• Can use multiple TextWatchers on a single 
editable.
aThaanaUtils 
• http://github.com/kudanai/aThaanaUtils 
• API 14+ 
• Collection of the above concepts. 
Currently provides: 
– TypefaceManager to handle font loading 
– Some Custom Views (somewhat pointless but 
why not) 
– TextWatcher & InputFilter for Input Handling 
– Misc. Utility functions
aThaanaUtils 
• Planned additions 
– Custom KeyboardView for input 
• Already done, but too buggy right now. 
– More conversion mechanisms 
– Upload to repo for easier inclusion in projects
Thank you  
Questions? 
tweet-> @kudanai

More Related Content

Similar to Using Thaana on Android

Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Patrick Savalle
 
Adapter and cache technique
Adapter and cache techniqueAdapter and cache technique
Adapter and cache techniqueHoang Vy Nguyen
 
Your API is Bad and You Should Feel Bad
Your API is Bad and You Should Feel BadYour API is Bad and You Should Feel Bad
Your API is Bad and You Should Feel BadAmanda Folson
 
Riding the Edge with Ember.js
Riding the Edge with Ember.jsRiding the Edge with Ember.js
Riding the Edge with Ember.jsaortbals
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.pptkstalin2
 
Don Thorp & Marshall Culpepper: Advanced Titanium Development for Android
Don Thorp & Marshall Culpepper: Advanced Titanium Development for AndroidDon Thorp & Marshall Culpepper: Advanced Titanium Development for Android
Don Thorp & Marshall Culpepper: Advanced Titanium Development for AndroidAxway Appcelerator
 
FOSDEM19 MySQL Component Infrastructure
FOSDEM19 MySQL Component InfrastructureFOSDEM19 MySQL Component Infrastructure
FOSDEM19 MySQL Component InfrastructureGeorgi Kodinov
 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSGil Fink
 
Responsive Web Design and Accessibility: Challenges and Solutions
Responsive Web Design and Accessibility: Challenges and SolutionsResponsive Web Design and Accessibility: Challenges and Solutions
Responsive Web Design and Accessibility: Challenges and SolutionsDylan Barrell
 
Test Automation with Twist and Sahi
Test Automation with Twist and SahiTest Automation with Twist and Sahi
Test Automation with Twist and Sahiericjamesblackburn
 
Ruby on Rails Plugins - Rich Collins
Ruby on Rails Plugins - Rich CollinsRuby on Rails Plugins - Rich Collins
Ruby on Rails Plugins - Rich CollinsRich Collins
 
Using js link and display templates
Using js link and display templatesUsing js link and display templates
Using js link and display templatesPaul Hunt
 
Infinum Android Talks #02 - How to write an annotation processor in Android
Infinum Android Talks #02 - How to write an annotation processor in AndroidInfinum Android Talks #02 - How to write an annotation processor in Android
Infinum Android Talks #02 - How to write an annotation processor in AndroidInfinum
 
DotNetNuke Urls - Best practice for administrators, editors and developers
DotNetNuke Urls - Best practice for administrators, editors and developersDotNetNuke Urls - Best practice for administrators, editors and developers
DotNetNuke Urls - Best practice for administrators, editors and developersbrchapman
 
Drupal8 for Symfony developers - Dutch PHP
Drupal8 for Symfony developers - Dutch PHPDrupal8 for Symfony developers - Dutch PHP
Drupal8 for Symfony developers - Dutch PHPAntonio Peric-Mazar
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorialsunniboy
 

Similar to Using Thaana on Android (20)

Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)
 
Java Servlet
Java Servlet Java Servlet
Java Servlet
 
Adapter and cache technique
Adapter and cache techniqueAdapter and cache technique
Adapter and cache technique
 
Your API is Bad and You Should Feel Bad
Your API is Bad and You Should Feel BadYour API is Bad and You Should Feel Bad
Your API is Bad and You Should Feel Bad
 
Riding the Edge with Ember.js
Riding the Edge with Ember.jsRiding the Edge with Ember.js
Riding the Edge with Ember.js
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet1.ppt
Servlet1.pptServlet1.ppt
Servlet1.ppt
 
Don Thorp & Marshall Culpepper: Advanced Titanium Development for Android
Don Thorp & Marshall Culpepper: Advanced Titanium Development for AndroidDon Thorp & Marshall Culpepper: Advanced Titanium Development for Android
Don Thorp & Marshall Culpepper: Advanced Titanium Development for Android
 
FOSDEM19 MySQL Component Infrastructure
FOSDEM19 MySQL Component InfrastructureFOSDEM19 MySQL Component Infrastructure
FOSDEM19 MySQL Component Infrastructure
 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJS
 
Manchester Meetup #3
Manchester Meetup #3Manchester Meetup #3
Manchester Meetup #3
 
Responsive Web Design and Accessibility: Challenges and Solutions
Responsive Web Design and Accessibility: Challenges and SolutionsResponsive Web Design and Accessibility: Challenges and Solutions
Responsive Web Design and Accessibility: Challenges and Solutions
 
Test Automation with Twist and Sahi
Test Automation with Twist and SahiTest Automation with Twist and Sahi
Test Automation with Twist and Sahi
 
Ruby on Rails Plugins - Rich Collins
Ruby on Rails Plugins - Rich CollinsRuby on Rails Plugins - Rich Collins
Ruby on Rails Plugins - Rich Collins
 
Using js link and display templates
Using js link and display templatesUsing js link and display templates
Using js link and display templates
 
Infinum Android Talks #02 - How to write an annotation processor in Android
Infinum Android Talks #02 - How to write an annotation processor in AndroidInfinum Android Talks #02 - How to write an annotation processor in Android
Infinum Android Talks #02 - How to write an annotation processor in Android
 
DotNetNuke Urls - Best practice for administrators, editors and developers
DotNetNuke Urls - Best practice for administrators, editors and developersDotNetNuke Urls - Best practice for administrators, editors and developers
DotNetNuke Urls - Best practice for administrators, editors and developers
 
Drupal8 for Symfony developers - Dutch PHP
Drupal8 for Symfony developers - Dutch PHPDrupal8 for Symfony developers - Dutch PHP
Drupal8 for Symfony developers - Dutch PHP
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorial
 

Recently uploaded

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 

Recently uploaded (20)

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 

Using Thaana on Android

  • 1. Thaana on Android - Introduction & Best Practices Naail Abdul Rahman @kudanai
  • 2. Overview • Thaana Support across devices – API Versions • Using custom fonts – Android Views – Memory optimization • Layout Direction – Setting specific views or entire application for RTL • Handling Input • aThaanaUtils
  • 3. Demo App • Download the demo app http://github.com/kudanai/aThaanaUtils/releases
  • 5. API Versions • Android 1.0 started off 2007 • Android 2.3 “Ginger Bread” – API 10 • Android 3.0 “Honeycomb” – API 11 • Android 4.0 “Ice Cream Sandwich” – API 14 • Android 4.2 “Jelly Bean MR1” – API 17
  • 6. API Versions • Android 3+ – Proper Unicode support started – New UI paradigms – Not seen in the wild a lot • Android 4+ (API 14) – Action Bar pattern – Roboto Fonts • Android 4.2+ (API 17) – Proper RTL support
  • 9. API Versions • Android is not like iOS, where we can safely expect a large % of the user-base to upgrade. • Stick to API 14+ – Lower versions limit potential – Not enough users to justify going there anyway. • If you Dare, stick to 17+
  • 10. Using Custom Fonts • Android allows embedding your own application fonts. • Read UI guidelines on using custom fonts. • Any well formed TTF or OTF font is valid.
  • 11. Using Custom Fonts • Throw them in the Assets folder
  • 12. Android Views • Two main classes of views commonly used. – TextView subclasses – WebView
  • 14. TextView Subclasses • Obtain a Typeface object from the Assets • Set typeface to the TextView using the TextView.setTypeFace() method.
  • 15. WebView • Backed by WebKit rendering engine. • Can render Thaana on Android 2.3 as well. • There are some bugs in android 4.2 - 4.3
  • 16. WebView • CSS3 @font-face • Reference Assets folder using file:///android_asset/ • Apply the font-face to html elements. Webkit does the rest.
  • 17. Memory Optimization • Typeface objects consume memory. • Views will hold strong references to Typeface objects. • More Views with custom fonts = More memory… naturally. – Careful while using ListView’s • Despite view recycling mechanisms, improper handling can bloat memory use.
  • 18. Memory Optimization • DON’T – Use a lot of different fonts or create a new Typeface object for ever view – Instantiate a typeface for every row of a ListView – use custom views that call Typeface.createFromAsset() in their constructor, in ListViews
  • 19. Memory Optimization • DO – Share the Typeface as much as possible. Avoid instantiating too many. – If using a list view, let the Adapter own the Typeface objects. – If using custom views… (see next)
  • 20. Memory Optimization • Use a Resource Manager pattern – Basically a Singleton which will cache Typeface objects – Cache can use weak referencing for further optimization, if required – Lazy instantiate Typefaces as required – Only one object per Typeface, throughout the entire application scope.
  • 21. Layout Direction • Proper RTL since API 17+ – Add android:supportsRtl="true” to the manifest to enable RTL methods – Some RTL specific methods have no effect without this.
  • 22. Layout Direction • Pre 17, – Align everything to the right and hope for the best.
  • 23. Layout Direction • Usually you either flip specific views or flip everything. – onCreate() of activities
  • 24. Layout Direction • View direction RTL will flip ActionBar and NavigationDrawer correctly to the right. As expected. • For Navigation Drawer, – Can either use “start” or “right” for layout_gravity
  • 25. Layout Direction • Prefer “start” to “right”… • ActionBar title can be set using setTitle() method. However, won’t display correctly. – Must set a custom view, which uses a custom typeface.
  • 27. Handling Input • Input mainly done into EditText (or subclasses) • Can use two methods to handle Thaana Input – Use an InputFilter or a TextWatcher to modify user input (substitute latin->thaana) on the fly. – Use a custom KeyboardView
  • 28. Handling Input • Must apply typefaces and direction hints to EditText as before. • InputFilter – Single method, filter() • Receives the user input. Can modify the input as necessary. • Clean. • Disable Autocorrect !important – Does not always work.
  • 29. Handling Input • TextWatcher – Attached to an Editable, will get called when modified. – More flexible, but risky.
  • 30. Handling Input • TextWatcher – Modifications will trigger itself. – Will race unless recursion is checked. • Less error prone to use a proper TextWatcher than an InputFilter. • Can use multiple TextWatchers on a single editable.
  • 31. aThaanaUtils • http://github.com/kudanai/aThaanaUtils • API 14+ • Collection of the above concepts. Currently provides: – TypefaceManager to handle font loading – Some Custom Views (somewhat pointless but why not) – TextWatcher & InputFilter for Input Handling – Misc. Utility functions
  • 32. aThaanaUtils • Planned additions – Custom KeyboardView for input • Already done, but too buggy right now. – More conversion mechanisms – Upload to repo for easier inclusion in projects
  • 33. Thank you  Questions? tweet-> @kudanai