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

Commit b0914bcb authored by Marcus Hagerott's avatar Marcus Hagerott
Browse files

Remove avatars from SIM import

SIM contacts can't have a photo anyways.
Also fixed clipping when the SIM import list is scrolled.

Test
manually verified that avatars aren't displayed on SIM import screen

Bug 31781331

Change-Id: Iee958c90dfb4759d5a18ecc2b5bce5cdffbaae99
parent 674d0329
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -49,7 +49,6 @@
        <FrameLayout
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp"
            android:background="?android:colorBackground"
            android:background="?android:colorBackground"
            android:elevation="4dp">
            android:elevation="4dp">


@@ -63,7 +62,9 @@
            <ListView
            <ListView
                android:id="@+id/list"
                android:id="@+id/list"
                android:layout_width="match_parent"
                android:layout_width="match_parent"
                android:layout_height="match_parent"/>
                android:layout_height="match_parent"
                android:paddingTop="8dp"
                android:clipToPadding="false"/>


            <android.support.v4.widget.ContentLoadingProgressBar
            <android.support.v4.widget.ContentLoadingProgressBar
                android:id="@+id/loading_progress"
                android:id="@+id/loading_progress"
+2 −3
Original line number Original line Diff line number Diff line
@@ -89,6 +89,8 @@ public class SimImportFragment extends DialogFragment
        mAccountTypeManager = AccountTypeManager.getInstance(getActivity());
        mAccountTypeManager = AccountTypeManager.getInstance(getActivity());
        mAdapter = new SimContactAdapter(getActivity());
        mAdapter = new SimContactAdapter(getActivity());


        // This needs to be set even though photos aren't loaded because the adapter assumes it
        // will be non-null
        mAdapter.setPhotoLoader(ContactPhotoManager.getInstance(getActivity()));
        mAdapter.setPhotoLoader(ContactPhotoManager.getInstance(getActivity()));
        mAdapter.setDisplayCheckBoxes(true);
        mAdapter.setDisplayCheckBoxes(true);
        mAdapter.setHasHeader(0, false);
        mAdapter.setHasHeader(0, false);
@@ -277,7 +279,6 @@ public class SimImportFragment extends DialogFragment


    private static class SimContactAdapter extends ContactListAdapter {
    private static class SimContactAdapter extends ContactListAdapter {
        private ArrayList<SimContact> mContacts;
        private ArrayList<SimContact> mContacts;
        private static float DISABLED_AVATAR_ALPHA = 0.38f;
        private AccountWithDataSet mSelectedAccount;
        private AccountWithDataSet mSelectedAccount;
        private Map<AccountWithDataSet, Set<SimContact>> mExistingMap;
        private Map<AccountWithDataSet, Set<SimContact>> mExistingMap;
        private Map<AccountWithDataSet, TreeSet<Long>> mPerAccountCheckedIds = new ArrayMap<>();
        private Map<AccountWithDataSet, TreeSet<Long>> mPerAccountCheckedIds = new ArrayMap<>();
@@ -295,7 +296,6 @@ public class SimImportFragment extends DialogFragment
            super.bindView(itemView, partition, cursor, position);
            super.bindView(itemView, partition, cursor, position);
            ContactListItemView contactView = (ContactListItemView) itemView;
            ContactListItemView contactView = (ContactListItemView) itemView;
            bindNameAndViewId(contactView, cursor);
            bindNameAndViewId(contactView, cursor);
            bindPhoto(contactView, partition, cursor);


            // For accessibility. Tapping the item checks this so we don't need it to be separately
            // For accessibility. Tapping the item checks this so we don't need it to be separately
            // clickable
            // clickable
@@ -390,7 +390,6 @@ public class SimImportFragment extends DialogFragment


        private void setViewEnabled(ContactListItemView itemView, boolean enabled) {
        private void setViewEnabled(ContactListItemView itemView, boolean enabled) {
            itemView.getCheckBox().setEnabled(enabled);
            itemView.getCheckBox().setEnabled(enabled);
            itemView.getPhotoView().setAlpha(enabled ? 1f : DISABLED_AVATAR_ALPHA);
            itemView.getNameTextView().setEnabled(enabled);
            itemView.getNameTextView().setEnabled(enabled);
        }
        }
    }
    }