本文整理汇总了Java中com.playuav.android.dialogs.YesNoWithPrefsDialog.newInstance方法的典型用法代码示例。如果您正苦于以下问题:Java YesNoWithPrefsDialog.newInstance方法的具体用法?Java YesNoWithPrefsDialog.newInstance怎么用?Java YesNoWithPrefsDialog.newInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.playuav.android.dialogs.YesNoWithPrefsDialog
的用法示例。
在下文中一共展示了YesNoWithPrefsDialog.newInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDronieConfirmation
import com.playuav.android.dialogs.YesNoWithPrefsDialog; //导入方法依赖的package包/类
private void getDronieConfirmation() {
YesNoWithPrefsDialog ynd = YesNoWithPrefsDialog.newInstance(getActivity()
.getApplicationContext(), getString(R.string.pref_dronie_creation_title),
getString(R.string.pref_dronie_creation_message), new YesNoDialog.Listener() {
@Override
public void onYes() {
missionProxy.makeAndUploadDronie(getDrone());
}
@Override
public void onNo() {
}
}, getString(R.string.pref_warn_on_dronie_creation_key));
if(ynd != null){
ynd.show(getChildFragmentManager(), "Confirm dronie creation");
}
}
示例2: getTakeOffInAutoConfirmation
import com.playuav.android.dialogs.YesNoWithPrefsDialog; //导入方法依赖的package包/类
private void getTakeOffInAutoConfirmation() {
YesNoWithPrefsDialog ynd = YesNoWithPrefsDialog.newInstance(getActivity()
.getApplicationContext(), getString(R.string.dialog_confirm_take_off_in_auto_title),
getString(R.string.dialog_confirm_take_off_in_auto_msg), new YesNoDialog.Listener() {
@Override
public void onYes() {
Drone drone = getDrone();
drone.doGuidedTakeoff(TAKEOFF_ALTITUDE);
drone.changeVehicleMode(VehicleMode.COPTER_AUTO);
}
@Override
public void onNo() {
}
}, getString(R.string.pref_warn_on_takeoff_in_auto_key));
if(ynd != null){
ynd.show(getChildFragmentManager(), "Confirm take off in auto");
}
}
示例3: getArmingConfirmation
import com.playuav.android.dialogs.YesNoWithPrefsDialog; //导入方法依赖的package包/类
private void getArmingConfirmation() {
YesNoWithPrefsDialog ynd = YesNoWithPrefsDialog.newInstance(getActivity().getApplicationContext(),
getString(R.string.dialog_confirm_arming_title),
getString(R.string.dialog_confirm_arming_msg), new YesNoDialog.Listener() {
@Override
public void onYes() {
getDrone().arm(true);
}
@Override
public void onNo() {}
}, getString(R.string.pref_warn_on_arm_key));
if(ynd != null) {
ynd.show(getChildFragmentManager(), "Confirm arming");
}
}
示例4: onOptionsItemSelected
import com.playuav.android.dialogs.YesNoWithPrefsDialog; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
final Drone dpApi = dpApp.getDrone();
switch (item.getItemId()) {
case R.id.menu_connect:
toggleDroneConnection();
return true;
case R.id.menu_send_mission: {
final MissionProxy missionProxy = dpApp.getMissionProxy();
if (missionProxy.getItems().isEmpty() || missionProxy.hasTakeoffAndLandOrRTL()) {
missionProxy.sendMissionToAPM(dpApi);
} else {
YesNoWithPrefsDialog dialog = YesNoWithPrefsDialog.newInstance(
getApplicationContext(), "Mission Upload",
"Do you want to append a Takeoff and RTL to your " + "mission?", "Ok",
"Skip", new YesNoDialog.Listener() {
@Override
public void onYes() {
missionProxy.addTakeOffAndRTL();
missionProxy.sendMissionToAPM(dpApi);
}
@Override
public void onNo() {
missionProxy.sendMissionToAPM(dpApi);
}
}, getString(R.string.pref_auto_insert_mission_takeoff_rtl_land_key));
if (dialog != null) {
dialog.show(getSupportFragmentManager(), "Mission Upload check.");
}
}
return true;
}
case R.id.menu_load_mission:
dpApi.loadWaypoints();
return true;
case R.id.menu_triggerCamera:
dpApi.triggerCamera();
return true;
case R.id.menu_epm_grab:
dpApi.epmCommand(false);
return true;
case R.id.menu_epm_release:
dpApi.epmCommand(true);
return true;
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
default:
return super.onOptionsItemSelected(item);
}
}