FORUMS
Remove All Ads from XDA

[Manila] Co0kie's Home Tab v2.0.0 - Basic Function Tweaks

2,920 posts
Thanks Meter: 771
 
By RoryB, Inactive Recognized Developer on 8th September 2011, 06:59 PM
Post Reply Email Thread
I am starting this thread to stop high jacking the original [Manila][12-Nov-2010] Co0kie's Home Tab v2.0.0 - Final Released thread.

I have been using CHT for some time through NRG's ROMs.

I began making widgets like the Reminder widget [CHTwidget]CHTw Reminder and helping Poyensa with his Note widget [CHTwidget]CHTw Notes.

I also have created some toggles and worked on some alternate toggle methods like data without WMLongLife.
Automatic to Normal and Vibrate Toggles
Voice Command Toggle
MortScripts to toggle settings

Also, some other links.
Switches for Email Widget to provide functions in lock screen like switching accounts, deleting, etc.

I started seeing things I would like different in the basic code of CHT.

This is the beginning of my journey into this work.

CHT_DataLoaders

Original CHT_DataLoaders with fix for CHT restart

Appointment Widget with Tasks included

CHT Lockscreen

CHT StartUp and CHT Core

Tasks Widget

Email Widget and associated widget lua tweak

Scaled Basic Widgets (the CHT_Widgets.lua)

Free Links unlock control (CHT_FreeLinks.lua)

Some thank yous:

poyensa -- for getting me started with his Notes widget and then all his help through my learning curve
rat_2665 -- for his help and his weather clock for code to study
MichelDiamond -- for his pointers
Many others that have chimed in and of course the testers out there too.
The Following 6 Users Say Thank You to RoryB For This Useful Post: [ View ] Gift RoryB Ad-Free
 
 
8th September 2011, 07:09 PM |#2  
RoryB's Avatar
OP Inactive Recognized Developer
Flag Lexington
Thanks Meter: 771
 
Donate to Me
More
CHT_DataLoaders.lua
Some time ago I noticed something in task widget:

If I have tasks that are due two weeks and later from now. They show up with red text. As the days go by and a task that shows red becomes less than two weeks away the text becomes gray.

Others have the same problem:
Quote:

In the task widget, I want to see only the list of upcoming task for 7 days so I set the "Tasks range" in CHTeditor to 7 but the task that due more than 7 days still show in red text.

And I noticed that if I set "start date", the task will not show in list of task widget.

I began the process of editing CHT_DataLoaders.lua which is the 7B09A9E6_manila file after it is "cooked" in the kitchen:

My interpretation of the original code:
Even if you choose Sort by Start Date it still only includes items that have Due dates within the date range you pick, so items with start dates that do not have due dates in the range do not show up. It appears the intent is to show you tasks that are due within or before the range you select. Your choice of sort by due date or start date only sorts items due on the same date.

What I wanted is items without start dates to be included in the list no matter what their due date is.

In my code I have tried to get it to show start dates in the range instead.

In early development the red still showed up if I sorted by Start Date, but I think this is from the code using Due Date to set color and not sort date or something else.

To no longer have red Tasks listed beyond the Tasks Range, the list now only shows the tasks in the range and does not show any more than that. For example if you set the range to 2 days and you only have one task between now and then you will only see one task in the list.

I have a lot of tasks that do not have start dates so my list became long if I sorted by start date.
I decided to not include items that do not have start dates in the sort by start date and that made more sense.
Later, I changed to have tasks without start dates get sorted by their due date.

Now you should get a list of only items due within the range or before no matter when their start date is.
I find if I show both dates it "looks" better to sort by start date (my new standard setting).
One thing I have noticed if I choose not to show both dates and sort by start date it shows "..." for tasks without start dates and does not show the due date.

Later I figured out a way to do the sort differently.

Start Date:
Now if you select sort by start date you get all tasks that start before or during the task range.
This will include any tasks without start dates at the end of the list, but excludes those due beyond the task range.
This keeps the list smaller. Tasks that start on the same date are sub-sorted by their due date.

Due Date:
If you select sort by due date you get all tasks that are due before or during the task range.
This will include any tasks without due dates.
Tasks that are due on the same date are sub-sorted by their start date.

One thing you have to do is set task max count to 99 for it to work properly. Never mind, I updated the code to force it to be 99 no matter what you set it to.

Updated 12/29/2011
Reduced some redundant code and took out some code that does not seem to have an effect.

Updated 12/28/2011
Improve speed of getting first refresh of tasks into widget.

Updated 12/27/2011
Main thing is fixing the restart of CHT when you have no tasks.

Updated 12/08/2011
Tweaked the task loader portion to add a pause between running CHT task update program and refreshing the list of tasks.

Updated 11/23/2011
Tweaked the appointments filter for showing multiday and allday appointments.

Updated 11/15/2011
Still tweaking to get doNotRepeatMultiday to show the first occurance and not the rest.
Also, getting an AllDay appointment to not show up as ending the next day.

For all updated files I strongly suggest you copy your originals from the \windows folder as a back up. Then copy these to the \windows folder. Then restart Sense.
Attached Files
File Type: zip CHT_DataLoaders.lua.zip - [Click for QR Code] (6.6 KB, 40 views)
File Type: zip CHT_DataLoaders source.zip - [Click for QR Code] (4.7 KB, 21 views)
The Following 3 Users Say Thank You to RoryB For This Useful Post: [ View ] Gift RoryB Ad-Free
8th September 2011, 07:16 PM |#3  
RoryB's Avatar
OP Inactive Recognized Developer
Flag Lexington
Thanks Meter: 771
 
Donate to Me
More
Original CHT_DataLoaders with fix for restart
This is the original CHT_DataLoaders with fix for restarting when you have no tasks.

Updated 12/29/2011
Reduced some redundant code and took out some code that does not seem to have an effect.

Updated 12/28/2011
Improve speed of getting first refresh of tasks into widget.

Be sure to make a safe copy of your \windows\7B09A9E6_manila file

For all updated files I strongly suggest you copy your originals from the \windows folder as a back up. Then copy these to the \windows folder. Then restart Sense.
The Following 4 Users Say Thank You to RoryB For This Useful Post: [ View ] Gift RoryB Ad-Free
8th September 2011, 07:43 PM |#4  
RoryB's Avatar
OP Inactive Recognized Developer
Flag Lexington
Thanks Meter: 771
 
Donate to Me
More
Appointment Widget with Tasks included
I have always wished there was a widget to show appointments and tasks together:
I began the process of editing Co0kieAppointments.lua which is the 5146EC01_manila file after it is "cooked" in the kitchen. It took updates to the CHT_DataLoaders.lua and the Co0kieAppointments.lua to get these features:

My goal is appointments and tasks in one widget that are sorted and mixed together so you may see a task then a couple appointments and then some more tasks based on their date.

I still want to be able tap a task or an appointment to open the task/appointment or task/appointment program depending on your settings.

I also wanted the long press on task features.

I think it would be nice to add features like color.
Tasks that are active and appointments due today will be the active color
Tasks overdue and appointments that are active will be the overdue color.

I set it to sort and show both tasks and appointments within each day having its tasks and then its appointments.

If you tap the date you get a pop up to select refresh, calendar, appointments or tasks so you can create new tasks or appointments. The "New appointment" version pops up a choice for refresh, calendar, appointments or tasks. I could not find and "[[IDS_New]]" to use instead of the "[[IDS_NEW_ENTRY_HEADER]]" so it says "New Appointment".

You can long press a task and get the pop up to "delete" or "complete" it.

I have done my best to get it to refresh on its own more quickly to catch task changes, etc. I think I can force a full update every minute, but do not know if this will eat battery life. It seems like it takes less than 10 seconds to update the list.

I can add a task by selecting the date and then tasks which opens sensetask in a new task. I save it and quit sensetask. In less than 10 seconds the new task shows up. I can long press a task and select complete and it changes color immediately. If I press delete it is gone in less than 10 seconds.

I sometimes get a hiccup where there is strange things in the list, but they clear up after a couple seconds.

Quote:

There were some glitches to work through:
You must set the max task count to 99.
It appears the program that gathers the task data uses this limit for how many to gather.
This is different than the max count for appointments.
With appointments you get them all and filter them and then you limit the filtered list to the max count.

I also changed multi-day all-day appointments to show up a little differently if you have do not show multi-day appointments selected.
It sorts them by their start date so it will show up sooner in the list than the due date.

Just added the completed color to the tasks for completed tasks.

Appointments due today now have "Today:" before the time because it seemed to look strange to me without it.

Tasks have the word "Tasks|" at the beginning to show them up as a task better. Tasks without a start date show their due date instead.

Quote:

My preferred user experience is to set the following in CHTEditor widget settings for appointments and tasks:
Enable scrolling on
Appointment range of 7 days
Max appointments of 20
open in editor is on
Don't repeat multi-day is on
Show appointments
I hide call history since I use the free link for it
I hide voicemail since I use the free link for it
Task range of 7 days
Maximum task count is set to 99
Show complete is on
Show both dates is on
Long press pop up is on (brings up the complete or delete menu)
Sort by start date (this will show all tasks that start in the task day range and if it does not have a start date it still shows if its due date is in the task day range too; all tasks that start or are due before today also show up.)

I made some more tweaks to the files. I have tasks without start and due dates added to the list with today's date, but highlighted as overdue. I changed the way tasks look for different due times like today, tomorrow, etc. I got rid of "Due" to get as few English only text values as possible.

I noticed if you set it to "Hide" in the original code you would not see any appointments at all. I changed it so "Hide" only hides the icon, "Show" always shows the icon and "Auto" only shows the icon if you happen to have no appointments. This is similar to how show-hide-auto works for call history and voice mail.

Added menu to Date and New Appointment items so when you press them a menu shows letting you pick:
1) Refresh - instead of using the separate free link
2) Calendar - to go to the calendar tab
3) Appointments- to go to the appointment program
4) New Appointment - to create a new appointment
5) Tasks - to go to the task program
6) New Task - to create a new task

Updated 12/29/2011
Reduced some redundant code and took out some code that does not seem to have an effect.

Updated 12/28/2011
Help force a refresh when you choose refresh.

Updated 12/27/2011
Main thing is fixing the restart of CHT when you have no tasks.
One thing I have noticed in the code is the way complete and delete is set up you can only do one at a time and have to wait for the refresh before you can do another one. One thing I did to avoid confusion is change text to "Complete. . ." or "Delete. . ." before running the code that changes the task to completed or deleted. When it disappears you know you can complete or delete another one.

Updated 12/08/2011
Added the ability for Voicemail and missed calls to show when you first start the widget like after a restart or reset.
Worked on the refresh code, etc.
While doing this I worked on the code for task refresh especially after selecting "complete" or "delete" in the popup menu.
I added a feature of the task text changes to "Deleting. . ." so you know it has started to delete the task.
I discovered you cannot select another task to delete or complete while the code is refreshing the data of the previous delete or complete.
Maybe I'll look into this later.

Updated 11/23/2011
Tweaked so if a multiday appointment starts today or tomorrow it shows "Today" or "Tomorrow" instead of the date.
Tweaked so if a multiday appointment ends today or tomorrow it shows "Today" or "Tomorrow" instead of the date.
If they start before today they show the date it started, but skips the start time since it is past already.
Tweaked the font scale adjustments to work better.

Updated 11/15/2011
Added time to multiday appointments that are not all day appointments.
Added code to adjust font so all the appointment time text should show.


For all updated files I strongly suggest you copy your originals from the \windows folder as a back up. Then copy these to the \windows folder. Then restart Sense.

You can combine this tweak with the CHT_DataLoader tweak.
The Following 5 Users Say Thank You to RoryB For This Useful Post: [ View ] Gift RoryB Ad-Free
8th September 2011, 08:13 PM |#5  
RoryB's Avatar
OP Inactive Recognized Developer
Flag Lexington
Thanks Meter: 771
 
Donate to Me
More
CHT Lockscreen
I have been using CHT Lockscreen for a while now and selected the choice for lock after a call. It seems it locks after all calls instead of locking only if it was locked before the call. Is this how it works for you all?

I have been looking in the CHT_Lockscreen.lua file, but I have not figured out how lockscreen is called when I end a phone call. I can clearly see code for when we choose lock after unplugging, but not for the phone calls. I also searched all lua files with notepad++, but had no luck either.

Can anyone point me in the right direction for where the lock gets called after a phone call?

I would like to try to get it to lock after a call only if it was locked before the call. There appears to be a registry value associated with it:
Quote:

CHTI.State.WasLockedWhileIncomingCall

It is 0 when not locked and when locked. It becomes 1 when a call comes in, but does not if the phone is not locked before a call. This is as expected, but it still locks after a call even if it is not locked before the call.

I used notepad++ to search for WasLockedWhileIncomingCall in all files of the lua code for CHT and did not find it.

---------------------------------------------------------

I have created my own WasLockedWhileIncomingCall code for CHT_Lockscreen.lua which is 4956014B_manila when cooked:

I could not figure out the setting of lock after call, so if you have it on and your phone works like mine it will always lock after a call.

With my change you turn this setting off and your phone will only lock after a call if it was locked before the call. Set it back on and it will lock after all calls.


For all updated files I strongly suggest you copy your originals from the \windows folder as a back up. Then copy these to the \windows folder. Then restart Sense.
The Following 3 Users Say Thank You to RoryB For This Useful Post: [ View ] Gift RoryB Ad-Free
12th September 2011, 12:19 PM |#6  
RoryB's Avatar
OP Inactive Recognized Developer
Flag Lexington
Thanks Meter: 771
 
Donate to Me
More
CHT_StartUp and CHT_Core
CHT_StartUp

I have noticed CHT restarts Sense once in a while. If my phone is locked with CHT it still restarts, but does not lock afterward.

This tweak checks to see if CHT lockscreen was running and after CHT restarts Sense it will lock the phone again.

The file is 55933D15_manila

****************************************
CHT_Core

I had a problem with Longpress popup menus not working. I discovered it did not work if I set Animation level to None and worked if I set it to the other levels.

I tweaked CHT_Core.lua to make it work. The file is 750CA94B_manila

Updated 12/29/2011
Tweaked the check limits portion to see if the widgets are on the same page and not just the same level. This allows the appointment widget on the second page to be at the top of the page and not cause the clock at the top of my first page to hide.

For all updated files I strongly suggest you copy your originals from the \windows folder as a back up. Then copy these to the \windows folder. Then restart Sense.
Attached Files
File Type: zip CHT_Startup.lua.zip - [Click for QR Code] (1.7 KB, 27 views)
File Type: zip CHT_Startup.lua source.zip - [Click for QR Code] (1.1 KB, 15 views)
File Type: zip CHT_Core.lua.zip - [Click for QR Code] (34.5 KB, 18 views)
File Type: zip CHT_Core source.zip - [Click for QR Code] (17.0 KB, 9 views)
The Following 3 Users Say Thank You to RoryB For This Useful Post: [ View ] Gift RoryB Ad-Free
14th September 2011, 06:07 AM |#7  
RoryB's Avatar
OP Inactive Recognized Developer
Flag Lexington
Thanks Meter: 771
 
Donate to Me
More
CHT_FreeLinks
I found that if I accidentally touched a free link while trying to slide to another page on the lock screen it would unlock so... I added tweaks to only unlock if I slid to the free link slide to unlock distance, but not more than twice that distance. That way if I slide more than that it changes pages instead.

For all updated files I strongly suggest you copy your originals from the \windows folder as a back up. Then copy these to the \windows folder. Then restart Sense.
Attached Files
File Type: zip 58B6C4C5_manila.zip - [Click for QR Code] (10.1 KB, 25 views)
File Type: zip FreeLinks source.zip - [Click for QR Code] (4.9 KB, 7 views)
The Following User Says Thank You to RoryB For This Useful Post: [ View ] Gift RoryB Ad-Free
14th September 2011, 06:07 AM |#8  
RoryB's Avatar
OP Inactive Recognized Developer
Flag Lexington
Thanks Meter: 771
 
Donate to Me
More
**RESERVED for more**
14th September 2011, 06:07 AM |#9  
RoryB's Avatar
OP Inactive Recognized Developer
Flag Lexington
Thanks Meter: 771
 
Donate to Me
More
Email Widget
I have noticed when I go to my Email widget it shows the last email I was looking at. If I have gotten a new email the count x of y is blank.

I decided to figure out a tweak to get the widget to always go to the first email in the list.

I ended up having to tweak Co0kieEmail.lua file to get it to work when going from one hometab page to the other and the CHT_Widgets.lua file to get it to work when going from other tabs to the home tab. It also works on my lockscreen.

I have figured out when you have animation instead of simple page changes you will not get a double flip of the envelope.

Updated 11/15/2011
Improved the jump to the first email so you do not get the double flip in the fancier page switch settings.
Added a delay to not remove the notification until the email page actually shows when you switch to the email widget after there has been a new email notification.
Updated 11/10/2011
Added a menu item to jump to the first email so if you have flipped through a lot of messages you can jump back to the first message.

Be sure to make a safe copy of your \windows\29C5E347_manila and \windows\4B558519_manila files

For all updated files I strongly suggest you copy your originals from the \windows folder as a back up. Then copy these to the \windows folder. Then restart Sense.

Removed outdated Widgets.lua file. See below.
Attached Files
File Type: zip Co0kieEmail.zip - [Click for QR Code] (18.1 KB, 17 views)
File Type: zip Co0kieEmail source.zip - [Click for QR Code] (8.4 KB, 7 views)
14th September 2011, 06:07 AM |#10  
RoryB's Avatar
OP Inactive Recognized Developer
Flag Lexington
Thanks Meter: 771
 
Donate to Me
More
Tasks Widget
I also made some changes to the Co0kieTasks.lua which is the 3778A5E5_manila file after it is "cooked" in the kitchen:

If the task only has one date it only shows one instead of the "..."

It color codes the items still.

Added menu to Date and New Task items so when you press them a menu shows letting you pick:
1) Update Tasks - instead of using the separate free link
2) Calendar - to go to the calendar tab
3) Tasks - to go to the task program
4) New Task - to create a new task

Updated 12/27/2011
Main thing is fixing the restart of CHT when you have no tasks.
One thing I have noticed in the code is the way complete and delete is set up you can only do one at a time and have to wait for the refresh before you can do another one. One thing I did to avoid confusion is change text to "Complete. . ." or "Delete. . ." before running the code that changes the task to completed or deleted. When it disappears you know you can complete or delete another one.

For all updated files I strongly suggest you copy your originals from the \windows folder as a back up. Then copy these to the \windows folder. Then restart Sense.

You can combine this tweak with the CHT_DataLoader tweak.
The Following 2 Users Say Thank You to RoryB For This Useful Post: [ View ] Gift RoryB Ad-Free
14th September 2011, 06:07 AM |#11  
RoryB's Avatar
OP Inactive Recognized Developer
Flag Lexington
Thanks Meter: 771
 
Donate to Me
More
Scaled Basic Widgets
This updated version includes the tweak for having email go to the first item when you switch to home tab from other tabs from post #8 above.

Scaled Default Weather Clock:
It also has a change that allows the default clock with weather to be scaled. Now I can fit my weather clock and reminder widget side-by-side.

Added the following scaled widgets. I included the ability to go larger than default size too.
Quote:

Appointments (works for AppTask version too)
Tasks
Notification bar
Email
SMS


Updated 12/29/2011
Tweaked the scaling portion based on the core.lua edits to stop hiding the clock on a different page. This tweak fixed the "x" position to be sure it shows as being on the correct page. It affects most of the tweaks and not just the appointments widget.

CHT_Widgets.lua file or \windows\4B558519_manila file

For all updated files I strongly suggest you copy your originals from the \windows folder as a back up. Then copy these to the \windows folder. Then restart Sense.
Attached Thumbnails
Click image for larger version

Name:	scaled_weather_clock.jpeg
Views:	242
Size:	51.0 KB
ID:	760130  
Attached Files
File Type: zip CHT_Widgets scalable.zip - [Click for QR Code] (22.1 KB, 25 views)
File Type: zip CHT_Widgets_source.zip - [Click for QR Code] (10.3 KB, 16 views)
The Following 2 Users Say Thank You to RoryB For This Useful Post: [ View ] Gift RoryB Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes