OSDN Git Service

b/2531257 More work on cleaning up owner account for dupes
authorErik <roboerik@android.com>
Tue, 23 Mar 2010 17:24:58 +0000 (10:24 -0700)
committerErik <roboerik@android.com>
Tue, 23 Mar 2010 20:52:27 +0000 (13:52 -0700)
Moved the owner account to a second line when calendar names are
duplicated. This gives more space for long calendar names and long
owner accounts. Owner accounts will also now be gray when shown.

Change-Id: I9deec627159bb6a6a6eb3c569c255e6ede342ff0

res/layout/event_info_activity.xml
res/values/colors.xml
src/com/android/calendar/EditEvent.java
src/com/android/calendar/EventInfoActivity.java

index 4a07d3b..fc3ee63 100644 (file)
@@ -52,7 +52,7 @@
                 />
 
                 <!-- CALENDAR -->
-                <LinearLayout android:id="@+id/calendar_container"
+                <RelativeLayout android:id="@+id/calendar_container"
                     android:orientation="horizontal"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:singleLine="true"
+                        android:layout_toRightOf="@id/calendar_label"
+                        android:layout_alignTop="@id/calendar_label"
                         style="?android:attr/textAppearanceSmall"
                     />
-                </LinearLayout>
+
+                    <TextView android:id="@+id/owner"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:singleLine="true"
+                        android:layout_alignLeft="@id/calendar_label"
+                        android:layout_below="@id/calendar_label"
+                        android:textAppearance="?android:attr/textAppearanceSmall"
+                    />
+
+                </RelativeLayout>
 
                 <View android:id="@+id/divider"
                     android:layout_width="match_parent"
index 4c25295..7c229c1 100644 (file)
@@ -26,6 +26,7 @@
     <color name="saturday_text_color">#ff112abb</color>
     <color name="calendar_event_selected_text_color">#ff000000</color>
     <color name="calendar_event_text_color">#ffffffff</color>
+    <color name="calendar_owner_text_color">#ffbebebe</color>
 
     <color name="calendar_all_day_background">#ffe8eef7</color>
     <color name="week_saturday">#ff446688</color>
index 0de5fdc..2bb9e96 100644 (file)
@@ -417,8 +417,10 @@ public class EditEvent extends Activity implements View.OnClickListener,
 
                 TextView accountName = (TextView) view.findViewById(R.id.account_name);
                 if(accountName != null) {
+                    Resources res = context.getResources();
                     accountName.setText(cursor.getString(CALENDARS_INDEX_OWNER_ACCOUNT));
                     accountName.setVisibility(TextView.VISIBLE);
+                    accountName.setTextColor(res.getColor(R.color.calendar_owner_text_color));
                 }
             }
         }
index d7a8d6a..8f4b4cc 100644 (file)
@@ -930,11 +930,12 @@ public class EventInfoActivity extends Activity implements View.OnClickListener,
             String calendarName = mCalendarsCursor.getString(CALENDARS_INDEX_DISPLAY_NAME);
             String ownerAccount = mCalendarsCursor.getString(CALENDARS_INDEX_OWNER_ACCOUNT);
             if (mIsDuplicateName && !calendarName.equalsIgnoreCase(ownerAccount)) {
-                calendarName = new StringBuilder(calendarName)
-                        .append(Utils.OPEN_EMAIL_MARKER)
-                        .append(ownerAccount)
-                        .append(Utils.CLOSE_EMAIL_MARKER)
-                        .toString();
+                Resources res = getResources();
+                TextView ownerText = (TextView) findViewById(R.id.owner);
+                ownerText.setText(ownerAccount);
+                ownerText.setTextColor(res.getColor(R.color.calendar_owner_text_color));
+            } else {
+                setVisibilityCommon(R.id.owner, View.GONE);
             }
             setTextCommon(R.id.calendar, calendarName);
         } else {