本文整理汇总了Java中com.playuav.android.widgets.spinners.SpinnerSelfSelect.setOnSpinnerItemSelectedListener方法的典型用法代码示例。如果您正苦于以下问题:Java SpinnerSelfSelect.setOnSpinnerItemSelectedListener方法的具体用法?Java SpinnerSelfSelect.setOnSpinnerItemSelectedListener怎么用?Java SpinnerSelfSelect.setOnSpinnerItemSelectedListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.playuav.android.widgets.spinners.SpinnerSelfSelect
的用法示例。
在下文中一共展示了SpinnerSelfSelect.setOnSpinnerItemSelectedListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initItemView
import com.playuav.android.widgets.spinners.SpinnerSelfSelect; //导入方法依赖的package包/类
@Override
protected void initItemView(final Context context, View parentView, final Drone drone) {
super.initItemView(context, parentView, drone);
if (mItemView == null)
return;
final SpinnerSelfSelect modesSpinner = (SpinnerSelfSelect) mItemView;
mModeAdapter = new ModeAdapter(context, R.layout.spinner_drop_down);
modesSpinner.setAdapter(mModeAdapter);
modesSpinner.setOnSpinnerItemSelectedListener(new SpinnerSelfSelect.OnSpinnerItemSelectedListener() {
@Override
public void onSpinnerItemSelected(Spinner parent, int position) {
if (mDrone != null && mDrone.isConnected()) {
final VehicleMode newMode = (VehicleMode) parent.getItemAtPosition
(position);
mDrone.changeVehicleMode(newMode);
//Record the attempt to change flight modes
final HitBuilders.EventBuilder eventBuilder = new HitBuilders.EventBuilder()
.setCategory(GAUtils.Category.FLIGHT)
.setAction("Flight mode changed")
.setLabel(newMode.getLabel());
GAUtils.sendEvent(eventBuilder);
}
}
});
updateItemView(context, drone);
}
示例2: onApiConnected
import com.playuav.android.widgets.spinners.SpinnerSelfSelect; //导入方法依赖的package包/类
@Override
public void onApiConnected() {
super.onApiConnected();
final View view = getView();
final Context context = getActivity().getApplicationContext();
CameraProxy camera = getDrone().getCamera();
List<CameraDetail> cameraDetails = camera == null
? Collections.<CameraDetail>emptyList()
: camera.getAvailableCameraInfos();
cameraAdapter = new CamerasAdapter(getActivity(),
android.R.layout.simple_spinner_dropdown_item, cameraDetails);
cameraSpinner = (SpinnerSelfSelect) view.findViewById(id.cameraFileSpinner);
cameraSpinner.setAdapter(cameraAdapter);
cameraSpinner.setOnSpinnerItemSelectedListener(this);
mAnglePicker = (CardWheelHorizontalView) view.findViewById(id.anglePicker);
mAnglePicker.setViewAdapter(new NumericWheelAdapter(context, R.layout.wheel_text_centered,
0, 180, "%dº"));
mOverlapPicker = (CardWheelHorizontalView) view.findViewById(id.overlapPicker);
mOverlapPicker.setViewAdapter(new NumericWheelAdapter(context,
R.layout.wheel_text_centered, 0, 99, "%d %%"));
mSidelapPicker = (CardWheelHorizontalView) view.findViewById(R.id.sidelapPicker);
mSidelapPicker.setViewAdapter(new NumericWheelAdapter(context,
R.layout.wheel_text_centered, 0, 99, "%d %%"));
mAltitudePicker = (CardWheelHorizontalView) view.findViewById(R.id.altitudePicker);
mAltitudePicker.setViewAdapter(new NumericWheelAdapter(context,
R.layout.wheel_text_centered, 0, 200, "%d m"));
areaTextView = (TextView) view.findViewById(id.areaTextView);
distanceBetweenLinesTextView = (TextView) view
.findViewById(id.distanceBetweenLinesTextView);
footprintTextView = (TextView) view.findViewById(id.footprintTextView);
groundResolutionTextView = (TextView) view.findViewById(id.groundResolutionTextView);
distanceTextView = (TextView) view.findViewById(id.distanceTextView);
numberOfPicturesView = (TextView) view.findViewById(id.numberOfPicturesTextView);
numberOfStripsView = (TextView) view.findViewById(id.numberOfStripsTextView);
lengthView = (TextView) view.findViewById(id.lengthTextView);
updateCamera();
updateViews();
mAnglePicker.addChangingListener(this);
mOverlapPicker.addChangingListener(this);
mSidelapPicker.addChangingListener(this);
mAltitudePicker.addChangingListener(this);
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.SURVEY));
getBroadcastManager().registerReceiver(eventReceiver, eventFilter);
}
示例3: onApiConnected
import com.playuav.android.widgets.spinners.SpinnerSelfSelect; //导入方法依赖的package包/类
@Override
public void onApiConnected() {
super.onApiConnected();
final View view = getView();
final Context context = getActivity().getApplicationContext();
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.STRUCTURE_SCANNER));
CameraProxy camera = getDrone().getCamera();
List<CameraDetail> cameraDetails = camera == null
? Collections.<CameraDetail>emptyList()
: camera.getAvailableCameraInfos();
cameraAdapter = new CamerasAdapter(getActivity(),
android.R.layout.simple_spinner_dropdown_item, cameraDetails);
SpinnerSelfSelect cameraSpinner = (SpinnerSelfSelect) view.findViewById(id.cameraFileSpinner);
cameraSpinner.setAdapter(cameraAdapter);
cameraSpinner.setOnSpinnerItemSelectedListener(this);
CardWheelHorizontalView radiusPicker = (CardWheelHorizontalView) view
.findViewById(R.id.radiusPicker);
radiusPicker.setViewAdapter(new NumericWheelAdapter(context, R.layout.wheel_text_centered,
2, 100, "%d m"));
radiusPicker.addChangingListener(this);
CardWheelHorizontalView startAltitudeStepPicker = (CardWheelHorizontalView) view
.findViewById(R.id.startAltitudePicker);
startAltitudeStepPicker.setViewAdapter(new NumericWheelAdapter(context,
R.layout.wheel_text_centered, MIN_ALTITUDE, MAX_ALTITUDE, "%d m"));
startAltitudeStepPicker.addChangingListener(this);
CardWheelHorizontalView endAltitudeStepPicker = (CardWheelHorizontalView) view
.findViewById(R.id.heightStepPicker);
endAltitudeStepPicker.setViewAdapter(new NumericWheelAdapter(context,
R.layout.wheel_text_centered, 1, MAX_ALTITUDE, "%d m"));
endAltitudeStepPicker.addChangingListener(this);
CardWheelHorizontalView mNumberStepsPicker = (CardWheelHorizontalView) view
.findViewById(R.id.stepsPicker);
mNumberStepsPicker.setViewAdapter(new NumericWheelAdapter(context,
R.layout.wheel_text_centered, 1, 10, "%d"));
mNumberStepsPicker.addChangingListener(this);
CheckBox checkBoxAdvanced = (CheckBox) view.findViewById(R.id.checkBoxSurveyCrossHatch);
checkBoxAdvanced.setOnCheckedChangeListener(this);
// Use the first one as reference.
final StructureScanner firstItem = getMissionItems().get(0);
final int cameraSelection = cameraAdapter.getPosition(firstItem.getSurveyDetail().getCameraDetail());
cameraSpinner.setSelection(Math.max(cameraSelection, 0));
radiusPicker.setCurrentValue((int) firstItem.getRadius());
startAltitudeStepPicker.setCurrentValue((int) firstItem.getCoordinate().getAltitude());
endAltitudeStepPicker.setCurrentValue((int) firstItem.getHeightStep());
mNumberStepsPicker.setCurrentValue(firstItem.getStepsCount());
checkBoxAdvanced.setChecked(firstItem.isCrossHatch());
}