use of com.android.dialer.speeddial.SpeedDialFragment in project android_packages_apps_Dialer by LineageOS.
the class DialtactsPagerAdapter method instantiateItem.
@Override
public Fragment instantiateItem(ViewGroup container, int position) {
LogUtil.d("ViewPagerAdapter.instantiateItem", "position: %d", position);
// On rotation the FragmentManager handles rotation. Therefore getItem() isn't called.
// Copy the fragments that the FragmentManager finds so that we can store them in
// instance variables for later.
final Fragment fragment = (Fragment) super.instantiateItem(container, position);
if (fragment instanceof OldSpeedDialFragment) {
oldSpeedDialFragment = (OldSpeedDialFragment) fragment;
} else if (fragment instanceof SpeedDialFragment) {
speedDialFragment = (SpeedDialFragment) fragment;
} else if (fragment instanceof CallLogFragment && position == TAB_INDEX_HISTORY) {
callLogFragment = (CallLogFragment) fragment;
} else if (fragment instanceof NewCallLogFragment) {
newCallLogFragment = (NewCallLogFragment) fragment;
} else if (fragment instanceof ContactsFragment) {
contactsFragment = (ContactsFragment) fragment;
} else if (fragment instanceof AllContactsFragment) {
oldContactsFragment = (AllContactsFragment) fragment;
} else if (fragment instanceof CallLogFragment && position == TAB_INDEX_VOICEMAIL) {
voicemailFragment = (CallLogFragment) fragment;
LogUtil.v("ViewPagerAdapter.instantiateItem", voicemailFragment.toString());
}
fragments.set(position, fragment);
return fragment;
}
Aggregations