Created
October 7, 2013 03:05
-
-
Save jpotts18/6862002 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private int TYPE_MESSAGE = 1; | |
private int TYPE_ACTIVITY = 2; | |
private int TYPE_MEAL = 3; | |
private int TYPE_DRINK = 5 | |
private int TYPE_DAILY_INPUT = 4; | |
@SuppressWarnings("unchecked") | |
public TimeLineAdapter(Context mContext, int textViewResourceId, List<TimelineObject> timelineList, DailyInput dailyInput) { | |
super(mContext, textViewResourceId, timelineList); | |
this.timelineList = timelineList; | |
this.dailyInput = dailyInput; | |
this.mContext = mContext; | |
} | |
@Override | |
public int getItemViewType(int position) { | |
int typeId = 0; | |
if(timelineList.get(position) instanceof Message){ | |
typeId = TYPE_MESSAGE; | |
} | |
if(timelineList.get(position) instanceof PhysicalActivity){ | |
typeId = TYPE_ACTIVITY; | |
} | |
if(timelineList.get(position) instanceof GetOnlyMeal){ | |
typeId = TYPE_MEAL; | |
} | |
if(timelineList.get(position) instanceof Hydration){ | |
typeId = TYPE_DRINK; | |
} | |
return typeId; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment