Skip to content

Commit

Permalink
Little fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CullyCross committed Nov 4, 2015
1 parent 1282c3e commit 9e6df73
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import android.widget.TextView;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.squareup.picasso.Picasso;
import me.cullycross.test4tabs.R;
import me.cullycross.test4tabs.views.ExpandedRecyclerViewLinearManager;
Expand Down Expand Up @@ -68,16 +67,10 @@ public ContactsCursorAdapter(Context context, Cursor cursor) {
final String id = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));
final ContentResolver contentResolver = mContext.getContentResolver();

if (Integer.parseInt(
cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) > 0) {
initPhones(holder, id, contentResolver);
} else {
initEmpty(holder);
}

initPhones(holder, id, contentResolver);
initEmails(holder, id, contentResolver);

if (holder.getPosition() == mExpandedPosition) {
if (holder.getAdapterPosition() == mExpandedPosition) {
holder.mExpandArea.setVisibility(View.VISIBLE);
} else {
holder.mExpandArea.setVisibility(View.GONE);
Expand All @@ -88,7 +81,7 @@ public ContactsCursorAdapter(Context context, Cursor cursor) {
int prev = mExpandedPosition;
notifyItemChanged(prev);
}
mExpandedPosition = holder.getPosition();
mExpandedPosition = holder.getAdapterPosition();
notifyItemChanged(mExpandedPosition);
});
}
Expand Down

0 comments on commit 9e6df73

Please sign in to comment.