use of com.android.dialer.app.calllog.VisualVoicemailCallLogFragment in project android_packages_apps_Dialer by LineageOS.
the class DialtactsPagerAdapter method getItem.
@Override
public Fragment getItem(int position) {
LogUtil.d("ViewPagerAdapter.getItem", "position: %d", position);
switch(getRtlPosition(position)) {
case TAB_INDEX_SPEED_DIAL:
if (useNewSpeedDialTab) {
if (speedDialFragment == null) {
speedDialFragment = SpeedDialFragment.newInstance();
}
return speedDialFragment;
} else {
if (oldSpeedDialFragment == null) {
oldSpeedDialFragment = new OldSpeedDialFragment();
}
return oldSpeedDialFragment;
}
case TAB_INDEX_HISTORY:
if (useNewCallLogTab) {
if (newCallLogFragment == null) {
newCallLogFragment = new NewCallLogFragment();
}
return newCallLogFragment;
} else {
if (callLogFragment == null) {
callLogFragment = new CallLogFragment(CallLogQueryHandler.CALL_TYPE_ALL);
}
return callLogFragment;
}
case TAB_INDEX_ALL_CONTACTS:
if (useNewContactsTab) {
if (contactsFragment == null) {
contactsFragment = new ContactsFragment();
}
return contactsFragment;
} else {
if (oldContactsFragment == null) {
oldContactsFragment = new AllContactsFragment();
}
return oldContactsFragment;
}
case TAB_INDEX_VOICEMAIL:
if (voicemailFragment == null) {
voicemailFragment = new VisualVoicemailCallLogFragment();
LogUtil.v("ViewPagerAdapter.getItem", "new VisualVoicemailCallLogFragment: %s", voicemailFragment);
}
return voicemailFragment;
default:
throw Assert.createIllegalStateFailException("No fragment at position " + position);
}
}
Aggregations