Messaging: Replace explicit types
Change-Id: I2165b3dec73973a2a82d8b3c7c364b5f011e597d
This commit is contained in:
@@ -310,7 +310,7 @@ public final class ContactRecipientAdapter extends BaseRecipientAdapter {
|
||||
final RecipientMatchCallback callback) {
|
||||
final int addressesSize = Math.min(
|
||||
RecipientAlternatesAdapter.MAX_LOOKUPS, inAddresses.size());
|
||||
final HashSet<String> addresses = new HashSet<String>();
|
||||
final HashSet<String> addresses = new HashSet<>();
|
||||
for (int i = 0; i < addressesSize; i++) {
|
||||
final Rfc822Token[] tokens = Rfc822Tokenizer.tokenize(inAddresses.get(i).toLowerCase());
|
||||
addresses.add(tokens.length > 0 ? tokens[0].getAddress() : inAddresses.get(i));
|
||||
|
||||
@@ -259,8 +259,7 @@ public class ContactRecipientAutoCompleteView extends RecipientEditTextView {
|
||||
public ArrayList<ParticipantData> getRecipientParticipantDataForConversationCreation() {
|
||||
final DrawableRecipientChip[] recips = getText()
|
||||
.getSpans(0, getText().length(), DrawableRecipientChip.class);
|
||||
final ArrayList<ParticipantData> contacts =
|
||||
new ArrayList<ParticipantData>(recips.length);
|
||||
final ArrayList<ParticipantData> contacts = new ArrayList<>(recips.length);
|
||||
for (final DrawableRecipientChip recipient : recips) {
|
||||
final RecipientEntry entry = recipient.getEntry();
|
||||
if (entry != null && entry.isValid() && entry.getDestination() != null &&
|
||||
@@ -277,7 +276,7 @@ public class ContactRecipientAutoCompleteView extends RecipientEditTextView {
|
||||
* consumer with determining quickly whether a contact is currently selected.
|
||||
*/
|
||||
public Set<String> getSelectedDestinations() {
|
||||
Set<String> set = new HashSet<String>();
|
||||
Set<String> set = new HashSet<>();
|
||||
final DrawableRecipientChip[] recips = getText()
|
||||
.getSpans(0, getText().length(), DrawableRecipientChip.class);
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ContactRecipientPhotoManager implements PhotoManager {
|
||||
new AvatarRequestDescriptor(avatarUri, mIconSize, mIconSize);
|
||||
final BindableMediaRequest<ImageResource> req = descriptor.buildAsyncMediaRequest(
|
||||
mContext,
|
||||
new MediaResourceLoadListener<ImageResource>() {
|
||||
new MediaResourceLoadListener<>() {
|
||||
@Override
|
||||
public void onMediaResourceLoaded(final MediaRequest<ImageResource> request,
|
||||
final ImageResource resource, final boolean isCached) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -111,7 +112,7 @@ public class ContactSectionIndexer implements SectionIndexer {
|
||||
}
|
||||
|
||||
this.mSections = sections;
|
||||
mSectionStartingPositions = new ArrayList<Integer>(counts.length);
|
||||
mSectionStartingPositions = new ArrayList<>(counts.length);
|
||||
int position = 0;
|
||||
for (int i = 0; i < counts.length; i++) {
|
||||
if (TextUtils.isEmpty(mSections[i])) {
|
||||
@@ -131,8 +132,8 @@ public class ContactSectionIndexer implements SectionIndexer {
|
||||
// The result is stored into two arrays, one for the section header (i.e. the first
|
||||
// character), and one for the starting position, which is guaranteed to be sorted in
|
||||
// ascending order.
|
||||
final ArrayList<String> sections = new ArrayList<String>();
|
||||
mSectionStartingPositions = new ArrayList<Integer>();
|
||||
final ArrayList<String> sections = new ArrayList<>();
|
||||
mSectionStartingPositions = new ArrayList<>();
|
||||
if (cursor != null) {
|
||||
cursor.moveToPosition(-1);
|
||||
int currentPosition = 0;
|
||||
|
||||
Reference in New Issue
Block a user