本文整理汇总了Java中android.support.v17.leanback.widget.GuidedAction.getId方法的典型用法代码示例。如果您正苦于以下问题:Java GuidedAction.getId方法的具体用法?Java GuidedAction.getId怎么用?Java GuidedAction.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v17.leanback.widget.GuidedAction
的用法示例。
在下文中一共展示了GuidedAction.getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onGuidedActionClicked
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
if(action.getId()==MANUAL_RESCAN_ID){
NetworkAutoRefresh.forceRescan(getActivity());
}
if(action.getId()==LAST_RESCAN_ID){
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setMessage(R.string.rescan_error_wifi_info_standby).setPositiveButton(android.R.string.ok, null);
builder.create().show();
}
else if (action.getId()==SCHEDULED_RESCAN_PERIOD_ID) {
add(getFragmentManager(), new ScheduledRescanPeriod());
}
else if (action.getId()==RESCAN_WHEN_OPENING_ID) {
add(getFragmentManager(), new RescanWhenOpeningApplication());
}
}
示例2: onGuidedActionClicked
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
if (action.getId() != ACTION_FORGET_STORAGE) {
dismissDialog();
return;
}
DvrManager dvrManager = TvApplication.getSingletons(getContext()).getDvrManager();
dvrManager.forgetStorage(mInputId);
Activity activity = getActivity();
if (activity instanceof DvrDetailsActivity) {
// Since we removed everything, just finish the activity.
activity.finish();
} else {
dismissDialog();
}
}
示例3: onGuidedActionClicked
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
if (action.getId() == ACTION_STOP_SERIES_RECORDING) {
ApplicationSingletons singletons = TvApplication.getSingletons(getContext());
DvrManager dvrManager = singletons.getDvrManager();
DvrDataManager dataManager = singletons.getDvrDataManager();
List<ScheduledRecording> toDelete = new ArrayList<>();
for (ScheduledRecording r : dataManager.getAvailableScheduledRecordings()) {
if (r.getSeriesRecordingId() == mSeriesRecording.getId()) {
if (r.getState() == ScheduledRecording.STATE_RECORDING_NOT_STARTED) {
toDelete.add(r);
} else {
dvrManager.stopRecording(r);
}
}
}
if (!toDelete.isEmpty()) {
dvrManager.forceRemoveScheduledRecording(ScheduledRecording.toArray(toDelete));
}
dvrManager.updateSeriesRecording(SeriesRecording.buildFrom(mSeriesRecording)
.setState(SeriesRecording.STATE_SERIES_STOPPED).build());
}
dismissDialog();
}
示例4: onGuidedActionFocused
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public void onGuidedActionFocused(GuidedAction action) {
super.onGuidedActionFocused(action);
if (mSelectedRecording == null) {
return;
}
if (action.getId() < 0) {
int selectedPosition = mSeriesRecordings.indexOf(mSelectedRecording);
mSelectedRecording = null;
for (int i = 0; i < mSeriesRecordings.size(); ++i) {
updateItem(i);
}
return;
}
int position = (int) action.getId();
int previousPosition = mSeriesRecordings.indexOf(mSelectedRecording);
mSeriesRecordings.remove(mSelectedRecording);
mSeriesRecordings.add(position, mSelectedRecording);
updateItem(previousPosition);
updateItem(position);
notifyActionChanged(previousPosition);
notifyActionChanged(position);
}
示例5: onSubGuidedActionClicked
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public boolean onSubGuidedActionClicked(GuidedAction action) {
long actionId = action.getId();
if (actionId == SUB_ACTION_ID_CHANNEL_ALL) {
mChannelOption = SeriesRecording.OPTION_CHANNEL_ALL;
mSelectedChannelId = Channel.INVALID_ID;
updateChannelsGuidedAction(true);
return true;
} else if (actionId > SUB_ACTION_ID_CHANNEL_ONE_BASE) {
mChannelOption = SeriesRecording.OPTION_CHANNEL_ONE;
mSelectedChannelId = actionId - SUB_ACTION_ID_CHANNEL_ONE_BASE;
updateChannelsGuidedAction(true);
return true;
}
return false;
}
示例6: onGuidedActionClicked
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
if (action.getId() == ACTION_CANCEL) {
ConflictChecker checker = ((MainActivity) getContext()).getDvrConflictChecker();
if (checker != null) {
checker.setCheckedConflictsForChannel(mChannelId, getConflicts());
}
} else if (action.getId() == ACTION_DELETE_CONFLICT) {
for (ScheduledRecording schedule : mConflicts) {
if (schedule.getState() == ScheduledRecording.STATE_RECORDING_IN_PROGRESS) {
getDvrManager().stopRecording(schedule);
} else {
getDvrManager().removeScheduledRecording(schedule);
}
}
}
super.onGuidedActionClicked(action);
}
示例7: onGuidedActionClicked
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
switch ((int) action.getId()) {
case R.id.action_accept:
//set first run flag to false, don't show welcome again
PrefUtils.save(getActivity(), Prefs.FIRST_RUN, false);
//start main activity
PTVMainActivity.startActivity(getActivity());
getActivity().finish();
return;
case R.id.action_decline:
getActivity().finish();
return;
}
super.onGuidedActionClicked(action);
}
示例8: onGuidedActionEditedAndProceed
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public long onGuidedActionEditedAndProceed(GuidedAction action) {
String password = action.getEditDescription().toString();
if (password.length() > 0) {
action.setDescription(StringUtils.toPassword(password));
} else {
action.setDescription(getString(R.string.account_enter_password));
}
if (action.getId() == PASSWORD) {
notifyActionChanged(findActionPositionById(PASSWORD));
presenter.passwordChanged(password);
} else if (action.getId() == PIN) {
notifyActionChanged(findActionPositionById(PIN));
presenter.pinChanged(action.getEditDescription().toString());
}
return GuidedAction.ACTION_ID_NEXT;
}
示例9: onGuidedActionClicked
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
if (action.getId() == LOGIN_ACTION) {
try {
String email = findActionById(EMAIL).getDescription().toString();
String password = findActionById(PASSWORD).getDescription().toString();
LostFilmApi.getInstance().login(email, password).subscribe(this);
} catch (NullPointerException e) {
Toast.makeText(getActivity(), R.string.enter_login, Toast.LENGTH_SHORT).show();
}
}
}
示例10: onGuidedActionClicked
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
if (action.getId() == CONTINUE) {
// TODO Authenticate your account
// Assume the user was logged in
Toast.makeText(getActivity(), "Welcome!", Toast.LENGTH_SHORT).show();
getActivity().finishAfterTransition();
}
}
示例11: onGuidedActionClicked
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
FragmentManager fm = getFragmentManager();
if (action.getId() == CONTINUE) {
GuidedStepFragment.add(fm, new SecondStepFragment());
} else {
getActivity().finishAfterTransition();
}
}
示例12: onGuidedActionClicked
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
if (action.getId()==RESCAN_WHEN_OPENING_YES_ID) {
sGeneralSwitch =true;
}
else if (action.getId()==RESCAN_WHEN_OPENING_NO_ID) {
sGeneralSwitch =false;
}
NetworkAutoRefresh.setAutoRescanAtStart(getActivity(),sGeneralSwitch);
getFragmentManager().popBackStack();
}
示例13: onGuidedActionClicked
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
boolean goBack = false;
mHasClickedAction = true;
int id = (int)action.getId();
switch (id) {
case DO_NOT_ID:
sPeriod = 0;
goBack = true; // no need for ScheduledRescanTime in that case
break;
case ONCE_A_DAY_ID:
sPeriod = 24;
break;
case TWICE_A_DAY_ID:
sPeriod = 12;
break;
case EVERY_6_HOURS_ID:
sPeriod = 6;
break;
case EVERY_2_HOURS_ID:
sPeriod = 2;
break;
case EVERY_HOUR_ID:
sPeriod = 1;
goBack = true; // no need for ScheduledRescanTime in that case
break;
}
if (goBack) {
NetworkAutoRefresh.scheduleNewRescan(getActivity(),0, getPeriod()* 60 *60* 1000,true);
getFragmentManager().popBackStack();
} else {
add(getFragmentManager(), new ScheduledRescanTime());
}
}
示例14: onGuidedActionClicked
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
@Override
public void onGuidedActionClicked(GuidedAction action) {
int id = (int)action.getId();
Intent intent = action.getIntent();
sTime = intent.getIntExtra("START",-1); //just set sTime, alarm will be set in onResume on ScheduledRescanPeriod
// go back two levels: > ScheduledRescanPeriod > RescanFragment
getFragmentManager().popBackStack();
getFragmentManager().popBackStack();
}
示例15: getActionById
import android.support.v17.leanback.widget.GuidedAction; //导入方法依赖的package包/类
private GuidedAction getActionById(int id) {
for (GuidedAction action : getActions()) {
if (action.getId() == id) {
return action;
}
}
return null;
}