[AT&T Samsung Galaxy Note I717] Moose0704:
How to Center Align the Lock screen and Answer screen in Jellybean​

All, I like most others have been really excited about the new CM10, 4.1.1 Jellybean ROMS. I however have been annoyed by the off centered lock screen unlock handle. As most of you know just about all of them are off. Well after many hours of looking through code I have found out how to center that unlock handle on the lockscreen as well as the incall answer screen.

Now the changes that need to be made have to be made per ROM, it is not just a simple flashable zip and boom you have it on any ROM. The changes have to be made in two files inside the "framework-res.apk" and the "Phone.apk". So because there are so many different JB ROMs out there I decided to just share the code I changed and where I changed it. ;)

So if you have a ROM and want them centered for your users, or you are a user that knows how to de-compile an APK and re-compile it, then this is for you!

Files to change:

framework-res.apk - The file that needs to be edited is "keyguard_screen_tab_unlock.xml" this file can be found in framework-res.apk/res/layout

Phone.apk - The file that needs to be edited is "incall_touch_ui.xml" this file can be found in Phone.apk/res/layout

Code to change: CHANGES ARE IN RED

framework-res.apk - BEFORE:

<com.android.internal.widget.multiwaveview.GlowPadView
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@id/unlock_widget"
android:gravity="top"
android:focusable="true"
android:layout_alignParentBottom="true"
android:targetDrawables="@array/lockscreen_targets_with_camera"
android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera"
android:directionDescriptions="@array/lockscreen_direction_descriptions"
android:handleDrawable="@drawable/ic_lockscreen_handle"
android:outerRingDrawable="@drawable/ic_lockscreen_outerring"
android:outerRadius="@dimen/glowpadview_target_placement_radius"
android:innerRadius="@dimen/glowpadview_inner_radius"
android:snapMargin="@dimen/glowpadview_snap_margin"
android:feedbackCount="1"
android:vibrationDuration="20"
android:glowRadius="@dimen/glowpadview_glow_radius"
android:pointDrawable="@drawable/ic_lockscreen_glowdot"

framework-res.apk - AFTER:

<com.android.internal.widget.multiwaveview.GlowPadView
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="[COLOR="Red"]wrap_content[/COLOR]"
android:id="@id/unlock_widget"
android:gravity="[COLOR="Red"]left|top[/COLOR]"
android:focusable="true"
android:layout_alignParentBottom="true"
android:targetDrawables="@array/lockscreen_targets_with_camera"
android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera"
android:directionDescriptions="@array/lockscreen_direction_descriptions"
android:handleDrawable="@drawable/ic_lockscreen_handle"
android:outerRingDrawable="@drawable/ic_lockscreen_outerring"
android:outerRadius="@dimen/glowpadview_target_placement_radius"
android:innerRadius="@dimen/glowpadview_inner_radius"
android:snapMargin="@dimen/glowpadview_snap_margin"
android:feedbackCount="1"
android:vibrationDuration="20"
android:glowRadius="@dimen/glowpadview_glow_radius"
android:pointDrawable="@drawable/ic_lockscreen_glowdot"

Phone.apk - BEFORE:

<com.android.internal.widget.multiwaveview.GlowPadView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@id/incomingCallWidget"
android:visibility="gone"
android:layout_marginBottom="-46.0dip"
android:background="@color/incall_call_banner_background"
android:layout_gravity="bottom|center"
android:layout_marginTop="20.0dip"
android:gravity="top"
prvandroid:targetDrawables="@array/incoming_call_widget_3way_targets"
prvandroid:targetDescriptions="@array/incoming_call_widget_3way_target_descriptions"
prvandroid:directionDescriptions="@array/incoming_call_widget_3way_direction_descriptions"
prvandroid:handleDrawable="@drawable/ic_in_call_touch_handle"
prvandroid:innerRadius="@android:dimen/glowpadview_inner_radius"
prvandroid:outerRadius="@android:dimen/glowpadview_target_placement_radius"
prvandroid:outerRingDrawable="@android:drawable/ic_lockscreen_outerring"
prvandroid:snapMargin="@android:dimen/glowpadview_snap_margin"
prvandroid:vibrationDuration="20" prvandroid:feedbackCount="1"
prvandroid:glowRadius="@android:dimen/glowpadview_glow_radius"
prvandroid:pointDrawable="@android:drawable/ic_lockscreen_glowdot"

Phone.apk - AFTER:

<com.android.internal.widget.multiwaveview.GlowPadView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@id/incomingCallWidget"
android:visibility="gone"
android:layout_marginBottom="-46.0dip"
android:background="@color/incall_call_banner_background"
android:layout_gravity="bottom|center"
android:layout_marginTop="20.0dip"
android:gravity="[COLOR="red"]left|top[/COLOR]"
prvandroid:targetDrawables="@array/incoming_call_widget_3way_targets"
prvandroid:targetDescriptions="@array/incoming_call_widget_3way_target_descriptions"
prvandroid:directionDescriptions="@array/incoming_call_widget_3way_direction_descriptions"
prvandroid:handleDrawable="@drawable/ic_in_call_touch_handle"
prvandroid:innerRadius="@android:dimen/glowpadview_inner_radius"
prvandroid:outerRadius="@android:dimen/glowpadview_target_placement_radius"
prvandroid:outerRingDrawable="@android:drawable/ic_lockscreen_outerring"
prvandroid:snapMargin="@android:dimen/glowpadview_snap_margin"
prvandroid:vibrationDuration="20" prvandroid:feedbackCount="1"
prvandroid:glowRadius="@android:dimen/glowpadview_glow_radius"
prvandroid:pointDrawable="@android:drawable/ic_lockscreen_glowdot"

If you do not want to find and change the code, here is a ZIP that has both files with code in them so that you can just replace them with your old ones. I am pretty sure it is the same across devices, but the rest of the APK's may not be so only replace these files.

Center FIX Files

If you appreciate me sharing this information, please hit the THANKS button :good: and/or the "Donate to Me" Button :fingers-crossed: