Contextual Action Mode - Android Studio Tutorial

Опубликовано: 13 Декабрь 2017
на канале: 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


На этой странице сайта вы можете посмотреть видео онлайн Contextual Action Mode - Android Studio Tutorial длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Coding in Flow 13 Декабрь 2017, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 33,600 раз и оно понравилось 581 зрителям. Приятного просмотра!