1 / 18

To be an Android Expert

앱창작터. To be an Android Expert. 안드로이드 여대생 기초 과정. UI – Toast & Notification. 문양세 , 최미정 강원대학교 IT 대학 컴퓨터학부. Notification 의 종류 (1/2). Toast notification 사용자에게 알리고자 하는 짧은 메시지를 ( 잠시 ) 표현한다 . Foreground 에서 수행되는 activity 뿐 아니라 , background 에서 수행되는 service 에서도 생성될 수 있다 .

weylin
Download Presentation

To be an Android Expert

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 앱창작터 To be an Android Expert • 안드로이드여대생 기초 과정 UI – Toast & Notification 문양세, 최미정 강원대학교 IT대학 컴퓨터학부

  2. Notification의 종류 (1/2) • Toast notification • 사용자에게 알리고자 하는 짧은 메시지를 (잠시) 표현한다. • Foreground에서 수행되는 activity뿐 아니라, background에서 수행되는 service에서도 생성될 수 있다. • 예제: 파일 저장 작업 과정에서, 저장이 성공했다는 것을 확인시켜 준다. • Status bar notification • 시스템의 상태 바에 아이콘을 표시하며, notification window에는 확장 메시지를 보여준다. • 예제: SMS가 도착했을 때, 상태 바에 표시한다(진동, 사운드, 발광 등도 가능) • Dialog notification • (앞서 Dialog에서 설명한 바와 같이) 진행상태바퀴 혹은 진행상태 바를 표시한다.

  3. Notification의 종류 (2/2) • Toast notification • Status bar notification • Dialog notification

  4. Toast Notification (1/6) • 메시지 표현에 필요한 공간만 나타내고, 자동으로 나타났다가 사라지며, 사용자 인터랙션은 허용하지 않는다. • Activity 혹은 Service로부터 toast가 생성될 수 있다. • 생성 절차 • 1. makeText()를 사용하여 notification을 생성한다. • 2. setGravity()를 사용하여 toast가 나타날 위치를 정한다. • 3. show()를 사용하여 toast를 화면에 나타낸다.

  5. Toast Notification(2/6) Toast를 activate시킬 버튼을 하나 만든다.

  6. Toast Notification(3/6) OnClickListener에 짧은 toast 연결하기 (1/2)

  7. Toast Notification(4/6) click OnClickListener에 짧은 toast 연결하기 (2/2)

  8. Toast Notification(5/6) OnLongClickListener에 짧은 toast 연결하기 (1/2)

  9. Toast Notification(6/6) Long click OnLongClickListener에 짧은 toast 연결하기 (2/2)

  10. Status Bar Notification (1/6) • 화면 상단의 상태바에, 아이콘을 표시하고, 확장 메시지를 notification window에 추가한다. • NotificationManager: 시스템 내에서 Notification을 관리한다. • Notification: 실제 아이콘과 메시지를 담고 있다.

  11. Status Bar Notification(2/6) Notification을 발생시킬 버튼을 하나 만든다.

  12. Status Bar Notification(3/6) NotificationManager에 대한 레퍼런스를 얻고, Notification을 인스턴스화 한다.

  13. Status Bar Notification(4/6) Notification을 만들어, NotificationManager에 전달한다.

  14. Status Bar Notification(5/6) 실행 화면 (1/2)

  15. Status Bar Notification(6/6) 잡아서 끌어당김 실행 화면 (2/2)

  16. 기타 Notification (1/2) • 사운드(sound) 추가하기 • Notification.defaults |= Notfication.DEFAULT_SOUND; • 진동(vibration) 추가하기 • Notification.defaults |= Notfication.DEFAULT_VIBRATE; • 발광 빛(flashing light) 추가하기 • Notification.defaults |= Notfication.DEFAULT_LIGHTS; • 스마트폰이 있는 분들은 위 기능을 실제로 실험해 봅시다. 동작하는 분들은 제게 보여주세요~

  17. 기타 Notification (2/2)

More Related