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


Java GuidedStepFragment类代码示例

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


GuidedStepFragment类属于android.support.v17.leanback.app包,在下文中一共展示了GuidedStepFragment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: onSubGuidedActionClicked

import android.support.v17.leanback.app.GuidedStepFragment; //导入依赖的package包/类
@Override
public boolean onSubGuidedActionClicked(GuidedAction action) {

    if (action.isChecked()) {
        String payment = action.getTitle().toString();
        if ( (sSelectedCard = sCards.indexOf(payment)) != -1 ) {
            findActionById(ACTION_ID_PAYMENT_METHOD).setDescription(payment);
            notifyActionChanged(findActionPositionById(ACTION_ID_PAYMENT_METHOD));
            findActionById(ACTION_ID_CONFIRM).setEnabled(true);
            notifyActionChanged(findActionPositionById(ACTION_ID_CONFIRM));
        }
        return true;
    } else {
        FragmentManager fm = getFragmentManager();
        GuidedStepFragment fragment = new WizardNewPaymentStepFragment();
        fragment.setArguments(getArguments());
        add(fm, fragment);
        return false;
    }
}
 
开发者ID:googlesamples,项目名称:leanback-showcase,代码行数:21,代码来源:WizardExample2ndStepFragment.java

示例3: onCreate

import android.support.v17.leanback.app.GuidedStepFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (null == savedInstanceState) {
        GuidedStepFragment.addAsRoot(this, new FirstStepFragment(), android.R.id.content);
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:8,代码来源:AuthenticationActivity.java

示例4: 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

示例5: onCreate

import android.support.v17.leanback.app.GuidedStepFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (savedInstanceState==null) {
        // One hour lost to find out the fucking weirdo way how to do this, i hate you leanback tream!
        GuidedStepFragment firstFragment = new RescanFragment();
        GuidedStepFragment.addAsRoot(this, firstFragment,android.R.id.content);
    }
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:10,代码来源:RescanActivity.java

示例6: Overlay

import android.support.v17.leanback.app.GuidedStepFragment; //导入依赖的package包/类
/**
 * Must be created from the Fragment onViewCreated() method
 * @param fragment
 */
public Overlay(Fragment fragment) {

    if (!fragment.isAdded()) {
        throw new IllegalStateException("Overlay must be created once the fragment is added!");
    }

    mContext = fragment.getActivity();
    ViewGroup fragmentView = (ViewGroup)fragment.getView();
    if (fragmentView==null) {
        throw new IllegalStateException("Overlay must be created once the fragment has its view created!");
    }

    int parentViewId = -1;
    if (fragment instanceof BrowseFragment) {
        parentViewId = R.id.browse_frame;
    } else if (fragment instanceof MyVerticalGridFragment) {
        parentViewId = R.id.browse_dummy;
    } else if (fragment instanceof DetailsFragment) {
        parentViewId = R.id.details_fragment_root;
    } else if (fragment instanceof GuidedStepFragment) {
        parentViewId = R.id.guidedstep_background_view_root;
    } else {
        throw new IllegalStateException("Overlay is not compatible with this fragment: "+fragment);
    }

    ViewGroup parentView = (ViewGroup)fragmentView.findViewById(parentViewId);
    if (parentView==null) {
        throw new IllegalStateException("parentView not found! Maybe IDs in the leanback library have been changed?");
    }

    LayoutInflater.from(mContext).inflate(R.layout.leanback_overlay, parentView);
    mOverlayRoot = parentView.findViewById(R.id.overlay_root);
    mScanProgress = new ScannerAndScraperProgress(mContext, mOverlayRoot);
    mClock = new Clock(mContext, mOverlayRoot);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:40,代码来源:Overlay.java

示例7: onListGrab

import android.support.v17.leanback.app.GuidedStepFragment; //导入依赖的package包/类
@Override
public void onListGrab(List<ListElem> output, String t, String st, Video v) {
    lists = output;
    title = t;
    subtitle = st;
    video = v;
    GuidedStepFragment.addAsRoot(this, new FirstStepFragment(), android.R.id.content);
}
 
开发者ID:ad-on-is,项目名称:chilly,代码行数:9,代码来源:ListSelectActivity.java

示例8: 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

示例9: 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

示例10: onCreate

import android.support.v17.leanback.app.GuidedStepFragment; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    TvApplication.setCurrentRunningProcess(this, true);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_dvr_series_settings);
    long seriesRecordingId = getIntent().getLongExtra(SERIES_RECORDING_ID, -1);
    SoftPreconditions.checkArgument(seriesRecordingId != -1);

    if (savedInstanceState == null) {
        SeriesSettingsFragment settingFragment = new SeriesSettingsFragment();
        settingFragment.setArguments(getIntent().getExtras());
        GuidedStepFragment.addAsRoot(this, settingFragment, R.id.dvr_settings_view_frame);
    }
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:15,代码来源:DvrSeriesSettingsActivity.java

示例11: 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

示例12: onCreate

import android.support.v17.leanback.app.GuidedStepFragment; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.halfsized_dialog);
    if (savedInstanceState == null) {
        DvrSeriesScheduledFragment dvrSeriesScheduledFragment =
                new DvrSeriesScheduledFragment();
        dvrSeriesScheduledFragment.setArguments(getIntent().getExtras());
        GuidedStepFragment.addAsRoot(this, dvrSeriesScheduledFragment,
                R.id.halfsized_dialog_host);
    }
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:13,代码来源:DvrSeriesScheduledDialogActivity.java

示例13: onCreate

import android.support.v17.leanback.app.GuidedStepFragment; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    TvApplication.setCurrentRunningProcess(this, true);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_dvr_series_settings);
    // Check savedInstanceState to prevent that activity is being showed with animation.
    if (savedInstanceState == null) {
        SeriesDeletionFragment deletionFragment = new SeriesDeletionFragment();
        deletionFragment.setArguments(getIntent().getExtras());
        GuidedStepFragment.addAsRoot(this, deletionFragment, R.id.dvr_settings_view_frame);
    }
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:13,代码来源:DvrSeriesDeletionActivity.java

示例14: 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

示例15: 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


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