use of com.polito.mad17.madmax.activities.expenses.ProposedExpenseCommentsFragment in project MadMax by deviz92.
the class ExpenseDetailPagerAdapter method getItem.
@Override
public Fragment getItem(int position) {
Bundle bundle = new Bundle();
bundle.putString("expenseID", expenseID);
switch(position) {
case 0:
if (fragmentName.equals("ExpenseDetailActivity")) {
Log.i(TAG, "here in case 0: ExpenseDetailFragment");
expenseDetailFragment = new ExpenseDetailFragment();
expenseDetailFragment.setArguments(bundle);
return expenseDetailFragment;
} else {
Log.i(TAG, "here in case 0: PendingExpenseDetailFragment");
pendingExpenseDetailFragment = new PendingExpenseDetailFragment();
pendingExpenseDetailFragment.setArguments(bundle);
return pendingExpenseDetailFragment;
}
case 1:
if (fragmentName.equals("ExpenseDetailActivity")) {
Log.i(TAG, "here in case 1: ExpenseCommentsFragment");
expenseCommentsFragment = new ExpenseCommentsFragment();
expenseCommentsFragment.setArguments(bundle);
return expenseCommentsFragment;
} else {
Log.i(TAG, "here in case 0: PendingExpenseDetailFragment");
proposedExpenseCommentsFragment = new ProposedExpenseCommentsFragment();
proposedExpenseCommentsFragment.setArguments(bundle);
return proposedExpenseCommentsFragment;
}
default:
return null;
}
}
Aggregations