Contextual Action Mode - Android Studio Tutorial

Veröffentlicht am: 13 Dezember 2017
auf dem Kanal: Coding in Flow
33,600
581

In this video we will learn, how to activate the contextual action mode, which is very similar to the floating context menu, but shows the menu options in the action bar instead of a pop up menu. We will activate this contextual action menu on a long click, by setting an onLongClickListener on our View. We will set it's title and implement an ActionMode.Callback interface, in which we then override the oncreateActionMode, onPrepareActionMode, onActionItemClicked and onDestroyActionMode methods. There we inflate our app bar menu with our own menu xml file and handle click events on the single menu items.
Lastly we will learn, how to change the color of our action mode app bar and how to prevent it from pushing our toolbar away, instead of displaying on top of it, by using the windowActionBarOverlay attribute in our styles.xml file.

Source code:
https://gist.github.com/codinginflow/...

____________________
💻 Find the BEST programming tutorials on TutHub:
https://tuthub.io

⭐ Get my MVVM Caching Course now:
https://codinginflow.com/caching

❗ Subscribe to the channel:
   / codinginflo.  .

📨 Subscribe to the Coding in Flow newsletter:
https://codinginflow.com/newsletter

❓ Join our free developer community:
  / discord  

📣 Follow Coding in Flow on other sites:
Facebook:   / codinginflow  
Instagram:   / codinginflow  
TikTok:   / codinginflow  
Twitter:   / codinginflow  
Github: https://github.com/codinginflow

💰 Business requests, sponsoring, etc.: info@codinginflow.com


Auf dieser Seite können Sie das Online-Video Contextual Action Mode - Android Studio Tutorial mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Coding in Flow 13 Dezember 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 33,600 Mal angesehen und es wurde von 581 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!