kopia lustrzana https://github.com/ryukoposting/Signal-Android
				
				
				
			
							rodzic
							
								
									2ef0054840
								
							
						
					
					
						commit
						410ec57f80
					
				| 
						 | 
				
			
			@ -33,7 +33,7 @@
 | 
			
		|||
                      android:layout_marginLeft="5dp"
 | 
			
		||||
                      android:hint="Enter name or number"
 | 
			
		||||
                      android:inputType="textPersonName"
 | 
			
		||||
                      android:theme="@style/TextSecure.TitleTextStyle"
 | 
			
		||||
                      style="@style/TextSecure.TitleTextStyle"
 | 
			
		||||
                      android:background="@android:color/transparent"
 | 
			
		||||
                      android:layout_gravity="center_vertical"
 | 
			
		||||
                      android:gravity="center_vertical"/>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,6 +9,7 @@ import android.widget.TextView;
 | 
			
		|||
 | 
			
		||||
import org.thoughtcrime.securesms.R;
 | 
			
		||||
import org.thoughtcrime.securesms.components.AvatarImageView;
 | 
			
		||||
import org.thoughtcrime.securesms.recipients.Recipient;
 | 
			
		||||
import org.thoughtcrime.securesms.recipients.RecipientFactory;
 | 
			
		||||
import org.thoughtcrime.securesms.recipients.Recipients;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -50,7 +51,10 @@ public class ContactSelectionListItem extends RelativeLayout implements Recipien
 | 
			
		|||
    this.id     = id;
 | 
			
		||||
    this.number = number;
 | 
			
		||||
 | 
			
		||||
    if (number != null) {
 | 
			
		||||
    if (type == ContactsDatabase.NEW_TYPE) {
 | 
			
		||||
      this.recipients = null;
 | 
			
		||||
      this.contactPhotoImage.setAvatar(Recipient.getUnknownRecipient(), false);
 | 
			
		||||
    } else if (number != null) {
 | 
			
		||||
      this.recipients = RecipientFactory.getRecipientsFromString(getContext(), number, true);
 | 
			
		||||
      this.recipients.addListener(this);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -60,6 +60,7 @@ public class ContactsDatabase {
 | 
			
		|||
 | 
			
		||||
  public static final int NORMAL_TYPE = 0;
 | 
			
		||||
  public static final int PUSH_TYPE   = 1;
 | 
			
		||||
  public static final int NEW_TYPE    = 2;
 | 
			
		||||
 | 
			
		||||
  private final Context context;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -226,7 +227,7 @@ public class ContactsDatabase {
 | 
			
		|||
    MatrixCursor newNumberCursor = new MatrixCursor(new String[] {ID_COLUMN, NAME_COLUMN, NUMBER_COLUMN, NUMBER_TYPE_COLUMN, LABEL_COLUMN, CONTACT_TYPE_COLUMN}, 1);
 | 
			
		||||
    newNumberCursor.addRow(new Object[]{-1L, context.getString(R.string.contact_selection_list__unknown_contact),
 | 
			
		||||
                                        filter, ContactsContract.CommonDataKinds.Phone.TYPE_CUSTOM,
 | 
			
		||||
                                        "\u21e2", NORMAL_TYPE});
 | 
			
		||||
                                        "\u21e2", NEW_TYPE});
 | 
			
		||||
 | 
			
		||||
    return newNumberCursor;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -142,7 +142,7 @@ public class Recipient {
 | 
			
		|||
 | 
			
		||||
  public static Recipient getUnknownRecipient() {
 | 
			
		||||
    return new Recipient(-1, new RecipientDetails("Unknown", "Unknown", null,
 | 
			
		||||
                                                  ContactPhotoFactory.getDefaultContactPhoto("Unknown"), null));
 | 
			
		||||
                                                  ContactPhotoFactory.getDefaultContactPhoto(null), null));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @Override
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue