Post Reply

(GUIDE)(MOD)Paged Lockscreen like on 4.2+ (Cool)(GB+)

OP SpaceCaker

16th February 2014, 10:02 PM   |  #1  
SpaceCaker's Avatar
OP Recognized Themer / Contributor
Flag netherlands
Thanks Meter: 10,775
 
13,351 posts
Join Date:Joined: Mar 2011
More
How to add PagedView to lockscreen.

As most of you all know the android 4.2+ has implemented an awesome new Lockscreen on wich u can swipe pages to show widgets and such.
Currently i have managed to create working pageview but for now without Widgets.
However you can add some custom stuff though .
i had added DigitalClok -> AnalogClock -> Device Info.
but you would be able to change it like what you want as you can add unlimited LinearLayouts for adding new views.




Basicly this mod is very easy to add.
What is inside the resources.zip ?
  1. SwipeLock Smalis for Framework.jar

Basicly what you would need to do is:
  1. Download Resources Attachement.
  2. Extract it
  3. Decompile you’re framework.jar
  4. Go to the extract smali folder from the resources.zip and copy the smali folder to the smali folder of you’re framework.jar.
  5. Compile framework.jar
  6. Now we are going to add it to the frameworks location/allocate the text.
  7. Decompile framework-res.apk
  8. Find a lockscreen layout to you’re likes. (“zzz_keyguard_screen_clockwidget.xml” <- on this one i have NOT tested as in my test app when i used a Lockscreen overlay i couldnt swipe the pages so its likely this one not works but on the GB ones it does
  9. so instead i used “keyguard_screen_tab_unlock.xml” ofcourse you would be able to add this in other lock layouts aswell.
  10. Open the layout you wanted and simply add this line above the clock layout or where you want
    I put this code above my clock code ( i setted minheight to 300.0dip so u would be able to swipe it at this height)
    Code:
    <com.spacecaker.swipelock.ui.SwipeView android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="wrap_content" android:minHeight="300.0dip" android:overScrollMode="never">
    And below you're clock layout
    Code:
    </com.spacecaker.swipelock.ui.SwipeView>
  11. So now we have that now we need to put the clock layout inside a LinearLayout
  12. Like this
    Code:
    		<LinearLayout android:orientation="vertical" android:minHeight="300.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true">
    			<com.android.internal.widget.DigitalClock android:id="@id/time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20.0dip" android:layout_marginTop="30.0dip" android:layout_below="@id/carrier">
    				<TextView android:textAppearance="?textAppearanceMedium" android:textSize="72.0sp" android:ellipsize="none" android:id="@id/timeDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:shadowColor="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" />
    				<TextView android:textAppearance="?textAppearanceMedium" android:textSize="22.0sp" android:ellipsize="none" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:singleLine="true" android:shadowColor="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" android:layout_toRightOf="@id/timeDisplay" android:layout_alignBaseline="@id/timeDisplay" />
    			</com.android.internal.widget.DigitalClock>
    		</LinearLayout>
  13. So it would end up looking like this:
    Code:
    	<com.spacecaker.swipelock.ui.SwipeView android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="wrap_content" android:minHeight="300.0dip" android:overScrollMode="never">	        
    		<LinearLayout android:orientation="vertical" android:minHeight="300.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true">
    			<com.android.internal.widget.DigitalClock android:id="@id/time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20.0dip" android:layout_marginTop="30.0dip" android:layout_below="@id/carrier">
    				<TextView android:textAppearance="?textAppearanceMedium" android:textSize="72.0sp" android:ellipsize="none" android:id="@id/timeDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:shadowColor="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" />
    				<TextView android:textAppearance="?textAppearanceMedium" android:textSize="22.0sp" android:ellipsize="none" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:singleLine="true" android:shadowColor="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" android:layout_toRightOf="@id/timeDisplay" android:layout_alignBaseline="@id/timeDisplay" />
    			</com.android.internal.widget.DigitalClock>
    		</LinearLayout>
    	</com.spacecaker.swipelock.ui.SwipeView>
  14. Now we add another LinearLayout for you're second Page i used the universal AnalogClock like this
    Code:
    <AnalogClock android:layout_gravity="center" android:layout_width="wrap_content" android:layout_height="wrap_content" />
  15. So now we again add a LinearLayout so it ends up looking like this:
    Code:
    		<LinearLayout android:orientation="vertical" android:minHeight="300.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true">
    			<AnalogClock android:layout_gravity="center" android:layout_width="wrap_content" android:layout_height="wrap_content" />
    		</LinearLayout>
  16. The end Layout would look like something like this:
    Code:
    	<com.spacecaker.swipelock.ui.SwipeView android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="wrap_content" android:minHeight="300.0dip" android:overScrollMode="never">	        
    		<LinearLayout android:orientation="vertical" android:minHeight="400.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true">
    			<com.android.internal.widget.DigitalClock android:id="@id/time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20.0dip" android:layout_marginTop="30.0dip" android:layout_below="@id/carrier">
    				<TextView android:textAppearance="?textAppearanceMedium" android:textSize="72.0sp" android:ellipsize="none" android:id="@id/timeDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:shadowColor="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" />
    				<TextView android:textAppearance="?textAppearanceMedium" android:textSize="22.0sp" android:ellipsize="none" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:singleLine="true" android:shadowColor="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" android:layout_toRightOf="@id/timeDisplay" android:layout_alignBaseline="@id/timeDisplay" />
    			</com.android.internal.widget.DigitalClock>
    		</LinearLayout>
    		<LinearLayout android:orientation="vertical" android:minHeight="400.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true">
    			<AnalogClock android:layout_gravity="center" android:layout_width="wrap_content" android:layout_height="wrap_content" />
    		</LinearLayout>		
    	</com.spacecaker.swipelock.ui.SwipeView>
  17. To Add More pages just add another LinearLayout with something inside
  18. Now Compile framework-res.apk
  19. Now zip the files together and make sure these are set properly.
  20. framework-res.apk inside /system/framework/**
  21. And then ofcourse you’re modified framework.jar inside /system/framework/**
  22. Now you are done
  23. Happy modding


On what roms can u apply this mod ?

Basicly it can be applied to ALL Roms atleast if u know what u are doing.


If you wanna see how i moddified mine take a look here https://github.com/spacecaker/git_st...d61cbb2c0e89ac
That shows u what changes i did ^^ its on GingerBread SlidingTab Lockscreen just added it for making it look bit easier.
Attached Files
File Type: zip resources.zip - [Click for QR Code] (12.5 KB, 50 views)
The Following 4 Users Say Thank You to SpaceCaker For This Useful Post: [ View ]
16th February 2014, 10:03 PM   |  #2  
SpaceCaker's Avatar
OP Recognized Themer / Contributor
Flag netherlands
Thanks Meter: 10,775
 
13,351 posts
Join Date:Joined: Mar 2011
More
A list of helper,idea givers,and such
  • RomanBB
  • Pineapleowl
  • Mariozawa
  • BroadComCM
  • SpaceCaker

Sources? Yes We have!
https://github.com/spacecaker/SwipeLock

Try it without Modding?
Yes you can
In the Screenshots i had used HoloLocker as an example
So you can try it on you"re phone aswell
Note: the minheight might be to much for low res phones so i am sorry if the layout is cut.
Attached Files
File Type: apk locker.apk - [Click for QR Code] (329.7 KB, 24 views)
Last edited by SpaceCaker; 16th February 2014 at 10:23 PM.
The Following User Says Thank You to SpaceCaker For This Useful Post: [ View ]
23rd February 2014, 03:27 PM   |  #3  
akash akya's Avatar
Senior Member
Flag Bangalore
Thanks Meter: 1,324
 
726 posts
Join Date:Joined: May 2012
More
looks cool bro... gonna try it soon..
It would be easy to add more items if all worked correctly..
thanks..
Last edited by akash akya; 23rd February 2014 at 03:30 PM.
28th June 2014, 05:59 PM   |  #4  
G.M.L's Avatar
Senior Member
Flag Thessaloniki
Thanks Meter: 96
 
504 posts
Join Date:Joined: May 2013
More
i was going to recompile framework.jar and i take this error
Attached Files
File Type: txt framework.jar_???-06-28-2014_19-54.txt - [Click for QR Code] (1.4 KB, 1 views)
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Android Themes by ThreadRank