Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[MOD][DEV][GUIDE] Galaxy SIII Lockscreen [CM10]

OP F4uzan

9th May 2014, 10:09 AM   |  #1  
F4uzan's Avatar
OP Recognized Contributor
Flag Bandung, Indonesia
Thanks Meter: 1,492
 
2,673 posts
Join Date:Joined: Jul 2012
More
Quote:

Galaxy SIII Lockscreen for CM10
for HDPI device only


This guide is based on Adi Aisiteru Reborn's guide, you can see his guide here. Basically, what I do is fix layout in his XML file.


Screenshot from my device :


See attachment



Okay, let's start the guide !


What will you need for the guide :

Code:
- Experience with using APK and JAR decompiling / recompiling
- Text editing program, Notepad++ (Windows) / Gedit (Ubuntu) will do
- APK and JAR reverse engineering program (APKTool recommended)
Warning, read before starting !

Quote:

Always set background on lockscreen as default wallpaper ! Don't set wallpaper to custom or color fill, or you'll get bootloop !

------------------------
GUIDE STARTED !
------------------------

Step 1

Decompile framework-res.apk, make sure you do this right.
Open /res/layout

Open keyguard_screen_tab_unlock.xml, replace all lines in your file with this line :

Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:gravity="center_horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <com.android.internal.widget.WaveView android:id="@id/unlock_widget" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="150.0dip" />
    <GridLayout android:gravity="center_horizontal" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <com.android.internal.widget.DigitalClock android:id="@id/time" android:paddingTop="@dimen/keyguard_lockscreen_status_line_clockfont_top_margin" android:layout_marginBottom="@dimen/keyguard_lockscreen_status_line_clockfont_bottom_margin">
            <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_clock_font_size" android:textColor="@color/lockscreen_clock_background" android:ellipsize="none" android:gravity="center_horizontal" android:id="@id/timeDisplayBackground" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="2.0dip" android:singleLine="true" />
            <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_clock_font_size" android:textColor="@color/lockscreen_clock_foreground" android:ellipsize="none" android:gravity="center_horizontal" android:id="@id/timeDisplayForeground" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="2.0dip" android:singleLine="true" android:shadowColor="@color/black_50_trans" android:shadowDx="1.0" android:shadowDy="2.0" android:shadowRadius="5.0" android:layout_alignLeft="@id/timeDisplayBackground" android:layout_alignTop="@id/timeDisplayBackground" />
        </com.android.internal.widget.DigitalClock>
        <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent">
            <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_date_font_size" android:textStyle="bold" android:textColor="@color/lockscreen_date" android:ellipsize="marquee" android:gravity="center_horizontal" android:id="@id/date" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:shadowColor="@color/black_25_trans" android:shadowDx="0.0" android:shadowDy="2.0" android:shadowRadius="1.0" />
            <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_status_line_font_size" android:ellipsize="marquee" android:gravity="center_horizontal" android:id="@id/alarm_status" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="16.0dip" android:singleLine="true" android:shadowColor="@color/black_50_trans" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="0.5" android:drawablePadding="4.0dip" />
        </LinearLayout>
        <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_status_line_font_size" android:ellipsize="marquee" android:gravity="center_horizontal" android:id="@id/status1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:shadowColor="@color/black_50_trans" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="0.5" android:drawablePadding="4.0dip" />
        <RelativeLayout android:orientation="horizontal" android:id="@id/weather_panel" android:paddingTop="4.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <ImageView android:id="@id/weather_image" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_dialog_alert" android:layout_centerHorizontal="true" android:layout_centerVertical="true" />
            <RelativeLayout android:orientation="horizontal" android:padding="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/weather_image" android:layout_centerVertical="true">
                <TextView android:textSize="14.0sp" android:textStyle="bold" android:textColor="?textColorPrimary" android:ellipsize="marquee" android:gravity="right" android:id="@id/weather_city" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:layout_alignParentRight="true" />
                <TextView android:textSize="12.0sp" android:textColor="?textColorPrimary" android:ellipsize="marquee" android:gravity="right" android:id="@id/weather_condition" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:layout_below="@id/weather_city" android:layout_alignParentRight="true" />
                <TextView android:textSize="6.0sp" android:textColor="?textColorSecondary" android:gravity="right" android:id="@id/update_time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/weather_condition" android:layout_alignParentRight="true" />
            </RelativeLayout>
            <RelativeLayout android:orientation="horizontal" android:id="@id/weather_temps_panel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/weather_image" android:layout_centerVertical="true">
                <TextView android:textSize="20.0sp" android:textColor="?textColorPrimary" android:id="@id/weather_temp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" />
                <View android:id="@id/weather_divider" android:background="@drawable/divider_horizontal_dark" android:layout_width="44.0dip" android:layout_height="1.0dip" android:layout_below="@id/weather_temp" />
                <TextView android:textSize="12.0sp" android:textColor="?textColorPrimary" android:id="@id/weather_low_high" android:paddingTop="2.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/weather_divider" android:layout_centerHorizontal="true" />
            </RelativeLayout>
        </RelativeLayout>
        <Button android:layout_gravity="right" android:id="@id/emergencyCallButton" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="4.0dip" android:layout_marginRight="16.0dip" android:text="@string/lockscreen_emergency_call" android:drawableLeft="@drawable/lockscreen_emergency_button" android:drawablePadding="4.0dip" style="?android:attr/buttonBarButtonStyle" />
        <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
            <LinearLayout android:gravity="center_vertical" android:id="@id/calendar_panel" android:paddingLeft="12.0dip" android:paddingRight="12.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:minHeight="28.0dip">
                <ImageView android:gravity="center" android:layout_gravity="center_vertical" android:layout_width="36.0dip" android:layout_height="wrap_content" android:src="@drawable/ic_lock_idle_calendar" />
                <View android:background="@drawable/divider_horizontal_dark" android:paddingTop="6.0dip" android:paddingBottom="6.0dip" android:layout_width="1.0dip" android:layout_height="fill_parent" />
                <RelativeLayout android:paddingLeft="4.0dip" android:paddingTop="6.0dip" android:paddingBottom="6.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
                    <TextView android:textSize="14.0sp" android:textColor="?textColorPrimary" android:ellipsize="marquee" android:id="@id/calendar_event_title" android:fadingEdge="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" />
                    <TextView android:textSize="12.0sp" android:textColor="?textColorSecondary" android:ellipsize="marquee" android:id="@id/calendar_event_details" android:focusable="true" android:focusableInTouchMode="true" android:fadingEdge="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scrollHorizontally="true" android:singleLine="true" android:layout_below="@id/calendar_event_title" android:layout_alignLeft="@id/calendar_event_title" android:marqueeRepeatLimit="marquee_forever" />
                </RelativeLayout>
            </LinearLayout>
        </RelativeLayout>
        <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_swipe_font_size" android:textColor="@color/lockscreen_carrier_swipe" android:ellipsize="marquee" android:gravity="center_horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="295.0dip" android:text="@string/lockscreen_title" android:singleLine="true" android:shadowColor="@color/black_25_trans" android:shadowDx="2.0" android:shadowDy="2.0" android:shadowRadius="1.0" android:layout_alignParentBottom="true" />
        <TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_carrier_font_size" android:textColor="@color/lockscreen_carrier_swipe" android:ellipsize="marquee" android:gravity="center_horizontal" android:id="@id/carrier" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="2.0dip" android:singleLine="true" android:shadowColor="@color/black_25_trans" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="0.5" android:layout_alignParentBottom="true" />
        <LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:weightSum="2.0" style="?android:attr/buttonBarStyle">
            <Button android:textSize="@dimen/keyguard_lockscreen_status_line_font_size" android:layout_gravity="center_horizontal" android:id="@id/emergencyCallButton" android:visibility="gone" android:layout_width="0.0dip" android:layout_height="wrap_content" android:text="@string/lockscreen_emergency_call" android:drawableLeft="@drawable/lockscreen_emergency_button" android:drawablePadding="0.0dip" android:layout_weight="1.0" style="?android:attr/buttonBarButtonStyle" />
        </LinearLayout>
        <include android:layout_gravity="fill" android:id="@id/transport" android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_column="0" android:layout_row="0" android:layout_rowSpan="8" android:layout_columnSpan="1" layout="@layout/keyguard_transport_control" />
    </GridLayout>
</RelativeLayout>
Save your file, navigate to /res/values

Open dimens.xml

Add / edit following lines :

Code:
    <dimen name="keyguard_lockscreen_clock_font_size">91.0dip</dimen>
    <dimen name="keyguard_lockscreen_status_line_font_size">17.0dip</dimen>
    <dimen name="keyguard_lockscreen_status_line_font_right_margin">32.0dip</dimen>
    <dimen name="keyguard_lockscreen_status_line_clockfont_top_margin">27.0dip</dimen>
    <dimen name="keyguard_lockscreen_status_line_clockfont_bottom_margin">8.0dip</dimen>
    <dimen name="keyguard_lockscreen_date_font_size">20.0dip</dimen>
    <dimen name="keyguard_lockscreen_swipe_font_size">19.0dip</dimen>
    <dimen name="keyguard_lockscreen_carrier_font_size">18.0dip</dimen>
Red means edit the value to the provided value above.
Blue means add lines above.
If the line doesn't exist, add it !

Save your file

Next, open colors.xml
Add following lines :

Code:
    <color name="transparent_white">#66ffffff</color>
    <color name="black_50_trans">#80000000</color>
    <color name="black_25_trans">#bf000000</color>
    <color name="lockscreen_date">#fff6f7c9</color>
    <color name="lockscreen_carrier_swipe">#ffebebeb</color>
Save your file.

Extract downloaded drawables.zip to drawable-hdpi folder

Compile your framework-res.

Step 2

Decompile your framework-res.apk again

Open /res/values/public.xml, but don't do anything. Leave the text editor.

Decompile framework.jar

Extract the smali in S3_WaveView.zip to /com/android/internal/widget, replace every existing file with the one on S3_WaveView.zip

Compile your framework.jar

Step 3

Decompile again framework.jar

Go to /com/android/internal/widget and edit WaveView.smali

Now, open back the public.xml you've opened.

Compare the IDs in WaveView with the one on public.xml
Make sure the IDs in WaveView is same like on public.xml

Code:
    new WaveView.smali                     new public.xml
line 198.  const v1, 0x10404f5 ->  <public type="string" name="description_direction_left" id="0x010404f5" />

line. 306 const v1, 0x1080622 ->  <public type="drawable" name="unlock_ring" id="0x01080622" /> 

line. 355 const v1, 0x1080620 ->  <public type="drawable" name="unlock_default" id="0x01080620" />  

line.404  const v1, 0x1080621 ->  <public type="drawable" name="unlock_halo" id="0x01080621" />  

line.453 const v1, 0x1080623 ->   <public type="drawable" name="unlock_wave" id="0x01080623" />
If WaveView IDs are not same, change it but without the red parts (the red zero).

Done, compile framework.jar
Delete the framework-res folder.

Extras for S3 like clock-font :

Download the clock-fonts.zip, extract the content /system/fonts/



Done, enjoy modding !
Attached Thumbnails
Click image for larger version

Name:	s3.jpg
Views:	146
Size:	44.5 KB
ID:	2733865   Click image for larger version

Name:	s3_press.jpg
Views:	152
Size:	45.8 KB
ID:	2733866  
Attached Files
File Type: zip S3_WaveView.zip - [Click for QR Code] (8.3 KB, 7 views)
File Type: zip clock-fonts.zip - [Click for QR Code] (6.8 KB, 2 views)
File Type: zip drawables.zip - [Click for QR Code] (120.6 KB, 5 views)
The Following 3 Users Say Thank You to F4uzan For This Useful Post: [ View ]
10th May 2014, 07:10 PM   |  #2  
ezio68's Avatar
Member
Flag Tambov
Thanks Meter: 39
 
42 posts
Join Date:Joined: Mar 2014
Donate to Me
More
looks good, but the work is not tested, waiting for reviews
11th May 2014, 01:04 AM   |  #3  
F4uzan's Avatar
OP Recognized Contributor
Flag Bandung, Indonesia
Thanks Meter: 1,492
 
2,673 posts
Join Date:Joined: Jul 2012
More
Quote:
Originally Posted by ezio68

looks good, but the work is not tested, waiting for reviews

Tested on my device (CM10).

#F4UZAN
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes