Author: jerome
Date: 2009-04-08 20:31:15 +0200 (Wed, 08 Apr 2009)
New Revision: 4423

Modified:
   
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java
   
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/programs/SimplePrograms.java
Log:
* Fixed a bug when they had two consecutive same programs into the grid.

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java
 2009-04-08 17:32:26 UTC (rev 4422)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java
 2009-04-08 18:31:15 UTC (rev 4423)
@@ -48,7 +48,7 @@
                                }
                                else
                                {
-                                       gadget.throwMessage("On {0} at {1} {2}, 
the descripion is {3}",oneProgram.getChannel(), oneProgram.getStartTime(), 
oneProgram.getTitle(), oneProgram.getDescription());
+                                       gadget.throwMessage("On {0} at {1} {2}, 
the description is {3}",oneProgram.getChannel(), oneProgram.getStartTime(), 
oneProgram.getTitle(), oneProgram.getDescription());
                                }
                        }
                }
@@ -66,7 +66,7 @@
                                }
                                else
                                {
-                                       gadget.throwMessage("On {0} at {1} {2}, 
the descripion is {3}", oneProgram.getChannel(), oneProgram.getStartTime(), 
oneProgram.getTitle(), oneProgram.getDescription());
+                                       gadget.throwMessage("On {0} at {1} {2}, 
the description is {3}", oneProgram.getChannel(), oneProgram.getStartTime(), 
oneProgram.getTitle(), oneProgram.getDescription());
                                }
                        }
                }
@@ -83,7 +83,7 @@
                                }
                                else
                                {
-                                       gadget.throwMessage("On {0} at {1} {2}, 
the descripion is {3}", oneProgram.getChannel(), oneProgram.getStartTime(), 
oneProgram.getTitle(), oneProgram.getDescription());
+                                       gadget.throwMessage("On {0} at {1} {2}, 
the description is {3}", oneProgram.getChannel(), oneProgram.getStartTime(), 
oneProgram.getTitle(), oneProgram.getDescription());
                                }
                        }
                }

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/programs/SimplePrograms.java
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/programs/SimplePrograms.java
        2009-04-08 17:32:26 UTC (rev 4422)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/programs/SimplePrograms.java
        2009-04-08 18:31:15 UTC (rev 4423)
@@ -27,6 +27,7 @@
 import java.util.Hashtable;
 import java.util.Vector;
 
+import com.kysoh.tuxdroid.gadget.framework.gadget.SimpleGadget;
 import com.kysoh.tvPrograms.HTMLUtils;
 import com.kysoh.tvPrograms.Program;
 import com.kysoh.tvPrograms.ProgramLoadListener;
@@ -273,15 +274,22 @@
                                {
                                        while(str.contains("<B>"))
                                        {
+                                               String rpl = "";
+                                               
                                                //Get start time for next str 
entry.
                                                String startTime = 
str.substring(0, str.indexOf("<B>"));
-                                               str = str.replace(startTime, 
"");
+                                               
+                                               rpl += startTime;
+                                               
                                                startTime = 
HTMLUtils.HtmlToString(startTime).substring(0, 5); 
                                                
                                                //Get title.
-                                               String title = 
str.substring(str.indexOf("<B>") + "<B>".length(), str.indexOf("</B>"));
-                                               str = str.replace(title, "");
-                                               str = 
str.substring(str.indexOf("</B>") + "</B>".length());
+                                               String title = 
str.substring(str.indexOf("<B>"), str.indexOf("</B>") + "</B>".length());
+                                               
+                                               rpl += title;
+                                               
+                                               title = title.replace("<B>", 
"");
+                                               title = title.replace("</B>", 
"");
                                                title = 
HTMLUtils.HtmlToString(title);
                                                
                                                //Getting description if it can 
be found.
@@ -289,9 +297,10 @@
                                                
                                                if(str.contains("<ul>"))
                                                {
-                                                       description = 
str.substring(str.indexOf("<ul>") + "<ul>".length(), str.indexOf("</ul>"));
-                                                       str = 
str.replace(description, "");
-                                                       str = str.substring(9);
+                                                       description = 
str.substring(str.indexOf("<ul>"), str.indexOf("</ul>") + "</ul>".length());
+                                                       rpl += description;
+                                                       description = 
description.replace("<ul>", "");
+                                                       description = 
description.replace("</ul>", "");
                                                        description = 
HTMLUtils.HtmlToString(description);
                                                }
                                                
@@ -303,8 +312,10 @@
                                                
                                                catch(Exception titleError)
                                                {
-                                                       
System.out.println(titleError.getMessage());
+                                                       ;
                                                }
+                                               
+                                               str = str.replace(rpl, "");
                                        }
                                }
                        }


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to