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

Commit 685fdd50 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change I23d84a63 into eclair

* changes:
  Include Google Talk presence, even when missing Im rows.
parents c759ffbc 624ddc3c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -41,11 +41,11 @@
            android:layout_alignParentRight="true">

            <ImageView android:id="@+id/presence"
                android:layout_width="32dip"
                android:layout_height="32dip"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dip"
                android:layout_marginRight="5dip"

                android:padding="7dip"
                android:layout_gravity="center_vertical"
                android:scaleType="centerInside"
            />
+3 −3
Original line number Diff line number Diff line
@@ -41,11 +41,11 @@
            android:layout_alignParentRight="true">

            <ImageView android:id="@+id/presence"
                android:layout_width="32dip"
                android:layout_height="32dip"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dip"
                android:layout_marginRight="5dip"

                android:padding="7dip"
                android:layout_gravity="center_vertical"
                android:scaleType="centerInside"
            />
+14 −5
Original line number Diff line number Diff line
@@ -63,21 +63,30 @@
                android:paddingLeft="3dip"
                android:src="@drawable/ic_default_number"
            />

        </LinearLayout>

        <TextView
            android:id="@+id/footer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:visibility="gone" />

    </LinearLayout>

    <ImageView android:id="@+id/presence_icon"
        android:layout_width="32dip"
        android:layout_height="32dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dip"
        android:gravity="center"
        android:scaleType="centerInside"
    />

    <ImageView android:id="@+id/action_icon"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_width="30dip"
        android:layout_height="30dip"
        android:layout_marginLeft="14dip"
        android:layout_marginRight="14dip"
        android:gravity="center"
+3 −2
Original line number Diff line number Diff line
@@ -35,10 +35,11 @@
    <View android:id="@+id/divider"
        android:layout_width="1px"
        android:layout_height="fill_parent"
        android:layout_marginTop="5dip"
        android:layout_marginBottom="5dip"
        android:layout_toLeftOf="@id/call_icon"
        android:layout_marginLeft="11dip"

        android:background="@*android:drawable/divider_vertical_dark_opaque"
        android:background="@drawable/divider_vertical_dark"
    />

    <ImageView android:id="@+id/call_type_icon"
+26 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.contacts;

import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
@@ -222,6 +223,31 @@ public class ContactsUtils {
        return null;
    }

    /**
     * Build {@link Intent} to launch an action for the given {@link Im} or
     * {@link Email} row. Returns null when missing protocol or data.
     */
    public static Intent buildImIntent(ContentValues values) {
        final boolean isEmail = Email.CONTENT_ITEM_TYPE.equals(values.getAsString(Data.MIMETYPE));
        final int protocol = isEmail ? Im.PROTOCOL_GOOGLE_TALK : values.getAsInteger(Im.PROTOCOL);

        String host = values.getAsString(Im.CUSTOM_PROTOCOL);
        String data = values.getAsString(isEmail ? Email.DATA : Im.DATA);
        if (protocol != Im.PROTOCOL_CUSTOM) {
            // Try bringing in a well-known host for specific protocols
            host = ContactsUtils.lookupProviderNameFromId(protocol);
        }

        if (!TextUtils.isEmpty(host) && !TextUtils.isEmpty(data)) {
            final String authority = host.toLowerCase();
            final Uri imUri = new Uri.Builder().scheme(Constants.SCHEME_IMTO).authority(
                    authority).appendPath(data).build();
            return new Intent(Intent.ACTION_SENDTO, imUri);
        } else {
            return null;
        }
    }

    public static Intent getPhotoPickIntent() {
        Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null);
        intent.setType("image/*");
Loading