当前位置: 首页>>代码示例>>Java>>正文


Java GuidedStepFragment.add方法代码示例

本文整理汇总了Java中android.support.v17.leanback.app.GuidedStepFragment.add方法的典型用法代码示例。如果您正苦于以下问题:Java GuidedStepFragment.add方法的具体用法?Java GuidedStepFragment.add怎么用?Java GuidedStepFragment.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v17.leanback.app.GuidedStepFragment的用法示例。


在下文中一共展示了GuidedStepFragment.add方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onGuidedActionClicked

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
    DvrManager dvrManager = TvApplication.getSingletons(getContext()).getDvrManager();
    long duration = mDurations.get((int) action.getId());
    long startTimeMs = System.currentTimeMillis();
    long endTimeMs = System.currentTimeMillis() + duration;
    List<ScheduledRecording> conflicts = dvrManager.getConflictingSchedules(
            mChannel.getId(), startTimeMs, endTimeMs);
    dvrManager.addSchedule(mChannel, startTimeMs, endTimeMs);
    if (conflicts.isEmpty()) {
        dismissDialog();
    } else {
        GuidedStepFragment fragment = new DvrChannelRecordConflictFragment();
        Bundle args = new Bundle();
        args.putLong(DvrHalfSizedDialogFragment.KEY_CHANNEL_ID, mChannel.getId());
        args.putLong(DvrHalfSizedDialogFragment.KEY_START_TIME_MS, startTimeMs);
        args.putLong(DvrHalfSizedDialogFragment.KEY_END_TIME_MS, endTimeMs);
        fragment.setArguments(args);
        GuidedStepFragment.add(getFragmentManager(), fragment,
                R.id.halfsized_dialog_host);
    }
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:23,代码来源:DvrChannelRecordDurationOptionFragment.java

示例2: onGuidedActionClicked

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
    FragmentManager fm = getFragmentManager();
    if (action.getId() == CONTINUE) {
        GuidedStepFragment.add(fm, new SecondStepFragment());
    } else {
        getActivity().finishAfterTransition();
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:10,代码来源:GuidedStepActivity.java

示例3: onCreateView

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.halfsized_dialog, container, false);
    GuidedStepFragment fragment = new DvrStopSeriesRecordingFragment();
    fragment.setArguments(getArguments());
    GuidedStepFragment.add(getChildFragmentManager(), fragment, R.id.halfsized_dialog_host);
    return view;
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:10,代码来源:DvrStopSeriesRecordingDialogFragment.java

示例4: onCreateView

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View view = super.onCreateView(inflater, container, savedInstanceState);
    mFragment = onCreateGuidedStepFragment();
    mFragment.setArguments(getArguments());
    mFragment.setOnActionClickListener(getOnActionClickListener());
    GuidedStepFragment.add(getChildFragmentManager(),
            mFragment, R.id.halfsized_dialog_host);
    return view;
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:12,代码来源:DvrHalfSizedDialogFragment.java

示例5: onGuidedActionClicked

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
    if (action.getId() == ACTION_RECORD_EPISODE) {
        getDvrManager().addSchedule(mProgram);
        List<ScheduledRecording> conflicts = getDvrManager().getConflictingSchedules(mProgram);
        if (conflicts.isEmpty()) {
            DvrUiHelper.showAddScheduleToast(getContext(), mProgram.getTitle(),
                    mProgram.getStartTimeUtcMillis(), mProgram.getEndTimeUtcMillis());
            dismissDialog();
        } else {
            GuidedStepFragment fragment = new DvrProgramConflictFragment();
            Bundle args = new Bundle();
            args.putParcelable(DvrHalfSizedDialogFragment.KEY_PROGRAM, mProgram);
            fragment.setArguments(args);
            GuidedStepFragment.add(getFragmentManager(), fragment,
                    R.id.halfsized_dialog_host);
        }
    } else if (action.getId() == ACTION_RECORD_SERIES) {
        SeriesRecording seriesRecording = TvApplication.getSingletons(getContext())
                .getDvrDataManager().getSeriesRecording(mProgram.getSeriesId());
        if (seriesRecording == null) {
            seriesRecording = getDvrManager().addSeriesRecording(mProgram,
                    Collections.emptyList(), SeriesRecording.STATE_SERIES_STOPPED);
        } else {
            // Reset priority to the highest.
            seriesRecording = SeriesRecording.buildFrom(seriesRecording)
                    .setPriority(TvApplication.getSingletons(getContext())
                            .getDvrScheduleManager().suggestNewSeriesPriority())
                    .build();
            getDvrManager().updateSeriesRecording(seriesRecording);
        }
        DvrUiHelper.startSeriesSettingsActivity(getContext(),
                seriesRecording.getId(), null, true, true, true);
        dismissDialog();
    }
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:37,代码来源:DvrScheduleFragment.java

示例6: onGuidedActionClicked

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
    if (action.getId() == ACTION_FORGET_STORAGE) {
        DvrForgetStorageErrorFragment fragment = new DvrForgetStorageErrorFragment();
        Bundle args = new Bundle();
        args.putString(DvrHalfSizedDialogFragment.KEY_INPUT_ID, mInputId);
        fragment.setArguments(args);
        GuidedStepFragment.add(getFragmentManager(), fragment, R.id.halfsized_dialog_host);
        return;
    }
    dismissDialog();
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:13,代码来源:DvrMissingStorageErrorFragment.java

示例7: onCreate

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (null == savedInstanceState) {
        GuidedStepFragment.add(getFragmentManager(), new PTVPreferencesFragment());
    }
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:8,代码来源:PTVPreferencesActivity.java

示例8: goToNext

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
public void goToNext(RingAccountViewModel ringAccountViewModel) {
    GuidedStepFragment next;
    if (ringAccountViewModel.isLink()) {
        next = TVRingLinkAccountFragment.newInstance((RingAccountViewModelImpl) ringAccountViewModel);
    } else {
        next = TVRingAccountCreationFragment.newInstance((RingAccountViewModelImpl) ringAccountViewModel);
    }
    GuidedStepFragment.add(getFragmentManager(), next);
}
 
开发者ID:savoirfairelinux,项目名称:ring-client-android,代码行数:11,代码来源:TVProfileCreationFragment.java

示例9: onCreate

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (null == savedInstanceState) {
        GuidedStepFragment.add(getFragmentManager(), new FirstStepFragment());
    }
}
 
开发者ID:dextorer,项目名称:BuildingForAndroidTV,代码行数:8,代码来源:GuidedStepActivity.java

示例10: onGuidedActionClicked

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
    FragmentManager fm = getFragmentManager();
    if (action.getId() == CONTINUE) {
        GuidedStepFragment.add(fm, new SecondStepFragment());
    } else {
        getActivity().finish();
    }
}
 
开发者ID:dextorer,项目名称:BuildingForAndroidTV,代码行数:10,代码来源:GuidedStepActivity.java

示例11: onGuidedActionClicked

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
    long actionId = action.getId();
    if (actionId == GuidedAction.ACTION_ID_OK) {
        if (mEpisodicProgramLoadTask != null) {
            mEpisodicProgramLoadTask.cancel(true);
            mEpisodicProgramLoadTask = null;
        }
        if (mChannelOption != mSeriesRecording.getChannelOption()
                || mSeriesRecording.isStopped()
                || (mChannelOption == SeriesRecording.OPTION_CHANNEL_ONE
                        && mSeriesRecording.getChannelId() != mSelectedChannelId)) {
            SeriesRecording.Builder builder = SeriesRecording.buildFrom(mSeriesRecording)
                    .setChannelOption(mChannelOption)
                    .setState(SeriesRecording.STATE_SERIES_NORMAL);
            if (mSelectedChannelId != Channel.INVALID_ID) {
                builder.setChannelId(mSelectedChannelId);
            }
            TvApplication.getSingletons(getContext()).getDvrManager()
                    .updateSeriesRecording(builder.build());
            SeriesRecordingScheduler scheduler =
                    SeriesRecordingScheduler.getInstance(getContext());
            // Since dialog is used even after the fragment is closed, we should
            // use application context.
            ProgressDialog dialog = ProgressDialog.show(getContext(), null, getString(
                            R.string.dvr_series_schedules_progress_message_updating_programs));
            scheduler.addOnSeriesRecordingUpdatedListener(
                    new OnSeriesRecordingUpdatedListener() {
                @Override
                public void onSeriesRecordingUpdated(SeriesRecording... seriesRecordings) {
                    for (SeriesRecording seriesRecording : seriesRecordings) {
                        if (seriesRecording.getId() == mSeriesRecordingId) {
                            dialog.dismiss();
                            scheduler.removeOnSeriesRecordingUpdatedListener(this);
                            showConfirmDialog();
                            return;
                        }
                    }
                }
            });
        } else {
            showConfirmDialog();
        }
    } else if (actionId == GuidedAction.ACTION_ID_CANCEL) {
        finishGuidedStepFragments();
    } else if (actionId == ACTION_ID_PRIORITY) {
        FragmentManager fragmentManager = getFragmentManager();
        PrioritySettingsFragment fragment = new PrioritySettingsFragment();
        Bundle args = new Bundle();
        args.putLong(PrioritySettingsFragment.COME_FROM_SERIES_RECORDING_ID,
                mSeriesRecording.getId());
        fragment.setArguments(args);
        GuidedStepFragment.add(fragmentManager, fragment, R.id.dvr_settings_view_frame);
    }
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:56,代码来源:SeriesSettingsFragment.java

示例12: showExportDialog

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
public void showExportDialog(String pAccountID) {
    GuidedStepFragment wizard = TVAccountExport.createInstance(pAccountID);
    GuidedStepFragment.add(getFragmentManager(), wizard, R.id.main_browse_fragment);
}
 
开发者ID:savoirfairelinux,项目名称:ring-client-android,代码行数:6,代码来源:MainFragment.java

示例13: goToAccountCreation

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
public void goToAccountCreation() {
    RingAccountViewModelImpl ringAccountViewModel = new RingAccountViewModelImpl();
    ringAccountViewModel.setLink(false);
    GuidedStepFragment.add(getFragmentManager(), TVProfileCreationFragment.newInstance(ringAccountViewModel));
}
 
开发者ID:savoirfairelinux,项目名称:ring-client-android,代码行数:7,代码来源:TVHomeAccountCreationFragment.java

示例14: goToAccountLink

import android.support.v17.leanback.app.GuidedStepFragment; //导入方法依赖的package包/类
@Override
public void goToAccountLink() {
    RingAccountViewModelImpl ringAccountViewModel = new RingAccountViewModelImpl();
    ringAccountViewModel.setLink(true);
    GuidedStepFragment.add(getFragmentManager(), TVProfileCreationFragment.newInstance(ringAccountViewModel));
}
 
开发者ID:savoirfairelinux,项目名称:ring-client-android,代码行数:7,代码来源:TVHomeAccountCreationFragment.java


注:本文中的android.support.v17.leanback.app.GuidedStepFragment.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。