SlideShare a Scribd company logo
Action Bar – AB
            &
ActionBarSherlock - ABS
Content
  Action Bar
  General Organization Action Bar
  Split Action Bar
  Contextual Action Bar
  ActionBarSherlock
   Requirements
  Code Snippets
  Summary
  Questions
Action bar
 The action bar is a window feature that identify
 the application and user location, and provides
 user actions and navigation modes

 Action bar offers users a consistent interface
 across application.

 Introduced in API level 11 (Android 3.0
 Honeycomb)
Backward Compatibility
 ActionBar class is not available in older versions
 of Android (< 3.0).

 Alternate: ActionBarSherlock (ABS) library
 helps creating Action bar, back up to android 2.x

 Other option: Action Bar Compatibility   (see
 sample app in API Demos)
General Organization



1. App Icon
2. View Control
3. Action Buttons
4. Action Overflow
1. App Icon
 Establishes app's identity


 Displays Up caret to the left of the app icon, to
 navigate up the hierarchy.
2. View control
 If your app displays data in different views, this
 segment of the action bar allows users to switch
 views.
  i.     Drop-down menus
  ii.    Tab controls
  iii.   Custom Navigation

 App title or longer branding information can also
 use this space.
3. Action Buttons
 Action buttons on the action bar surface your
 app's most important activities.

 Actions that don't fit in the action bar are moved
 automatically to the action overflow.




 Action buttons used throughout the Gmail application
4. Action overflow
 Action overflow provides access to frequently used
  actions.
 The overflow icon only appears on phones that
  have no menu hardware keys.
 Phones with menu keys display the action overflow
  when the user presses the key.




       Action overflow is pinned to the right side.
Split Action Bars
    There are three possible locations to split action
     bar content.

    1. Main action bar
    2. Top bar
    3. Bottom bar


 Note: Available on Android 4.0 (API level 14) and
    higher, for native AB, or use ABS for backward
    compatibility
AB on Different Screen Sizes




            Gmail App
How many items will fit in the main
action bar?

 Action buttons in the main action bar may not
 occupy more than 50% of the bar's width.

 Action buttons on bottom action bars can use the
 entire width.
How many actions will fit in the
main action bar?

 Density-independent pixels (dp) determine the
 number of items in action bar.

 smaller than 360 dp = 2 icons
 360-499 dp = 3 icons
 500-599 dp = 4 icons
 600 dp and larger = 5 icons
Contextual Action Bar

 A contextual action bar (CAB) is a temporary
 action bar.

 It overlays the app's action bar for the duration of
 a particular sub-task.

 CABs are most typically used for tasks that
 involve acting on selected data or text.
Contextual Action Bar

 Like normal Action Bar, CAB also support split
 action bar.

 ActionMode represents a contextual mode (or
 CAB) of the user interface.

 Dismiss the CAB via
  i.    Navigation bar's Back button
  ii.   CAB's checkmark button
Contextual Action Bar
ActionBarSherlock (ABS)

 ActionBarSherlock is a standalone library.


 It allows developer to develop apps with action
 bar on Android API level 2.x and up.

 Current version: 4.2.0 — 08-10-2012


 Developed by : Jake Wharton
ActionBarSherlock (ABS)


 The library will automatically use native Action
 Bar implementation on Android 4.0 or above.



 On Android 3.x (Honeycomb), app will prefer ABS
 over native Action Bar.
ABS Requirements


 It is required that both ABS library and your
 project are compiled with Android 4.0 or newer.



 It is also required that you are compiling with JDK
 1.6 in both, your editor and build systems.
ABS Theme Requirements
 The ABS library provides three core themes.


   Theme.Sherlock
   Theme.Sherlock.Light
   Theme.Sherlock.Light.DarkActionBar


 One of above theme is must for all activities
 having action bar.

 Custom Theme
Native AB VS ABS
Native AB classes    ABS library classes


 Activity            SherlockActivity
 FragmentActivity    SherlockFragmentActivity
 Fragment            SherlockFragment
 ListFragment        SherlockListFragment
 ListActivity        SherlockListActivity
 DialogFragment      SherlockDialogFragment
ABS Common Imports
 Ensure that you are using these types where
 appropriate

   com.actionbarsherlock.app.ActionBar
   com.actionbarsherlock.view.Menu
   com.actionbarsherlock.view.MenuItem
   com.actionbarsherlock.view.MenuInflater


  Note: ABS contain same classes that are named
  same as their native counterparts
ABS and Proguard

 Add the following lines in proguard.cfg, to ensure
 proper functionality of the library:

  -keep class android.support.v4.app.** { *; }
  -keep interface android.support.v4.app.** { *; }
  -keep class com.actionbarsherlock.** { *; }
  -keep interface com.actionbarsherlock.** { *; }
  -keep attributes *Annotation*
Action Bar – Menu xml
 Create XML file in /res/menu/my_menu
Action Bar
Action Bar
Menu Item
Split Action Bar

 Update AndroidManifest.xml
Tabs
ActionMode (CAB)
What else ?
 Action Providers i.e.        Search
     Settings
     Share Action Provider    Overlay

 Navigation Mode              Static Attachment
                                 No need to extend
 Progress                        SherlockActivity etc
   Indeterminate Progress       Implement
   Horizontal Progress Bar       OnCreateOptionsMenuListe
                                  ner
Summary

 Native Action bar - Introduced in Android API 11
    (Android 3.0 Honeycomb)
   ActionBarSherlock support API 2.x and above.
   ABS library will automatically use native Action
    Bar implementation on Android 4.0 or above.
   Be careful while importing classes, ABS have
    same class names as native AB.
   Split Action bar
   Contextual Action bar
Questions

More Related Content

Similar to Action bar & ActionBarSherlock

Android ui patterns
Android ui patternsAndroid ui patterns
Android ui patterns
Mobile March
 
Android Setting Basic
Android Setting BasicAndroid Setting Basic
Android Setting Basic
Hosuk Shin
 
Android UI components walkthrough
Android UI components walkthroughAndroid UI components walkthrough
Android UI components walkthrough
Patrick Yin
 
A Comprehensive Guide of Flutter AppBar Widget.pdf
A Comprehensive Guide of Flutter AppBar Widget.pdfA Comprehensive Guide of Flutter AppBar Widget.pdf
A Comprehensive Guide of Flutter AppBar Widget.pdf
getwidget
 
Modern Android UI, or not by Action Bar alone
Modern Android UI, or not by Action Bar aloneModern Android UI, or not by Action Bar alone
Modern Android UI, or not by Action Bar alone
Anton Rutkevich
 
Google I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb HighlightsGoogle I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb Highlights
Romain Guy
 
AppBar Class In Flutter.pptx
AppBar Class In Flutter.pptxAppBar Class In Flutter.pptx
AppBar Class In Flutter.pptx
BOSC Tech Labs
 
70 357 practice test
70 357 practice test70 357 practice test
70 357 practice test
shirlybaker1
 
Exploring Adobe Flex
Exploring Adobe Flex Exploring Adobe Flex
Exploring Adobe Flex
senthil0809
 
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Paris Android User Group
 
Calabash-iOS
Calabash-iOSCalabash-iOS
Adobe MAX Recap
Adobe MAX RecapAdobe MAX Recap
Adobe MAX Recap
easelsolutions
 
Building a chatbot – step by step
Building a chatbot – step by stepBuilding a chatbot – step by step
Building a chatbot – step by step
CodeOps Technologies LLP
 
React native
React nativeReact native
Developing for Mobile with Adobe AIR
Developing for Mobile with Adobe AIRDeveloping for Mobile with Adobe AIR
Developing for Mobile with Adobe AIR
Matthew Fabb
 
App design guide
App design guideApp design guide
App design guide
Jintin Lin
 
Beyond the Basics, Debugging with Firebug and Web Inspector
Beyond the Basics, Debugging with Firebug and Web InspectorBeyond the Basics, Debugging with Firebug and Web Inspector
Beyond the Basics, Debugging with Firebug and Web Inspector
Steven Roussey
 
Getting started with ibm worklight tips
Getting started with ibm worklight tipsGetting started with ibm worklight tips
Getting started with ibm worklight tips
bupbechanhgmail
 
AIR 3.0
AIR 3.0AIR 3.0
Applico Android Info Session at Columbia University
Applico Android Info Session at Columbia UniversityApplico Android Info Session at Columbia University
Applico Android Info Session at Columbia University
Applico
 

Similar to Action bar & ActionBarSherlock (20)

Android ui patterns
Android ui patternsAndroid ui patterns
Android ui patterns
 
Android Setting Basic
Android Setting BasicAndroid Setting Basic
Android Setting Basic
 
Android UI components walkthrough
Android UI components walkthroughAndroid UI components walkthrough
Android UI components walkthrough
 
A Comprehensive Guide of Flutter AppBar Widget.pdf
A Comprehensive Guide of Flutter AppBar Widget.pdfA Comprehensive Guide of Flutter AppBar Widget.pdf
A Comprehensive Guide of Flutter AppBar Widget.pdf
 
Modern Android UI, or not by Action Bar alone
Modern Android UI, or not by Action Bar aloneModern Android UI, or not by Action Bar alone
Modern Android UI, or not by Action Bar alone
 
Google I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb HighlightsGoogle I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb Highlights
 
AppBar Class In Flutter.pptx
AppBar Class In Flutter.pptxAppBar Class In Flutter.pptx
AppBar Class In Flutter.pptx
 
70 357 practice test
70 357 practice test70 357 practice test
70 357 practice test
 
Exploring Adobe Flex
Exploring Adobe Flex Exploring Adobe Flex
Exploring Adobe Flex
 
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
 
Calabash-iOS
Calabash-iOSCalabash-iOS
Calabash-iOS
 
Adobe MAX Recap
Adobe MAX RecapAdobe MAX Recap
Adobe MAX Recap
 
Building a chatbot – step by step
Building a chatbot – step by stepBuilding a chatbot – step by step
Building a chatbot – step by step
 
React native
React nativeReact native
React native
 
Developing for Mobile with Adobe AIR
Developing for Mobile with Adobe AIRDeveloping for Mobile with Adobe AIR
Developing for Mobile with Adobe AIR
 
App design guide
App design guideApp design guide
App design guide
 
Beyond the Basics, Debugging with Firebug and Web Inspector
Beyond the Basics, Debugging with Firebug and Web InspectorBeyond the Basics, Debugging with Firebug and Web Inspector
Beyond the Basics, Debugging with Firebug and Web Inspector
 
Getting started with ibm worklight tips
Getting started with ibm worklight tipsGetting started with ibm worklight tips
Getting started with ibm worklight tips
 
AIR 3.0
AIR 3.0AIR 3.0
AIR 3.0
 
Applico Android Info Session at Columbia University
Applico Android Info Session at Columbia UniversityApplico Android Info Session at Columbia University
Applico Android Info Session at Columbia University
 

Recently uploaded

Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Neo4j
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 

Recently uploaded (20)

Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 

Action bar & ActionBarSherlock

  • 1. Action Bar – AB & ActionBarSherlock - ABS
  • 2. Content  Action Bar  General Organization Action Bar  Split Action Bar  Contextual Action Bar  ActionBarSherlock  Requirements  Code Snippets  Summary  Questions
  • 3. Action bar  The action bar is a window feature that identify the application and user location, and provides user actions and navigation modes  Action bar offers users a consistent interface across application.  Introduced in API level 11 (Android 3.0 Honeycomb)
  • 4. Backward Compatibility  ActionBar class is not available in older versions of Android (< 3.0).  Alternate: ActionBarSherlock (ABS) library helps creating Action bar, back up to android 2.x  Other option: Action Bar Compatibility (see sample app in API Demos)
  • 5. General Organization 1. App Icon 2. View Control 3. Action Buttons 4. Action Overflow
  • 6. 1. App Icon  Establishes app's identity  Displays Up caret to the left of the app icon, to navigate up the hierarchy.
  • 7. 2. View control  If your app displays data in different views, this segment of the action bar allows users to switch views. i. Drop-down menus ii. Tab controls iii. Custom Navigation  App title or longer branding information can also use this space.
  • 8. 3. Action Buttons  Action buttons on the action bar surface your app's most important activities.  Actions that don't fit in the action bar are moved automatically to the action overflow. Action buttons used throughout the Gmail application
  • 9. 4. Action overflow  Action overflow provides access to frequently used actions.  The overflow icon only appears on phones that have no menu hardware keys.  Phones with menu keys display the action overflow when the user presses the key. Action overflow is pinned to the right side.
  • 10. Split Action Bars  There are three possible locations to split action bar content. 1. Main action bar 2. Top bar 3. Bottom bar  Note: Available on Android 4.0 (API level 14) and higher, for native AB, or use ABS for backward compatibility
  • 11.
  • 12. AB on Different Screen Sizes Gmail App
  • 13. How many items will fit in the main action bar?  Action buttons in the main action bar may not occupy more than 50% of the bar's width.  Action buttons on bottom action bars can use the entire width.
  • 14. How many actions will fit in the main action bar?  Density-independent pixels (dp) determine the number of items in action bar.  smaller than 360 dp = 2 icons  360-499 dp = 3 icons  500-599 dp = 4 icons  600 dp and larger = 5 icons
  • 15. Contextual Action Bar  A contextual action bar (CAB) is a temporary action bar.  It overlays the app's action bar for the duration of a particular sub-task.  CABs are most typically used for tasks that involve acting on selected data or text.
  • 16. Contextual Action Bar  Like normal Action Bar, CAB also support split action bar.  ActionMode represents a contextual mode (or CAB) of the user interface.  Dismiss the CAB via i. Navigation bar's Back button ii. CAB's checkmark button
  • 18. ActionBarSherlock (ABS)  ActionBarSherlock is a standalone library.  It allows developer to develop apps with action bar on Android API level 2.x and up.  Current version: 4.2.0 — 08-10-2012  Developed by : Jake Wharton
  • 19. ActionBarSherlock (ABS)  The library will automatically use native Action Bar implementation on Android 4.0 or above.  On Android 3.x (Honeycomb), app will prefer ABS over native Action Bar.
  • 20. ABS Requirements  It is required that both ABS library and your project are compiled with Android 4.0 or newer.  It is also required that you are compiling with JDK 1.6 in both, your editor and build systems.
  • 21. ABS Theme Requirements  The ABS library provides three core themes.  Theme.Sherlock  Theme.Sherlock.Light  Theme.Sherlock.Light.DarkActionBar  One of above theme is must for all activities having action bar.  Custom Theme
  • 22. Native AB VS ABS Native AB classes ABS library classes  Activity  SherlockActivity  FragmentActivity  SherlockFragmentActivity  Fragment  SherlockFragment  ListFragment  SherlockListFragment  ListActivity  SherlockListActivity  DialogFragment  SherlockDialogFragment
  • 23. ABS Common Imports  Ensure that you are using these types where appropriate  com.actionbarsherlock.app.ActionBar  com.actionbarsherlock.view.Menu  com.actionbarsherlock.view.MenuItem  com.actionbarsherlock.view.MenuInflater Note: ABS contain same classes that are named same as their native counterparts
  • 24. ABS and Proguard  Add the following lines in proguard.cfg, to ensure proper functionality of the library: -keep class android.support.v4.app.** { *; } -keep interface android.support.v4.app.** { *; } -keep class com.actionbarsherlock.** { *; } -keep interface com.actionbarsherlock.** { *; } -keep attributes *Annotation*
  • 25. Action Bar – Menu xml  Create XML file in /res/menu/my_menu
  • 29. Split Action Bar  Update AndroidManifest.xml
  • 30. Tabs
  • 32.
  • 33. What else ?  Action Providers i.e.  Search  Settings  Share Action Provider  Overlay  Navigation Mode  Static Attachment  No need to extend  Progress SherlockActivity etc  Indeterminate Progress  Implement  Horizontal Progress Bar OnCreateOptionsMenuListe ner
  • 34. Summary  Native Action bar - Introduced in Android API 11 (Android 3.0 Honeycomb)  ActionBarSherlock support API 2.x and above.  ABS library will automatically use native Action Bar implementation on Android 4.0 or above.  Be careful while importing classes, ABS have same class names as native AB.  Split Action bar  Contextual Action bar