Android - Lab (2)

擁有歡迎畫面的 BMI App

你將會學會:

  • 使用第三方 Package (以 Github 為例)
  • 使用 Alert Dialog
  • finish() 的用途
  • 手動 Override function
  • 寫一個 style

AppIntro

appintro github page

JitPack

JitPack page

Add the JitPack repository to your build file

add a JitPack repository to build file

Add the dependency

add the dependency

Create a new Activity that extends AppIntro

create new class(1)

Create a new Activity that extends AppIntro

create new class(2)

Construct Java code

construct java code

Declare the activity in AndroidManifest.xml

declare in manifest

Set Entry Point in MainActivity.java

set entry point

Intro Page

intro page

Fix on Done Button Clicked

create bmi class

Show a Confirm Dialog Before Exit

create an confirm dialog

Alert Dialog

alert dialog

Add More Page

add more page

Screenshot

add more page

Hide Action Bar - styles.xml

styles.xml

Hide Action Bar - AndroidManifest.xml

androidmainfest.xml

Hide Action Bar - Screenshot

screenshot

FancyToast

fancy toast github page

Add the dependency

add the dependency

Modify the code

modify the code

成品