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

Commit ff7a1870 authored by blong's avatar blong Committed by Xiaojing Zhang
Browse files

Add SIM photo for SIM contacts

- Add the account parameter to load SIM contacts

Change-Id: I7c607be14a935fbf3af0f7698e521f9cd752e334
parent b5f30fe9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ public class ConfirmAddDetailActivity extends Activity implements
        mDisplayNameView = (TextView) findViewById(R.id.name);
        mPhotoView = (ImageView) findViewById(R.id.photo);
        mPhotoView.setImageDrawable(ContactPhotoManager.getDefaultAvatarDrawableForContact(
                getResources(), false, null));
                this, false, null, null));

        mEditorContainerView = (ViewGroup) findViewById(R.id.editor_container);

@@ -746,8 +746,8 @@ public class ConfirmAddDetailActivity extends Activity implements

    private void setDefaultContactImage(String displayName, String lookupKey) {
        mPhotoView.setImageDrawable(ContactPhotoManager.getDefaultAvatarDrawableForContact(
                getResources(), false,
                new DefaultImageRequest(displayName, lookupKey, false /* isCircular */)));
                this, false,
                new DefaultImageRequest(displayName, lookupKey, false /* isCircular */), null));
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ public class PhotoSelectionActivity extends Activity {
        int photoWidth = getPhotoEndParams().width;
        if (mPhotoUri != null) {
            // If we have a URI, the bitmap should be cached directly.
            ContactPhotoManager.getInstance(this).loadPhoto(mPhotoView, mPhotoUri, photoWidth,
            ContactPhotoManager.getInstance(this).loadPhoto(mPhotoView, mPhotoUri, null, photoWidth,
                    false /* darkTheme */, false /* isCircular */, null);
        } else {
            // If we don't have a URI, just display an empty ImageView. The default image from the
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ public class AggregationSuggestionView extends LinearLayout {
                    suggestion.photo, 0, suggestion.photo.length));
        } else {
            photo.setImageDrawable(ContactPhotoManager.getDefaultAvatarDrawableForContact(
                    getResources(), false, null));
                    getContext(), false, null, null));
        }

        TextView name = (TextView) findViewById(R.id.aggregation_suggestion_name);
+6 −1
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ import android.widget.Toast;
import com.android.contacts.activities.PeopleActivity;
import com.android.contacts.R;
import com.android.contacts.common.ContactPhotoManager;
import com.android.contacts.common.ContactPhotoManager.DefaultImageRequest;
import com.android.contacts.common.SimContactsConstants;
import com.android.contacts.common.SimContactsOperation;
import com.android.contacts.common.list.AccountFilterActivity;
@@ -1133,7 +1134,11 @@ public class MultiPickContactActivity extends ListActivity implements
                }
                ImageView photo = ((ImageView) view.findViewById(R.id.pick_contact_photo));
                photo.setVisibility(View.VISIBLE);
                mContactPhotoManager.loadThumbnail(photo, photoId, false, true, null);
                DefaultImageRequest request = null;
                if (photoId == 0) {
                    request = new DefaultImageRequest(cache.name, cache.lookupKey, true);
                }
                mContactPhotoManager.loadThumbnail(photo, photoId, account, false, true, request);
            } else if (isPickPhone()) {
                cache.id = cursor.getLong(PHONE_COLUMN_ID);
                cache.name = cursor.getString(PHONE_COLUMN_DISPLAY_NAME);
+2 −1
Original line number Diff line number Diff line
@@ -168,7 +168,8 @@ public class PhotoEditorView extends LinearLayout implements Editor {
    protected void resetDefault() {
        // Invalid photo, show default "add photo" place-holder
        mPhotoImageView.setImageDrawable(
                ContactPhotoManager.getDefaultAvatarDrawableForContact(getResources(), false, null));
                ContactPhotoManager.getDefaultAvatarDrawableForContact(getContext(),
                        false, null, null));
        mFrameView.setEnabled(!mReadOnly && isEnabled());
        mHasSetPhoto = false;
        mEntry.setFromTemplate(true);
Loading