Page 1 of 11 123 ... LastLast
Results 1 to 20 of 206

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Cydget for iOS 7 (make LockScreen plugins with HTML and Cycript)

  1. #1
    Official SaurikIT Support
    Join Date
    Mar 2011
    Location
    Santa Barbara, CA
    Posts
    332
    Thanks
    1
    Thanked 66 Times in 45 Posts

    Default Cydget for iOS 7 (make LockScreen plugins with HTML and Cycript)
    As a bunch of you probably know already, saurik released an update for Cydget (for compatibility with iOS 7 and ARM64 devices) a few days ago, and he released an update today with a lot of improvements. Here's a discussion of it on Reddit with saurik, but I figured I'd start a thread here too in case anyone has questions that they'd like to discuss in forum format, especially any themers who are interested in using Cydget but have run into problems or potential bugs. (I work with saurik and can help report problems to him.)

    For context, here are quotes from Cydget's description in Cydia:

    Cydget is a flexible and powerful replacement system for WinterBoard Lock Widgets, allowing users to have multiple lockscreen displays active and to cycle between them. Developers and web designers can make "cydgets" using either native code or HTML with JavaScript and Cycript (a JavaScript superset that allows flexible access to Objective-C).

    Cydget is built on Apple's "SpringBoard plugin" mechanism, so it does not conflict with other Apple-provided lockscreens, including VoiceRecorder and Nike+. However, some jailbreak lockscreen extensions are not compatible with Cydget, which may cause humorously overlapping displays if you have multiple lockscreen extensions active at the same time.

    Some of Cydget's core benefits (over WinterBoard Widgets):

    * configuration allows HTML scrolling
    * multiple cydgets can be rotated
    * they stop running when screen dims
    * Cycript embedding for library calls
    Here are some posts from last year by JunesGraphics about using Cydget:

    * What is a Cydget?
    * Editing Winterboard Lockscreens to work with Cydgets
    * Using keyboard for data in Cydgets
    * Using LocalStorage with Cydgets
    * Access to the camera roll and dealing photo binary data
    * Editing any lockscreen to use image set from setbackground.cydget
    * Cycript (links to this page explaining Cycript for Cydget makers)
    * Running Cycript from Cydgets

    And here is saurik's description of today's improvements:

    So, encouraged by the idea that people actually seem to *like* Cydget, I've spent the last day or two making a bunch of improvements.

    To start with, by default, the Notification Center updates now sit behind the iOS blur, and you get the default clock back. This was a major source of frustration for people who were just trying to render a really complex replacement background, and still wanted notifications.

    However, I personally think that there is a lot to be had from building themes that are "compatible" with the notification mechanism. For an example, /u/theCarryAll posted a demonstration of cycling through Cydgets that happened to really nicely render with the notifications. (below)

    To that end, you can specify NotificationList=YES in the CYConfiguration for your Cydget, and then you will be allowed to play at the same level as the notification list mechanism. If you have a Cydget currently that is relying on this, you will need to go set that setting now (sorry).

    I also worked on the issue with the media controls. It turns out that I simply hadn't noticed that the media controls command changed: it used to be that double-tap changed the media controls, but now single-tap does, which conflicts with "change active Cydget".

    I've thereby remapped the iOS behavior back to double-tap, and fixed a few other issues I found in the tap handling (such as getting stuck in Siri, unable to escape without trying to confuse her into letting you out of her vicious trap despite her ploy to ask you to repeat yourself).

    In the process, I also changed how Now Playing works with Cydget on iOS 7. On iOS 6, Now Playing was a SpringBoard plugin from Apple. Now, it's kind of a pseudo-plugin. It used to be that Now Playing thereby took control from Cydget, but on iOS 7 it wasn't doing that anymore.

    I've thereby fixed the behavior on iOS 7, because some people really miss their album art, and want it by default: you can now turn on Now Playing in the Cydget settings, which will cause AwayView to become the "start" Cydget *even if AwayView wasn't selected* if Now Playing is up.

    This also solves the problem that the media HUD conflicts with most Cydgets because you are more likely to be in Now Playing on the AwayView when this is relevant anyway. To this end, I've disabled Cydgets from getting media controls by default. MediaControls=YES to bypass.

    So, now that you have these ways of being able to opt in to theme with the default controls, you might wonder how you can possibly do that: you render a clock, and now there's a media control on top... it would be cool if you could somehow change your layout to compensate, right?

    I've thereby made a few more modifications to WebCore to change how it parses CSS to add @media queries for random SpringBoard features. Maybe you just need to remove a clock or otherwise "clear some room", or maybe you have to reflow the whole page: now you can do that.

    The syntax, of course, should be familiar to those who use CSS: "@media (-cydget-media-controls) { ... }" to have CSS specific to when the media controls are being rendered, and "@media (-cydget-notification-list) { ... }" to have CSS specific to when the notification list is being rendered.

    Finally, I've added support for dealing with the blur (which some people are reporting as a dim... maybe on older devices or with some setting you can turn off the blurs?) and to better integrate with the sliding lock screen experience: you can specify a separate HTML page for the background.

    The way you do this is you specify Background="page.html" (which, by the way, can now be a URL relative to the Cydget, instead of an absolute file:/// URL). This page will then be rendered as the background view (yet can be transparent to the wallpaper). The views slide separately.
    The best way to report theming-related problems to saurik is still to use the Winterboard IRC channel (where Cydget discussion is welcome as well), but I'll do my best to pay attention to this thread too. Thanks for reading (or skimming) this long post!

  2. The Following 6 Users Say Thank You to brittag For This Useful Post:

    Flip35 (01-25-2014), June'sIphone (01-24-2014), meth357 (01-25-2014), nassermoli (02-16-2014), RKO1195 (01-25-2014), The_Durben (01-26-2014)

  3. #2
    Master Theme Creator June'sIphone's Avatar
    Join Date
    Feb 2010
    Location
    DaytonaBeach, FL
    Posts
    6,894
    Thanks
    5,380
    Thanked 10,341 Times in 3,760 Posts

    Awesome, thanks for posting Britta

  4. #3

  5. #4
    Good info. Glad Saurik resolved the media controls issue.

  6. #5
    Is there an example on how to create a cydget to show upcoming calendar events at lockscreen? I really miss this feature from lockinfo and Im willing to hack a replacement if its possible.
    Last edited by peu; 01-25-2014 at 10:06 AM.

  7. #6
    King Kong ain't got nothing on me! King_O_Hill's Avatar
    Join Date
    Apr 2011
    Location
    USA
    Posts
    9,759
    Thanks
    43,386
    Thanked 18,777 Times in 6,739 Posts

    Thanks britta, lots of good info!
    Widget Weather 2.0 App Currently in Public Beta for iOS 8 only!
    Check out the thread here - Widget-Weather 2.0

  8. #7
    Official SaurikIT Support
    Join Date
    Mar 2011
    Location
    Santa Barbara, CA
    Posts
    332
    Thanks
    1
    Thanked 66 Times in 45 Posts

    Quote Originally Posted by peu View Post
    Is there an example on how to create a cydget to show upcoming calendar events at lockscreen? I really miss this feature from lockinfo and Im willing to hack a replacement if its possible.
    This would require some code (using Cycript). I asked saurik, and he provided this example:

    Code:
    <script language="text/cycript">
    var store = [new EKEventStore init]
    var formatter = [new NSDateFormatter init]
    [formatter setTimeStyle:1]
    [formatter setDateStyle:0]
    for each (var event in [store eventsMatchingPredicate:[store predicateForEventsWithStartDate:[NSDate dateWithTimeIntervalSinceNow:0] endDate:[NSDate dateWithTimeIntervalSinceNow:(24*60*60)] calendars:nil]])
    	document.write("<div><span class='title'>" + event.title + "</span><span class='time'>" + [formatter stringFromDate:event.startDate] + "</span></div>");
    </script>
    That would generate a result like this:

    Code:
    <div><span class='title'>Stuff</span><span class='time'>6:00 PM</span></div>
    Apple's iOS documentation has more information on Reading and Writing Calendar Events.
    Last edited by brittag; 01-25-2014 at 05:58 PM.

  9. The Following 2 Users Say Thank You to brittag For This Useful Post:

    June'sIphone (01-25-2014), The_Durben (01-26-2014)

  10. #8
    Master Theme Creator June'sIphone's Avatar
    Join Date
    Feb 2010
    Location
    DaytonaBeach, FL
    Posts
    6,894
    Thanks
    5,380
    Thanked 10,341 Times in 3,760 Posts

    Hey guys, if you are using cycript to work on the lockscreen, it can be a pain to keep pressing the home button to show the lockscreen. I have found this code from searching through headers. If you run it by cycript via mobile terminal it will keep the screen lit.

    [[SBBacklightController sharedInstance] cancelLockScreenIdleTimer]

    I do plan on updating my cydgets blog. Will come in time. Hope this helps
    Last edited by June'sIphone; 01-26-2014 at 02:59 PM.

  11. The Following User Says Thank You to June'sIphone For This Useful Post:

    The_Durben (02-05-2014)

  12. #9
    Could this not be achieved with hiddensettings PreventScreenDimmer feature? Same desired result without the need to plug in any code.

  13. #10
    Master Theme Creator June'sIphone's Avatar
    Join Date
    Feb 2010
    Location
    DaytonaBeach, FL
    Posts
    6,894
    Thanks
    5,380
    Thanked 10,341 Times in 3,760 Posts

    Quote Originally Posted by Krima View Post
    Could this not be achieved with hiddensettings PreventScreenDimmer feature? Same desired result without the need to plug in any code.
    Hiddensettings is a mobile substrate (A very buggy one), I see no need to use it for while i'm at my terminal anyway. I do not want to permanently use this feature, and it only lasts until a respring.

    Plug in code? Not sure what you mean. I'm in terminal and cycript already, just paste in the code I provided to work on your lockscreen without it dimming. Actually easier than opening a settings panel and pressing on in my opinion.
    Last edited by June'sIphone; 01-26-2014 at 02:59 PM.

  14. #11
    June, "plug in code" is just another way of me saying what you said about cycript and terminal. Make sense now I hope. I use CCQuick for hiddensettings and it has been incredibly stable. Don't know if your suggestion is truly easier than flipping a switch but maybe to you it is. Lol

  15. #12
    Master Theme Creator June'sIphone's Avatar
    Join Date
    Feb 2010
    Location
    DaytonaBeach, FL
    Posts
    6,894
    Thanks
    5,380
    Thanked 10,341 Times in 3,760 Posts

    Quote Originally Posted by Krima View Post
    June, "plug in code" is just another way of me saying what you said about cycript and terminal. Make sense now I hope. I use CCQuick for hiddensettings and it has been incredibly stable. Don't know if your suggestion is truly easier than flipping a switch but maybe to you it is. Lol
    Well Krima, when people are in terminal they do not need to pick up their phone to flip this switch. This is what I mean by easier. As you don't have to fiddle with your phone at all.

  16. #13
    Is that how terminal works?

  17. #14
    Master Theme Creator June'sIphone's Avatar
    Join Date
    Feb 2010
    Location
    DaytonaBeach, FL
    Posts
    6,894
    Thanks
    5,380
    Thanked 10,341 Times in 3,760 Posts

    Quote Originally Posted by Krima View Post
    Is that how terminal works?
    I really don't know what you're getting at Krima. You can use the code or not. By your statement I see you don't use terminal. So I don't think it pertains to you.

  18. #15
    I was merely offering another way I achieve this. In no way was I suggesting that you must choose one or the other. My last post was an attempt to lighten up the convo since it seemed like my intent was misunderstood. No hard feelings June.

  19. The Following User Says Thank You to Krima For This Useful Post:

    June'sIphone (01-26-2014)

  20. #16
    Master Theme Creator June'sIphone's Avatar
    Join Date
    Feb 2010
    Location
    DaytonaBeach, FL
    Posts
    6,894
    Thanks
    5,380
    Thanked 10,341 Times in 3,760 Posts

    I understand.

    Here are a few more codes you can use with cycript in terminal to "control" your phone.

    Turn on lockscreen
    Code:
    [[SBBacklightController sharedInstance] turnOnScreenFullyWithBacklightSource:1]
    Stop Dimming (same as posted above)
    Code:
    [[SBBacklightController sharedInstance] cancelLockScreenIdleTimer]
    Unlock iPhone
    Code:
    [[SBLockScreenManager sharedInstance] _finishUIUnlockFromSource:1 withOptions:1]
    Show status bar time on lockscreen
    Code:
    [[SBLockScreenManager sharedInstance] updateSpringBoardStatusBarForLockScreenTeardown]
    These are not very easy to come by. They are posted no where. You have to search through many headers to find them. If anyone finds anymore would be great if they posted.

    As soon as I get a chance I will update the blog on how to comb through headers.

    Please note I'm just learning this myself so any tips please post them😉
    Last edited by June'sIphone; 01-26-2014 at 04:21 PM.

  21. The Following 4 Users Say Thank You to June'sIphone For This Useful Post:

    blkmini (01-26-2014), chevymusclecar (01-26-2014), nateD (02-15-2014), The_Durben (02-05-2014)

  22. #17
    Thanks for the info June but its clear that I am not on your level. I Am in the beginning stages of Learning Objective-C and GroovyCarrot has been a great source of info. He doesn't condescend to me but instead is very encouraging, which I appreciate.

    My job affords me a lot of downtime to learn so I hope to make some progress. So I appreciate you giving some info that is hard to find. Thanks June

  23. #18
    Master Theme Creator June'sIphone's Avatar
    Join Date
    Feb 2010
    Location
    DaytonaBeach, FL
    Posts
    6,894
    Thanks
    5,380
    Thanked 10,341 Times in 3,760 Posts

    Quote Originally Posted by Krima View Post
    Thanks for the info June but its clear that I am not on your level. I Am in the beginning stages of Learning Objective-C and GroovyCarrot has been a great source of info. He doesn't condescend to me but instead is very encouraging, which I appreciate.

    My job affords me a lot of downtime to learn so I hope to make some progress. So I appreciate you giving some info that is hard to find. Thanks June
    He should come and help too.

  24. #19
    Quote Originally Posted by June'sIphone View Post
    He should come and help too.
    He has so much on his plate right now, I would hate to pressure him to add one more thing to it. MMI can sometimes be a hostile place when offering alternatives or suggestions that don't line up with the creator. He's not like me, he hates the friction. Lol

  25. #20
    Master Theme Creator June'sIphone's Avatar
    Join Date
    Feb 2010
    Location
    DaytonaBeach, FL
    Posts
    6,894
    Thanks
    5,380
    Thanked 10,341 Times in 3,760 Posts

    Quote Originally Posted by Krima View Post
    He has so much on his plate right now, I would hate to pressure him to add one more thing to it. MMI can sometimes be a hostile place when offering alternatives or suggestions that don't line up with the creator. He's not like me, he hates the friction. Lol
    Don't we all.

Page 1 of 11 123 ... LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •