本文整理匯總了Java中com.playuav.android.widgets.spinners.SpinnerSelfSelect類的典型用法代碼示例。如果您正苦於以下問題:Java SpinnerSelfSelect類的具體用法?Java SpinnerSelfSelect怎麽用?Java SpinnerSelfSelect使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SpinnerSelfSelect類屬於com.playuav.android.widgets.spinners包,在下文中一共展示了SpinnerSelfSelect類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateItemView
import com.playuav.android.widgets.spinners.SpinnerSelfSelect; //導入依賴的package包/類
@Override
public void updateItemView(final Context context, final Drone drone) {
mDrone = drone;
if (mItemView == null)
return;
final SpinnerSelfSelect modesSpinner = (SpinnerSelfSelect) mItemView;
final int droneType = drone == null || !drone.isConnected() ? -1 : drone.getType()
.getDroneType();
if (droneType != mLastDroneType) {
final List<VehicleMode> flightModes = VehicleMode.getVehicleModePerDroneType(droneType);
mModeAdapter.clear();
mModeAdapter.addAll(flightModes);
mModeAdapter.notifyDataSetChanged();
mLastDroneType = droneType;
}
if (mDrone != null && mDrone.isConnected()) {
modesSpinner.forcedSetSelection(mModeAdapter.getPosition(mDrone.getState()
.getVehicleMode()));
}
}
示例2: 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);
}
示例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();
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);
}
示例4: 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());
}