How to Create QuickAction Dialog in Android  └ UI



트위터 공식 어플리케이션에서의 QuickAction 기능을 찾으려 나름 열심히 노력했어요.

이놈의 정식명칭은 QuickContactsBadge 라는 클래스인데요.

OS 풀소스상에는 있었지만, 부족한 실력으로 풀 소스를 분석하기엔 역부족 -_-

 

마침내 인터넷 한구석의 블로그에서 고귀한 자료를 발견!

 

아래는 해당 블로그의 포스트 내용입니다.

참고하세요.

 

포스트 주소 : http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/


그리고 또다른 구글 그룹의 오픈소스경로 (이곳은 관련코드의 SVN 경로가 존재합니다.)
http://code.google.com/p/simple-quickactions/ 

 

Official Twitter application for Android  has introduced new Android UI features and behavior patterns such as Dashboard, Search Bar, QuickAction and Action Bar. One of the interesting pattern is QuickActions that displays contextual actions in a list view. This pattern actually already exists in QuickContact dialog/bar in default Contact application (since Android 2.0).

 

QuickContact QuickContact

 

The QuickActions dialog is not included in standard Android SDK, so we have to create it manually. At first, i had no idea on how to create it so i decided to download and read the Contact app source code from  Android git. I found that the QuickContact dialog  uses private API call (com.android.internal.policy.PolicyManager) that does not exists in standard SDK. After posting question about it on google groups and stack overflow, i got the solution for it from Qberticus (thanx Qberticus!).

Qberticus’s QuickActions uses simple/plain layout so i have to create a custom layout so it will look like QuickContact in Contact app or QuickActions in Twitter app. Based on QuickContact source code, i made a slight modification on Qberticus’s BetterPopupWindow class and extended it to implement custom layout. I also made it customizeable, so the icon and text in action list can be customized.

Here are the screenshoots of QuickActions demo:

 

QuickContact / Twitter-like QuickActions


... 생략 ...

Download full source code

Gallery3D-like QuickActions


덧글

  • Brian W. 2010/12/28 08:10 # 삭제 답글

    I found your blog from the trackbacks section of the Android Developers blog. Your QuickActions code looks like exactly what I was looking for. Thank you.
  • 농사꾼봉팔 2010/12/28 13:24 #

    Thank you for visiting my blog :-)
    Glad you wanted to find is a reference.
    If you have time to Twitter and play with me (@sungsik81)
댓글 입력 영역


통계 위젯 (화이트)

1622
132
358626

red 210