android.support.v17.leanback.app.GuidedStepFragment Java Examples

The following examples show how to use android.support.v17.leanback.app.GuidedStepFragment. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WizardExample2ndStepFragment.java    From leanback-showcase with Apache License 2.0 6 votes vote down vote up
@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;
    }
}
 
Example #2
Source File: DialogExampleActivity.java    From leanback-showcase with Apache License 2.0 5 votes vote down vote up
@Override public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#21272A")));

    if (savedInstanceState == null) {
        GuidedStepFragment fragment = new DialogExampleFragment();
        GuidedStepFragment.addAsRoot(this, fragment, android.R.id.content);
    }
}
 
Example #3
Source File: WizardExample2ndStepFragment.java    From leanback-showcase with Apache License 2.0 5 votes vote down vote up
public static GuidedStepFragment build(boolean hd, WizardExampleBaseStepFragment previousFragment) {
    GuidedStepFragment fragment = new WizardExample2ndStepFragment();
    // Reuse the same arguments this fragment was given.
    Bundle args = previousFragment.getArguments();
    args.putBoolean(ARG_HD, hd);
    fragment.setArguments(args);
    return fragment;
}
 
Example #4
Source File: WizardExample2ndStepFragment.java    From leanback-showcase with Apache License 2.0 5 votes vote down vote up
@Override
public void onGuidedActionClicked(GuidedAction action) {
    if (ACTION_ID_CONFIRM == action.getId()) {
        GuidedStepFragment fragment = new WizardExample3rdStepFragment();
        fragment.setArguments(getArguments());
        add(getFragmentManager(), fragment);
    }
}
 
Example #5
Source File: WizardExampleActivity.java    From leanback-showcase with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setBackgroundDrawableResource(R.drawable.wizard_background_blackned);

    GuidedStepFragment fragment = new WizardExample1stStepFragment();
    fragment.setArguments(getIntent().getExtras()); // Delegate Movie to first step.
    GuidedStepFragment.addAsRoot(this, fragment, android.R.id.content);
}
 
Example #6
Source File: WizardExampleActivity.java    From leanback-showcase with Apache License 2.0 5 votes vote down vote up
@Override
public void onBackPressed() {
    if (GuidedStepFragment.getCurrentGuidedStepFragment(getFragmentManager())
            instanceof WizardExample4thStepFragment) {
        // The user 'bought' the product. When he presses 'Back' the Wizard will be closed and
        // he will not be send back to 'Processing Payment...'-Screen.
        finish();
    } else super.onBackPressed();
}
 
Example #7
Source File: ChannelPublishActivity.java    From leanback-showcase with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (null == savedInstanceState) {
        GuidedStepFragment.addAsRoot(this, new PublishChannelFragment(), android.R.id.content);
    }
}
 
Example #8
Source File: RichTvInputSetupActivity.java    From androidtv-sample-inputs with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (null == savedInstanceState) {
        GuidedStepFragment.addAsRoot(this, new FirstStepFragment(), android.R.id.content);
    }
}
 
Example #9
Source File: FirstStepFragment.java    From androidtv-sample-inputs with Apache License 2.0 5 votes vote down vote up
@Override
public void onGuidedActionClicked(GuidedAction action) {
    if (action.getId() == GuidedAction.ACTION_ID_NEXT) {
        GuidedStepFragment.add(getFragmentManager(), new RichSetupFragment());
    } else if (action.getId() == GuidedAction.ACTION_ID_CANCEL) {
        getActivity().setResult(Activity.RESULT_CANCELED);
        getActivity().finishAfterTransition();
    }
}
 
Example #10
Source File: GuidedStepActivity.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (null == savedInstanceState) {
        GuidedStepFragment.add(getFragmentManager(), new FirstStepFragment());
    }
}
 
Example #11
Source File: GuidedStepActivity.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
@Override
public void onGuidedActionClicked(GuidedAction action) {
    FragmentManager fm = getFragmentManager();
    if (action.getId() == CONTINUE) {
        GuidedStepFragment.add(fm, new SecondStepFragment());
    } else {
        getActivity().finish();
    }
}
 
Example #12
Source File: WizardExample1stStepFragment.java    From leanback-showcase with Apache License 2.0 4 votes vote down vote up
@Override
public void onGuidedActionClicked(GuidedAction action) {
    boolean rentHd = ACTION_ID_BUY_HD == action.getId();
    GuidedStepFragment fragment = WizardExample2ndStepFragment.build(rentHd, this);
    add(getFragmentManager(), fragment);
}
 
Example #13
Source File: WizardExample3rdStepFragment.java    From leanback-showcase with Apache License 2.0 4 votes vote down vote up
@Override
public void run() {
    GuidedStepFragment fragment = new WizardExample4thStepFragment();
    fragment.setArguments(getArguments());
    add(getFragmentManager(), fragment);
}
 
Example #14
Source File: GuidedStepActivity.java    From BuildingForAndroidTV with MIT License 4 votes vote down vote up
@Override
public void onGuidedActionClicked(GuidedAction action) {
    FragmentManager fm = getFragmentManager();
    GuidedStepFragment.add(fm, new ThirdStepFragment(getSelectedActionPosition()-1));
}