Search in sources :

Example 1 with SpeedDialFragment

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;
}
Also used : NewCallLogFragment(com.android.dialer.calllog.ui.NewCallLogFragment) SpeedDialFragment(com.android.dialer.speeddial.SpeedDialFragment) VisualVoicemailCallLogFragment(com.android.dialer.app.calllog.VisualVoicemailCallLogFragment) CallLogFragment(com.android.dialer.app.calllog.CallLogFragment) NewCallLogFragment(com.android.dialer.calllog.ui.NewCallLogFragment) Fragment(android.app.Fragment) ContactsFragment(com.android.dialer.contactsfragment.ContactsFragment) VisualVoicemailCallLogFragment(com.android.dialer.app.calllog.VisualVoicemailCallLogFragment) CallLogFragment(com.android.dialer.app.calllog.CallLogFragment) NewCallLogFragment(com.android.dialer.calllog.ui.NewCallLogFragment) SpeedDialFragment(com.android.dialer.speeddial.SpeedDialFragment) ContactsFragment(com.android.dialer.contactsfragment.ContactsFragment)

Aggregations

Fragment (android.app.Fragment)1 CallLogFragment (com.android.dialer.app.calllog.CallLogFragment)1 VisualVoicemailCallLogFragment (com.android.dialer.app.calllog.VisualVoicemailCallLogFragment)1 NewCallLogFragment (com.android.dialer.calllog.ui.NewCallLogFragment)1 ContactsFragment (com.android.dialer.contactsfragment.ContactsFragment)1 SpeedDialFragment (com.android.dialer.speeddial.SpeedDialFragment)1