본문 바로가기

Mobiles

갤럭시 노트2 갤럭시s4 잠금화면 위젯 Life companion 추가방법




갤럭시 노트2 갤럭시s4 잠금화면 위젯 Life companion 추가방법


안드로이드 버전 : 안드로이드 4.1.2 젤리빈

펌웨어 버전 : LGT MF6


갤럭시 노트2 갤럭시s4 잠금화면 위젯 Life companion 추가방법



갤럭시 노트2 갤럭시s4 잠금화면 위젯 Life companion 추가방법


갤럭시s4 잠금화면 부터 표시되고 있는 Life companion이라는 문구를 다른 기종.! 여기선 노트2에서 표시하는 방법을 좀 더 쉽고 간단하게 작업할 수 있도록 만들어 보았습니다. (이 방법은 드래그/물결 잠금화면에서만 가능합니다.!)


우선 framework-res.apk파일을 디컴파일 합니다.!


순차적인 작업 진행을 잘 따라해 주시면 오류없이 바로 성공할 수 있으니 천천히 들어가 봅시다.


1. 새롭게 추가될 view문구를 표시하기 위해 ids.xml에서 2개의 id name을 추가해 줍니다.


framework\framework-res\res\values


ids.xml


<item type="id" name="lock_text">false</item>
<item type="id" name="lock_img">false</item>


위 2줄을 </resources>위에 추가해 줍니다.


2. 잠금화면 레이아웃에 Life companion이 표시될 2가지 버전(텍스트, 이미지)의 문구를 입력합니다.


framework-res\res\layout-ko-sw360dp


keyguard_circlelock_clockwidget.xml


<TextView android:textSize="12.0dip" android:textColor="#ffebebeb" android:ellipsize="none" android:gravity="center" android:id="@id/clock_emergency_text" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:shadowColor="@color/black" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="0.25" />
</view>


문서 상단에 있는 위 문구 하단에 아래 문구를 넣어 줍니다.


텍스트 문구를 사용하지 않을 때.!

<TextView android:textSize="0.0dip" android:textColor="#fff9f9f9" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/lock_text" android:layout_width="wrap_content" android:layout_height="0.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.5" android:layout_marginLeft="45.0dip" android:text="Life companion" />

텍스트 문구를 사용할 때.!

<TextView android:textSize="50.0dip" android:textColor="#fff9f9f9" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/lock_text" android:layout_width="wrap_content" android:layout_height="60.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.5" android:layout_marginLeft="45.0dip" android:text="Life companion" />


왼쪽 간격이 마음에 안 들때는 android:layout_marginLeft="45.0dip" 수치를 조절하면 됩니다.


이미지를 사용하지 않을 때.!

<ImageView android:id="@id/lock_img" android:paddingRight="3.0dip" android:layout_width="wrap_content" android:layout_height="0.0dip" android:src="@drawable/btn_zoom_page_normal" />

이미지를 사용할 때.!

<ImageView android:id="@id/lock_img" android:paddingRight="3.0dip" android:layout_width="wrap_content" android:layout_height="60.0dip" android:src="@drawable/btn_zoom_page_normal" />


둘다 사용하고자 할 때는 dip수치를 높게 입력하면 되고 둘 중 하나만 사용할 때는 0으로 맞춰 주면 됩니다. 여기서 텍스트가 추가되는 부분은 시스템폰트에 영향을 받아 폰트가 바뀌지만 이미지로 사용할 때는 고정적인 이미지를 사용하기에 폰트가 바뀌지 않습니다.


완성본 예)


 <TextView android:textSize="12.0dip" android:textColor="#ffebebeb" android:ellipsize="none" android:gravity="center" android:id="@id/clock_emergency_text" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:shadowColor="@color/black" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="0.25" />
    </view>

        <TextView android:textSize="0.0dip" android:textColor="#fff9f9f9" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/lock_text" android:layout_width="wrap_content" android:layout_height="0.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.5" android:layout_marginLeft="45.0dip" android:text="Life companion" />
        <ImageView android:id="@id/lock_img" android:paddingRight="3.0dip" android:layout_width="wrap_content" android:layout_height="60.0dip" android:src="@drawable/btn_zoom_page_normal" />


    <view android:id="@id/clock_clock" android:layout_width="fill_parent" android:layout_height="wrap_content" class="com.android.internal.policy.impl.sec.ClockWidget$Clock">


3. 수정된 파일을 디컴파일 한 곳에 넣고 컴파일 해서 resources.arsc, keyguard_circlelock_clockwidget.xml, btn_zoom_page_normal.png파일을 경로에 맞게 옮겨주면 됩니다. (이미지 파일은 framework-res\res\drawable-xhdpi 이 폴더에 덮어주면 됩니다.)


갤럭시 노트2 갤럭시s4 잠금화면 위젯 Life companion 추가방법