OSDN Git Service

b/2496655 Changed launcher to use a default detailed view.
authorErik <roboerik@android.com>
Tue, 9 Mar 2010 03:54:55 +0000 (19:54 -0800)
committerErik <roboerik@android.com>
Tue, 9 Mar 2010 03:54:55 +0000 (19:54 -0800)
prefs for Calendar seems to have lost a detailed view setting. Changed launcher
to use a default one if it isn't found. Also, a bug fix in getPathSegments()
cause an off by one error for one of our checks which caused us to always go to
the current time. Updated timeFromintentInMillis to fix this.

Change-Id: I78bc380590b8bfae6c475f5e302a4e6a5d082258

src/com/android/calendar/LaunchActivity.java
src/com/android/calendar/Utils.java

index 662c66e..26e767a 100644 (file)
@@ -97,9 +97,12 @@ public class LaunchActivity extends Activity {
         String startActivity;
         if (defaultViewKey.equals(VIEW_TYPE_DAY)) {
             startActivity = CalendarApplication.ACTIVITY_NAMES[CalendarApplication.DAY_VIEW_ID];
+        } else if (defaultViewKey.equals(CalendarPreferenceActivity.KEY_DETAILED_VIEW)) {
+            startActivity = prefs.getString(defaultViewKey,
+                    CalendarPreferenceActivity.DEFAULT_DETAILED_VIEW);
         } else {
             startActivity = prefs.getString(defaultViewKey,
-                CalendarPreferenceActivity.DEFAULT_START_VIEW);
+                    CalendarPreferenceActivity.DEFAULT_START_VIEW);
         }
 
         intent.setClassName(this, startActivity);
index aa48fe0..f50a4f9 100644 (file)
@@ -22,7 +22,6 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.net.Uri;
-import android.preference.PreferenceManager;
 import android.text.format.Time;
 import android.util.Log;
 import android.view.animation.AlphaAnimation;
@@ -86,7 +85,7 @@ public class Utils {
         long millis = intent.getLongExtra(EVENT_BEGIN_TIME, -1);
         if (millis == -1 && data != null && data.isHierarchical()) {
             List<String> path = data.getPathSegments();
-            if(path.size() == 3 && path.get(1).equals("time")) {
+            if(path.size() == 2 && path.get(0).equals("time")) {
                 try {
                     millis = Long.valueOf(data.getLastPathSegment());
                 } catch (NumberFormatException e) {