Search in sources :

Example 1 with VisualVoicemailCallLogFragment

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

Aggregations

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