출처 : http://poodroid.tistory.com/67


[강좌]안드로이드 4.4 잠금화면에 카메라바로가기(ShortCut) 기능 넣기

 

 

갤럭시노트3가 업데이트되면서 기존 해외판을 보면 카메라기능을

락화면에 바로가기(ShortCut)으로 넣어뒀는데 이걸 삼성이 국내판에서는

미적용 시켰습니다. 이것을 오늘 활성화 시켜보겠습니다.

 

 

 

그럼 강좌 시작하겠습니다~

 

1. Keygurad.apk 파일을 디컴파일합니다.

 

2. 디컴파일 한후 reslayout-sw360dp-xxhdpi 폴더에서 keyguard_unlock_view.xml을 노트패드로 열어줍니다.

   (본 강좌는 노트3 해상도 기준입니다. hdpi 및 xhdpi는 그 기종에 맞는 폴더의 xml을 수정해주시면됩니다.)

 

3. keyguard_unlock_view.xml 을 열면 아래와 같은 소스가 나옵니다.

 <?xml version="1.0" encoding="utf-8"?>
<com.android.keyguard.sec.KeyguardUnlockView android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/keyguard_unlock_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:contentDescription="@string/keyguard_accessibility_swipe_unlock" androidprv:layout_maxHeight="@dimen/keyguard_security_height" androidprv:layout_maxWidth="@dimen/keyguard_security_width"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard">
    <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
        <include layout="@layout/sec_adaptive_event_container_big" />
        <LinearLayout android:layout_gravity="center" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <include android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="4.0dip" layout="@layout/keyguard_message_area" />
            <LinearLayout android:gravity="bottom|center" android:orientation="vertical" android:id="@id/keyguard_unlock_view_frame" android:background="@drawable/kg_bouncer_bg_white" android:layout_width="fill_parent" android:layout_height="0.0dip" android:layout_marginBottom="6.0dip" android:layout_weight="1.0">
                <TextView android:textSize="18.0sp" android:textColor="#ffffffff" android:gravity="center" android:layout_gravity="bottom|center" android:id="@id/keyguard_unlock_view_help_text" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:shadowColor="#99000000" android:shadowDy="2.0" android:shadowRadius="1.0" />
                <TextView android:textSize="18.0sp" android:textColor="#ffffffff" android:gravity="center" android:layout_gravity="bottom|center" android:id="@id/keyguard_unlock_view_voice_help_text" android:visibility="gone" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/lockscreen_voiceunlock_failed_to_recognise_voice_text" android:shadowColor="#99000000" android:shadowDy="2.0" android:shadowRadius="1.0" />
                <include android:gravity="bottom|center" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="6.0dip" layout="@layout/zzz_keyguard_screen_usimwidget" />
            </LinearLayout>
            <include android:gravity="center_horizontal" android:layout_gravity="bottom|center" android:orientation="vertical" android:id="@id/keyguard_selector_fade_container" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="17.0dip" layout="@layout/keyguard_emergency_carrier_area_unlock" />
            <com.android.keyguard.sec.KeyguardShortcutView android:gravity="center" android:id="@id/keyguard_shortcutview_root" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="5.0dip" />
        </LinearLayout>
        <ImageView android:id="@id/keyguard_unlock_bouncer" android:background="@drawable/kg_bouncer_bg_white" android:layout_width="fill_parent" android:layout_height="fill_parent" android:alpha="0.0" />
    </FrameLayout>
</com.android.keyguard.sec.KeyguardUnlockView>

 

4. 위 소스를 모두 지운후에 아래와 같은 새로운 소스를 작성합니다. (소스 다운로드 :  source.txt)

 <?xml version="1.0" encoding="utf-8"?>
<com.android.keyguard.sec.KeyguardUnlockView android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/keyguard_unlock_view" android:layout_width="fill_parent" android:layout_height="500.0dip" android:contentDescription="@string/keyguard_accessibility_swipe_unlock" androidprv:layout_maxHeight="500.0dip" androidprv:layout_maxWidth="@dimen/keyguard_security_width"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard">
    <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
        <LinearLayout android:layout_gravity="center" android:orientation="vertical" android:id="@id/keyguard_unlock_view_frame" android:background="@drawable/kg_bouncer_bg_white" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <include android:layout_width="fill_parent" android:layout_height="wrap_content" layout="@layout/keyguard_message_area" />
            <FrameLayout android:layout_width="fill_parent" android:layout_height="0.0dip" android:layout_weight="1.0" />
            <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
                <LinearLayout android:gravity="bottom" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="6.0dip" android:layout_weight="1.0">
                    <TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center_horizontal" android:layout_gravity="bottom|center" android:id="@id/keyguard_unlock_view_help_text" android:paddingLeft="19.0dip" android:paddingRight="19.0dip" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:shadowColor="#99000000" style="@style/keyguard_text_shadow" />
                    <TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center_horizontal" android:layout_gravity="bottom|center" android:id="@id/keyguard_unlock_view_voice_help_text" android:paddingLeft="19.0dip" android:paddingRight="19.0dip" android:visibility="gone" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/lockscreen_voiceunlock_failed_to_recognise_voice_text" android:shadowColor="#99000000" style="@style/keyguard_text_shadow" />
                    <include android:gravity="center_horizontal" android:layout_gravity="bottom|center" android:orientation="vertical" android:id="@id/keyguard_selector_fade_container" android:layout_width="fill_parent" android:layout_height="wrap_content" layout="@layout/keyguard_emergency_carrier_area_unlock" />
                </LinearLayout>
                <include android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/keyguard_camera_shortcut" />
    <include android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/keyguard_guest_selector" />
            </LinearLayout>
            <com.android.keyguard.sec.KeyguardShortcutView android:gravity="center" android:id="@id/keyguard_shortcutview_root" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/kg_unlock_shortcut_margin_top" android:layout_marginBottom="@dimen/kg_unlock_shortcut_margin_bottom" />
        </LinearLayout>
        <ImageView android:id="@id/keyguard_unlock_bouncer" android:background="@drawable/kg_bouncer_bg_white" android:layout_width="fill_parent" android:layout_height="fill_parent" android:alpha="0.0" />
    </FrameLayout>
</com.android.keyguard.sec.KeyguardUnlockView>

 

5. 컴파일 후 적용 하면 아래와 같은 동영상처럼 락스크린에 카메라 바로가기 기능이 추가 됩니다.

 

 


댓글 5
댓글 쓰기 권한이 없습니다.
강좌 정렬 목록 검색 쓰기
등록된 글이 없습니다.
1 -