Java Code Examples for android.support.v17.leanback.widget.GuidedAction#getId()
The following examples show how to use
android.support.v17.leanback.widget.GuidedAction#getId() .
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: SettingsActivity.java From alltv with MIT License | 6 votes |
@Override public boolean onSubGuidedActionClicked(GuidedAction action) { if (action.getId() == GuidedId.PooqMobile.ordinal()) { mSettings.mPooqSettings.mQualityType = SettingsData.PooqQualityType.Mobile; } else if (action.getId() == GuidedId.PooqSD.ordinal()) { mSettings.mPooqSettings.mQualityType = SettingsData.PooqQualityType.SD; } else if (action.getId() == GuidedId.PooqHD.ordinal()) { mSettings.mPooqSettings.mQualityType = SettingsData.PooqQualityType.HD; } else if (action.getId() == GuidedId.PooqFHD.ordinal()) { mSettings.mPooqSettings.mQualityType = SettingsData.PooqQualityType.FHD; } Utils.showToast(getContext(), mSettings.mPooqSettings.mQualityType.toString() + " " + getStringById(R.string.select)); return true; }
Example 2
Source File: SettingsActivity.java From alltv with MIT License | 6 votes |
@Override public boolean onSubGuidedActionClicked(GuidedAction action) { if (action.getId() == GuidedId.TvingMD.ordinal()) { mSettings.mTvingSettings.mQualityType = SettingsData.TvingQualityType.MD; } else if (action.getId() == GuidedId.TvingSD.ordinal()) { mSettings.mTvingSettings.mQualityType = SettingsData.TvingQualityType.SD; } else if (action.getId() == GuidedId.TvingHD.ordinal()) { mSettings.mTvingSettings.mQualityType = SettingsData.TvingQualityType.HD; } else if (action.getId() == GuidedId.TvingFHD.ordinal()) { mSettings.mTvingSettings.mQualityType = SettingsData.TvingQualityType.FHD; } Utils.showToast(getContext(), mSettings.mTvingSettings.mQualityType.toString() + " " + getStringById(R.string.select)); return true; }
Example 3
Source File: SettingsActivity.java From alltv with MIT License | 6 votes |
@Override public boolean onSubGuidedActionClicked(GuidedAction action) { if (action.getId() == GuidedId.OksusuAuto.ordinal()) { mSettings.mOksusuSettings.mQualityType = SettingsData.OksusuQualityType.AUTO; } else if (action.getId() == GuidedId.OksusuFullHd.ordinal()) { mSettings.mOksusuSettings.mQualityType = SettingsData.OksusuQualityType.FullHD; } else if (action.getId() == GuidedId.OksusuHd.ordinal()) { mSettings.mOksusuSettings.mQualityType = SettingsData.OksusuQualityType.HD; } else if (action.getId() == GuidedId.OksusuSd.ordinal()) { mSettings.mOksusuSettings.mQualityType = SettingsData.OksusuQualityType.SD; } Utils.showToast(getContext(), mSettings.mOksusuSettings.mQualityType.toString() + " " + getStringById(R.string.select)); return true; }
Example 4
Source File: SettingsActivity.java From alltv with MIT License | 5 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { if (action.getId() == GuidedId.PooqSave.ordinal()) { Boolean enable = findActionById(GuidedId.PooqEnable.ordinal()).isChecked(); String id = findActionById(GuidedId.PooqId.ordinal()).getDescription().toString(); String password = findActionById(GuidedId.PooqPw.ordinal()).getEditDescription().toString(); if (id == null || id.length() == 0 || password == null || password.length() == 0) { Utils.showToast(getContext(), R.string.input_error); return; } mSettings.mPooqSettings.mEnable = enable; mSettings.mPooqSettings.mId = id; mSettings.mPooqSettings.mPassword = password; if (mSettings.mPooqSettings.mQualityType == null) mSettings.mPooqSettings.mQualityType = SettingsData.PooqQualityType.Mobile; Intent intent = new Intent(); Gson gson = new Gson(); String myJson = gson.toJson(mSettings); intent.putExtra(getStringById(R.string.SETTINGSDATA_STR), myJson); getActivity().setResult(Utils.Code.PooqSave.ordinal(), intent); getActivity().finishAfterTransition(); } }
Example 5
Source File: GuidedStepActivity.java From BuildingForAndroidTV with MIT License | 5 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { if (action.getId() == CONTINUE) { getActivity().finish(); } else { getFragmentManager().popBackStack(); } }
Example 6
Source File: GuidedStepActivity.java From BuildingForAndroidTV with MIT License | 5 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { FragmentManager fm = getFragmentManager(); if (action.getId() == CONTINUE) { GuidedStepFragment.add(fm, new SecondStepFragment()); } else { getActivity().finish(); } }
Example 7
Source File: ChannelSetupStepSupportFragment.java From androidtv-sample-inputs with Apache License 2.0 | 5 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { if (action.getId() == GuidedAction.ACTION_ID_FINISH) { getActivity().setResult(Activity.RESULT_OK); finishGuidedStepSupportFragments(); } else if (action.getId() == GuidedAction.ACTION_ID_CANCEL) { getActivity().setResult(Activity.RESULT_CANCELED); getActivity().finishAfterTransition(); } else { Log.w(TAG, "Unexpected action " + action); } }
Example 8
Source File: ChannelSetupStepFragment.java From androidtv-sample-inputs with Apache License 2.0 | 5 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { if (action.getId() == GuidedAction.ACTION_ID_FINISH) { getActivity().setResult(Activity.RESULT_OK); finishGuidedStepFragments(); } else if (action.getId() == GuidedAction.ACTION_ID_CANCEL) { getActivity().setResult(Activity.RESULT_CANCELED); getActivity().finishAfterTransition(); } else { Log.w(TAG, "Unexpected action " + action); } }
Example 9
Source File: FirstStepFragment.java From androidtv-sample-inputs with Apache License 2.0 | 5 votes |
@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: PublishChannelFragment.java From leanback-showcase with Apache License 2.0 | 5 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { /** * Find channel through action ID */ int currentId = (int) action.getId(); mSelectedChannelContents = mChannelContents.get(currentId); /** * When the action cannot select valid mediaItem, just return from from this function */ if (mSelectedChannelContents == null) { return; } /** * Add/ Remove channel from Home Screen using Async task * to make sure the UI thread will not be blocked */ if (action.isChecked()) { /** * Create and execute the async task to add channel on home screen * Always update publish status through LoadAddedChannels task */ new ChannelContents.CreateChannelInMainScreen(getActivity()).execute(mSelectedChannelContents); } else { Toast.makeText(this.getActivity(), getResources().getString(R.string.channel_removed_from_home_screen), Toast.LENGTH_SHORT).show(); /** * Create and execute the async task to remove channel on home screen * Always update publish status through LoadAddedChannels task */ new ChannelContents.RemoveChannelInMainScreen(getActivity()).execute(mSelectedChannelContents); } }
Example 11
Source File: WizardNewPaymentStepFragment.java From leanback-showcase with Apache License 2.0 | 5 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { if (action.getId() == GuidedAction.ACTION_ID_OK) { CharSequence cardNumber = findActionById(ACTION_ID_CARD_NUMBER).getDescription(); WizardExample2ndStepFragment.sSelectedCard = WizardExample2ndStepFragment.sCards.size(); WizardExample2ndStepFragment.sCards.add(cardNumber.toString()); popBackStackToGuidedStepFragment(WizardNewPaymentStepFragment.class, FragmentManager.POP_BACK_STACK_INCLUSIVE); } }
Example 12
Source File: WizardExample4thStepFragment.java From leanback-showcase with Apache License 2.0 | 5 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { Intent returnIntent = new Intent(); if (ACTION_ID_WATCH == action.getId()) { Toast.makeText(getActivity(), getString(R.string.wizard_example_watch_now_clicked), Toast.LENGTH_SHORT).show(); returnIntent.putExtra(WizardExampleActivity.WATCH_NOW, true); } getActivity().setResult(Activity.RESULT_OK, returnIntent); getActivity().finish(); }
Example 13
Source File: WizardExample2ndStepFragment.java From leanback-showcase with Apache License 2.0 | 5 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { if (ACTION_ID_CONFIRM == action.getId()) { GuidedStepFragment fragment = new WizardExample3rdStepFragment(); fragment.setArguments(getArguments()); add(getFragmentManager(), fragment); } }
Example 14
Source File: DialogExampleFragment.java From leanback-showcase with Apache License 2.0 | 5 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { if (ACTION_ID_POSITIVE == action.getId()) { Toast.makeText(getActivity(), R.string.dialog_example_button_toast_positive_clicked, Toast.LENGTH_SHORT).show(); } else { Toast.makeText(getActivity(), R.string.dialog_example_button_toast_negative_clicked, Toast.LENGTH_SHORT).show(); } getActivity().finish(); }
Example 15
Source File: SettingsActivity.java From alltv with MIT License | 5 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { if (action.getId() == GuidedId.OksusuSave.ordinal()) { Boolean enable = findActionById(GuidedId.OksusuEnable.ordinal()).isChecked(); String id = findActionById(GuidedId.OksusuId.ordinal()).getDescription().toString(); String password = findActionById(GuidedId.OksusuPw.ordinal()).getEditDescription().toString(); if (id == null || id.length() == 0 || password == null || password.length() == 0) { Utils.showToast(getContext(), R.string.input_error); return; } mSettings.mOksusuSettings.mEnable = enable; mSettings.mOksusuSettings.mId = id; mSettings.mOksusuSettings.mPassword = password; if (mSettings.mOksusuSettings.mQualityType == null) mSettings.mOksusuSettings.mQualityType = SettingsData.OksusuQualityType.AUTO; Intent intent = new Intent(); Gson gson = new Gson(); String myJson = gson.toJson(mSettings); intent.putExtra(getStringById(R.string.SETTINGSDATA_STR), myJson); getActivity().setResult(Utils.Code.OksusuSave.ordinal(), intent); getActivity().finishAfterTransition(); } }
Example 16
Source File: SettingsActivity.java From alltv with MIT License | 5 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { if (action.getId() == GuidedId.TvingSave.ordinal()) { Boolean enable = findActionById(GuidedId.TvingEnable.ordinal()).isChecked(); Boolean cjoneid = findActionById(GuidedId.TvingCjOneId.ordinal()).isChecked(); String id = findActionById(GuidedId.TvingId.ordinal()).getDescription().toString(); String password = findActionById(GuidedId.TvingPw.ordinal()).getEditDescription().toString(); if (id == null || id.length() == 0 || password == null || password.length() == 0) { Utils.showToast(getContext(), R.string.input_error); return; } mSettings.mTvingSettings.mEnable = enable; mSettings.mTvingSettings.mId = id; mSettings.mTvingSettings.mPassword = password; mSettings.mTvingSettings.mCJOneId = cjoneid; if (mSettings.mTvingSettings.mQualityType == null) mSettings.mTvingSettings.mQualityType = SettingsData.TvingQualityType.SD; Intent intent = new Intent(); Gson gson = new Gson(); String myJson = gson.toJson(mSettings); intent.putExtra(getStringById(R.string.SETTINGSDATA_STR), myJson); getActivity().setResult(Utils.Code.TvingSave.ordinal(), intent); getActivity().finishAfterTransition(); } }
Example 17
Source File: SettingsActivity.java From alltv with MIT License | 5 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { FragmentManager fm = getFragmentManager(); if (action.getId() == GuidedId.Pooq.ordinal()) { GuidedStepSupportFragment.add(fm, new PooqStepFragment()); } else if (action.getId() == GuidedId.Tving.ordinal()) { GuidedStepSupportFragment.add(fm, new TvingStepFragment()); } else if (action.getId() == GuidedId.Oksusu.ordinal()) { GuidedStepSupportFragment.add(fm, new OksusuStepFragment()); } }
Example 18
Source File: WizardNewPaymentStepFragment.java From leanback-showcase with Apache License 2.0 | 4 votes |
@Override public long onGuidedActionEditedAndProceed(GuidedAction action) { boolean cardNumberCheck = false; boolean expDateCheck = false; if (action.getId() == ACTION_ID_CARD_NUMBER) { CharSequence cardNumber = action.getEditTitle(); cardNumberCheck = isCardNumberValid(cardNumber); expDateCheck = isExpDateValid(findActionById(ACTION_ID_PAYMENT_EXP)); updateOkButton(cardNumberCheck && expDateCheck); if (cardNumberCheck) { String last4Digits = cardNumber.subSequence(cardNumber.length() - 4, cardNumber.length()).toString(); if ( (Integer.parseInt(last4Digits) & 1) == 0 ) action.setDescription(getString(R.string.wizard_example_visa, last4Digits)); else action.setDescription(getString(R.string.wizard_example_master, last4Digits)); return GuidedAction.ACTION_ID_NEXT; } else if (cardNumber.length() == 0) { action.setDescription(getString(R.string.wizard_example_input_card)); return GuidedAction.ACTION_ID_CURRENT; } else { action.setDescription(getString(R.string.wizard_example_input_credit_wrong)); return GuidedAction.ACTION_ID_CURRENT; } } else if (action.getId() == ACTION_ID_PAYMENT_EXP) { expDateCheck = isExpDateValid(action); cardNumberCheck = isCardNumberValid(findActionById(ACTION_ID_CARD_NUMBER) .getEditTitle()); updateOkButton(cardNumberCheck && expDateCheck); if (expDateCheck) { return GuidedAction.ACTION_ID_NEXT; } } return GuidedAction.ACTION_ID_CURRENT; }
Example 19
Source File: WizardExample1stStepFragment.java From leanback-showcase with Apache License 2.0 | 4 votes |
@Override public void onGuidedActionClicked(GuidedAction action) { boolean rentHd = ACTION_ID_BUY_HD == action.getId(); GuidedStepFragment fragment = WizardExample2ndStepFragment.build(rentHd, this); add(getFragmentManager(), fragment); }