如何設(shè)計android鎖屏程序課件_第1頁
如何設(shè)計android鎖屏程序課件_第2頁
如何設(shè)計android鎖屏程序課件_第3頁
如何設(shè)計android鎖屏程序課件_第4頁
如何設(shè)計android鎖屏程序課件_第5頁
已閱讀5頁,還剩22頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、如何實現(xiàn)鎖屏程序劉飛Android開發(fā)的優(yōu)點使用最好的開源項目搭建簡單實用的API簡潔明了的文檔 主要功能 設(shè)計自己的service 設(shè)計自己的activity頁面 重載自己的view 主要功能 設(shè)計自己的service 設(shè)計自己的activity頁面 重載自己的view主要功能當(dāng)屏幕關(guān)閉時鎖屏程序啟動繪制解鎖圖形解鎖設(shè)置解鎖圖形設(shè)計自己的Service屏幕關(guān)閉時鎖屏程序啟動 Android的framework會廣播一些常用的消息Answer,screen on,screen off,battery changed等應(yīng)用程序接收事件,做相應(yīng)的處理Your Sdk Derictory/refer

2、ence/android/content/Intent.html#ACTION_SCREEN_OFF設(shè)計自己的Service(續(xù))Screen off的發(fā)送的幾種方式用戶按下power鍵手機關(guān)閉屏幕節(jié)省電能YourAndroidDerectory/frameworks/base/services/java/com/android/servers/PowerManagerService.java設(shè)計自己的Service (續(xù))在service中接收screen off消息Activity中可以直接接收系統(tǒng)消息Service無界面,適合處理后臺消息設(shè)計自己的service(續(xù))Screen Ser

3、viceMain ActivityScreenOffStart activityIncomingCall設(shè)計自己的service(續(xù))Screen ServicePowerOnStart ApplicationbootreceiverService啟動方式設(shè)計自己的activity頁面(續(xù))設(shè)計自己的activity頁面(續(xù))設(shè)置解鎖界面IntroductionNeedToConfirmChoiceConfirmed 主要功能 設(shè)計自己的service 設(shè)計自己的activity頁面 重載自己的view重載自己的view設(shè)計要點 能在view上繪制圖形 view上的圖片隨著手指的移動旋轉(zhuǎn)重載自

4、己的view(續(xù))重載自己的view(續(xù))定義觸摸對象public static class Cell public int cirIndex; /Store the position of the circle. private int startX; private int startY; private int endX; private int endY; void setIndex(int index); int getIndex();重載自己的view(續(xù))捕捉屏幕事件public class LockPatternView extends View Override public

5、 boolean onTouchEvent(MotionEvent motionEvent) final float x = motionEvent.getX(); final float y = motionEvent.getY(); switch(motionEvent.getAction() case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_UP: case MotionEvent.ACTION_MOVE: 重載自己的view(續(xù))重載onDraw函數(shù),自定義圖形繪制方法Overrideprotected void onDraw(

6、Canvas canvas) /Draw your own background pictures. /Draw the pattern you have touched. /Draw the path.重載自己的view(續(xù))繪制圓盤的旋轉(zhuǎn)繞圓心旋轉(zhuǎn)30度0.8660254, -0.5, 36.60254 0.5, 0.8660254, 136.60254 0.0, 0.0, 1.0 重載自己的view(續(xù))繪制圓盤的旋轉(zhuǎn)Matrix matrix = new Matrix(); matrix.reset(); matrix.setTranslate(circleBkX, circleBkY); matrix.pos

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論