Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e3ff31c authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 24701 into eclair

* changes:
  Add call button to favorites, and move button to right side of call log.
parents 250db2bb 42c6f660
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -98,5 +98,17 @@
            android:textAppearance="?android:attr/textAppearanceLarge"
        />
            
        <ImageView android:id="@+id/call_button"
	        android:layout_width="50dip"
	        android:layout_height="50dip"
	        android:layout_marginLeft="9dip"
	        android:layout_alignParentRight="true"
	        android:layout_centerVertical="true"
	        
	        android:gravity="center"
	        android:src="@android:drawable/sym_action_call"
	        android:background="@drawable/list_item_secondary_button"
	    />
    
    </RelativeLayout>
</LinearLayout>
 No newline at end of file
+12 −0
Original line number Diff line number Diff line
@@ -104,5 +104,17 @@
            android:textAppearance="?android:attr/textAppearanceLarge"
        />
        
        <ImageView android:id="@+id/call_button"
	        android:layout_width="50dip"
	        android:layout_height="50dip"
	        android:layout_marginLeft="9dip"
	        android:layout_alignParentRight="true"
	        android:layout_centerVertical="true"
	        
	        android:gravity="center"
	        android:src="@android:drawable/sym_action_call"
	        android:background="@drawable/list_item_secondary_button"
	    />
    
    </RelativeLayout>
</LinearLayout>
+15 −26
Original line number Diff line number Diff line
@@ -17,43 +17,34 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:paddingLeft="0dip"
    android:paddingRight="12dip"
    android:paddingLeft="9dip"
    android:paddingRight="9dip"
>

    <ImageView android:id="@+id/call_icon"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"

        android:paddingLeft="14dip"
        android:paddingRight="11dip"
        android:layout_width="50dip"
        android:layout_height="50dip"
        android:layout_marginLeft="9dip"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        
        android:gravity="center_vertical"
        android:gravity="center"
        android:src="@android:drawable/sym_action_call"
        android:background="@android:drawable/list_selector_background"
    />

    <View android:id="@+id/divider"
        android:layout_width="1dip"
        android:layout_height="fill_parent"
        android:layout_toRightOf="@id/call_icon"
        android:layout_marginRight="11dip"

        android:background="@drawable/divider_vertical_dark"
        android:background="@drawable/list_item_secondary_button"
    />
    
    <ImageView android:id="@+id/call_type_icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_toLeftOf="@id/call_icon"
        android:layout_alignParentTop="true"
    />
    
    <TextView android:id="@+id/date"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentBottom="true"
        android:layout_toLeftOf="@id/call_icon"
        android:layout_marginBottom="9dip"

        android:textAppearance="?android:attr/textAppearanceSmall"
@@ -63,7 +54,6 @@
    <TextView android:id="@+id/label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/divider"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="8dip"
        android:layout_marginTop="-10dip"
@@ -92,9 +82,8 @@
    <TextView android:id="@+id/line1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/divider"
        android:layout_toLeftOf="@id/call_type_icon"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_above="@id/label"
        android:layout_alignWithParentIfMissing="true"
        
+22 −1
Original line number Diff line number Diff line
@@ -166,6 +166,8 @@ public final class ContactsListActivity extends ListActivity implements
    static final int MODE_MASK_SHOW_PHOTOS = 0x08000000;
    /** Mask for hiding additional information e.g. primary phone number in the list */
    static final int MODE_MASK_NO_DATA = 0x04000000;
    /** Mask for showing a call button in the list */
    static final int MODE_MASK_SHOW_CALL_BUTTON = 0x02000000;

    /** Unknown mode */
    static final int MODE_UNKNOWN = 0;
@@ -178,7 +180,7 @@ public final class ContactsListActivity extends ListActivity implements
    /** Show frequently contacted contacts */
    static final int MODE_FREQUENT = 30 | MODE_MASK_SHOW_PHOTOS;
    /** Show starred and the frequent */
    static final int MODE_STREQUENT = 35 | MODE_MASK_SHOW_PHOTOS;
    static final int MODE_STREQUENT = 35 | MODE_MASK_SHOW_PHOTOS | MODE_MASK_SHOW_CALL_BUTTON;
    /** Show all contacts and pick them when clicking */
    static final int MODE_PICK_CONTACT = 40 | MODE_MASK_PICKER | MODE_MASK_SHOW_PHOTOS;
    /** Show all contacts as well as the option to create a new one */
@@ -1791,6 +1793,7 @@ public final class ContactsListActivity extends ListActivity implements
        public TextView header;
        public View divider;
        public TextView nameView;
        public ImageView callView;
        public CharArrayBuffer nameBuffer = new CharArrayBuffer(128);
        public TextView labelView;
        public CharArrayBuffer labelBuffer = new CharArrayBuffer(128);
@@ -1818,6 +1821,7 @@ public final class ContactsListActivity extends ListActivity implements
        private CharSequence mUnknownNameText;
        private CharSequence[] mLocalizedLabels;
        private boolean mDisplayPhotos = false;
        private boolean mDisplayCallButton = false;
        private boolean mDisplayAdditionalData = true;
        private HashMap<Long, SoftReference<Bitmap>> mBitmapCache = null;
        private HashSet<ImageView> mItemsMissingImages = null;
@@ -1867,6 +1871,10 @@ public final class ContactsListActivity extends ListActivity implements
                mDisplayAdditionalData = false;
            }

            if ((mMode & MODE_MASK_SHOW_CALL_BUTTON) == MODE_MASK_SHOW_CALL_BUTTON) {
                mDisplayCallButton = true;
            }

            if ((mMode & MODE_MASK_SHOW_PHOTOS) == MODE_MASK_SHOW_PHOTOS) {
                mDisplayPhotos = true;
                setViewResource(R.layout.contacts_list_item_photo);
@@ -2057,6 +2065,10 @@ public final class ContactsListActivity extends ListActivity implements
            cache.header = (TextView) view.findViewById(R.id.header);
            cache.divider = view.findViewById(R.id.list_divider);
            cache.nameView = (TextView) view.findViewById(R.id.name);
            cache.callView = (ImageView) view.findViewById(R.id.call_button);
            if (cache.callView != null) {
                cache.callView.setOnClickListener(ContactsListActivity.this);
            }
            cache.labelView = (TextView) view.findViewById(R.id.label);
            cache.dataView = (TextView) view.findViewById(R.id.data);
            cache.presenceView = (ImageView) view.findViewById(R.id.presence);
@@ -2119,6 +2131,15 @@ public final class ContactsListActivity extends ListActivity implements
                cache.nameView.setText(mUnknownNameText);
            }

            // Make the call button visible if requested.
            if (mDisplayCallButton) {
                int pos = cursor.getPosition();
                cache.callView.setVisibility(View.VISIBLE);
                cache.callView.setTag(pos);
            } else {
                cache.callView.setVisibility(View.GONE);
            }

            // Set the photo, if requested
            if (mDisplayPhotos) {