本文整理汇总了Java中com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter类的典型用法代码示例。如果您正苦于以下问题:Java NumericWheelAdapter类的具体用法?Java NumericWheelAdapter怎么用?Java NumericWheelAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NumericWheelAdapter类属于com.playuav.android.widgets.spinnerWheel.adapters包,在下文中一共展示了NumericWheelAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onViewCreated
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的package包/类
@Override
public void onViewCreated(View parentView, Bundle savedInstanceState) {
super.onViewCreated(parentView, savedInstanceState);
final Context context = getActivity().getApplicationContext();
final NumericWheelAdapter radiusAdapter = new NumericWheelAdapter(context,
R.layout.wheel_text_centered, 0, 200, "%d m");
mRadiusWheel = (CardWheelHorizontalView) parentView.findViewById(R.id.radius_spinner);
mRadiusWheel.setViewAdapter(radiusAdapter);
updateCurrentRadius();
mRadiusWheel.addChangingListener(this);
spinner = (Spinner) parentView.findViewById(R.id.follow_type_spinner);
adapter = new ArrayAdapter<FollowType>(getActivity(), android.R.layout.simple_spinner_item);
spinner.setAdapter(adapter);
spinner.setOnItemSelectedListener(this);
}
示例2: onApiConnected
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的package包/类
@Override
public void onApiConnected(){
super.onApiConnected();
final View view = getView();
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.CHANGE_SPEED));
final NumericWheelAdapter adapter = new NumericWheelAdapter(getActivity()
.getApplicationContext(), R.layout.wheel_text_centered, 1,
20, "%d m/s");
CardWheelHorizontalView cardAltitudePicker = (CardWheelHorizontalView) view.findViewById
(R.id.picker1);
cardAltitudePicker.setViewAdapter(adapter);
cardAltitudePicker.addChangingListener(this);
ChangeSpeed item = (ChangeSpeed) getMissionItems().get(0);
cardAltitudePicker.setCurrentValue((int) item.getSpeed());
}
示例3: onApiConnected
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的package包/类
@Override
public void onApiConnected() {
super.onApiConnected();
final View view = getView();
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.SET_SERVO));
SetServo item = (SetServo) getMissionItems().get(0);
final NumericWheelAdapter adapter = new NumericWheelAdapter(
getActivity().getApplicationContext(), R.layout.wheel_text_centered, 1, 8, "%d");
final CardWheelHorizontalView cardChannelPicker = (CardWheelHorizontalView) view
.findViewById(R.id.picker1);
final EditText pwmEditText = (EditText) view.findViewById(R.id.PwmEditText);
cardChannelPicker.setViewAdapter(adapter);
cardChannelPicker.addChangingListener(this);
cardChannelPicker.setCurrentValue(item.getChannel());
pwmEditText.setText(Integer.toString(item.getPwm()));
pwmEditText.addTextChangedListener(this);
}
示例4: onApiConnected
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的package包/类
@Override
public void onApiConnected() {
super.onApiConnected();
final View view = getView();
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.YAW_CONDITION));
YawCondition item = (YawCondition) getMissionItems().get(0);
final NumericWheelAdapter adapter = new NumericWheelAdapter(
getActivity().getApplicationContext(),
R.layout.wheel_text_centered, 0, 359, "%d deg");
final CardWheelHorizontalView cardAltitudePicker = (CardWheelHorizontalView) view
.findViewById(R.id.picker1);
cardAltitudePicker.setViewAdapter(adapter);
cardAltitudePicker.addChangingListener(this);
cardAltitudePicker.setCurrentValue((int) item.getAngle());
CheckBox checkBoxRelative = (CheckBox) view.findViewById(R.id.checkBox1);
checkBoxRelative.setOnCheckedChangeListener(this);
checkBoxRelative.setChecked(item.isRelative());
}
示例5: onApiConnected
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的package包/类
@Override
public void onApiConnected() {
super.onApiConnected();
final View view = getView();
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.REGION_OF_INTEREST));
final NumericWheelAdapter altitudeAdapter = new NumericWheelAdapter(getActivity()
.getApplicationContext(), R.layout.wheel_text_centered, MIN_ALTITUDE, MAX_ALTITUDE,
"%d m");
CardWheelHorizontalView altitudePicker = (CardWheelHorizontalView) view
.findViewById(R.id.altitudePicker);
altitudePicker.setViewAdapter(altitudeAdapter);
altitudePicker.addChangingListener(this);
altitudePicker.setCurrentValue((int) ((RegionOfInterest) getMissionItems().get(0))
.getCoordinate().getAltitude());
}
示例6: onApiConnected
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的package包/类
@Override
public void onApiConnected() {
super.onApiConnected();
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.TAKEOFF));
final NumericWheelAdapter altitudeAdapter = new NumericWheelAdapter(getActivity()
.getApplicationContext(), R.layout.wheel_text_centered, 0, MAX_ALTITUDE, "%d m");
CardWheelHorizontalView cardAltitudePicker = (CardWheelHorizontalView) getView()
.findViewById(R.id.altitudePicker);
cardAltitudePicker.setViewAdapter(altitudeAdapter);
cardAltitudePicker.addChangingListener(this);
Takeoff item = (Takeoff) getMissionItems().get(0);
cardAltitudePicker.setCurrentValue((int) item.getTakeoffAltitude());
}
示例7: onApiConnected
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的package包/类
@Override
public void onApiConnected() {
super.onApiConnected();
final View view = getView();
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.CAMERA_TRIGGER));
CameraTrigger item = (CameraTrigger) getMissionItems().get(0);
final NumericWheelAdapter adapter = new NumericWheelAdapter(getActivity()
.getApplicationContext(), R.layout.wheel_text_centered, 0,
100, "%d m");
final CardWheelHorizontalView cardAltitudePicker = (CardWheelHorizontalView) view
.findViewById(R.id.picker1);
cardAltitudePicker.setViewAdapter(adapter);
cardAltitudePicker.addChangingListener(this);
cardAltitudePicker.setCurrentValue((int) item.getTriggerDistance());
}
示例8: onViewCreated
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的package包/类
@Override
public void onViewCreated(View parentView, Bundle savedInstanceState) {
super.onViewCreated(parentView, savedInstanceState);
final NumericWheelAdapter altitudeAdapter = new NumericWheelAdapter(getActivity()
.getApplicationContext(), R.layout.wheel_text_centered, 2, 200, "%d m");
mAltitudeWheel = (CardWheelHorizontalView) parentView.findViewById(R.id.altitude_spinner);
mAltitudeWheel.setViewAdapter(altitudeAdapter);
mAltitudeWheel.addChangingListener(this);
}
示例9: onApiConnected
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的package包/类
@Override
public void onApiConnected() {
super.onApiConnected();
final View view = getView();
final Context context = getActivity().getApplicationContext();
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.CIRCLE));
final NumericWheelAdapter altitudeAdapter = new NumericWheelAdapter(context, MIN_ALTITUDE,
MAX_ALTITUDE, "%d m");
altitudeAdapter.setItemResource(R.layout.wheel_text_centered);
CardWheelHorizontalView altitudePicker = (CardWheelHorizontalView) view
.findViewById(R.id.altitudePicker);
altitudePicker.setViewAdapter(altitudeAdapter);
altitudePicker.addChangingListener(this);
final NumericWheelAdapter loiterTurnAdapter = new NumericWheelAdapter(context,
R.layout.wheel_text_centered, 0, 10, "%d");
CardWheelHorizontalView loiterTurnPicker = (CardWheelHorizontalView) view
.findViewById(R.id.loiterTurnPicker);
loiterTurnPicker.setViewAdapter(loiterTurnAdapter);
loiterTurnPicker.addChangingListener(this);
final NumericWheelAdapter loiterRadiusAdapter = new NumericWheelAdapter(context, 0, 50,
"%d m");
loiterRadiusAdapter.setItemResource(R.layout.wheel_text_centered);
CardWheelHorizontalView loiterRadiusPicker = (CardWheelHorizontalView) view
.findViewById(R.id.loiterRadiusPicker);
loiterRadiusPicker.setViewAdapter(loiterRadiusAdapter);
loiterRadiusPicker.addChangingListener(this);
// Use the first one as reference.
final Circle firstItem = getMissionItems().get(0);
altitudePicker.setCurrentValue((int) firstItem.getCoordinate().getAltitude());
loiterTurnPicker.setCurrentValue(firstItem.getTurns());
loiterRadiusPicker.setCurrentValue((int) firstItem.getRadius());
}
示例10: onApiConnected
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的package包/类
@Override
public void onApiConnected(){
super.onApiConnected();
final View view = getView();
final Context context = getActivity().getApplicationContext();
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.WAYPOINT));
final NumericWheelAdapter delayAdapter = new NumericWheelAdapter(context,
R.layout.wheel_text_centered, 0, 60, "%d s");
CardWheelHorizontalView delayPicker = (CardWheelHorizontalView) view.findViewById(R.id
.waypointDelayPicker);
delayPicker.setViewAdapter(delayAdapter);
delayPicker.addChangingListener(this);
final NumericWheelAdapter altitudeAdapter = new NumericWheelAdapter(context,
R.layout.wheel_text_centered, MIN_ALTITUDE, MAX_ALTITUDE, "%d m");
CardWheelHorizontalView altitudePicker = (CardWheelHorizontalView) view.findViewById(R.id
.altitudePicker);
altitudePicker.setViewAdapter(altitudeAdapter);
altitudePicker.addChangingListener(this);
final Waypoint item = (Waypoint) getMissionItems().get(0);
delayPicker.setCurrentValue((int) item.getDelay());
altitudePicker.setCurrentValue((int) item.getCoordinate().getAltitude());
}
示例11: onApiConnected
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的package包/类
@Override
public void onApiConnected(){
super.onApiConnected();
final View view = getView();
final Context context = getActivity().getApplicationContext();
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.SPLINE_WAYPOINT));
final NumericWheelAdapter delayAdapter = new NumericWheelAdapter(context,
R.layout.wheel_text_centered, 0, 60, "%d s");
CardWheelHorizontalView delayPicker = (CardWheelHorizontalView) view.findViewById(R.id
.waypointDelayPicker);
delayPicker.setViewAdapter(delayAdapter);
delayPicker.addChangingListener(this);
final NumericWheelAdapter altitudeAdapter = new NumericWheelAdapter(context,
R.layout.wheel_text_centered, MIN_ALTITUDE, MAX_ALTITUDE, "%d m");
CardWheelHorizontalView altitudePicker = (CardWheelHorizontalView) view.findViewById(R.id
.altitudePicker);
altitudePicker.setViewAdapter(altitudeAdapter);
altitudePicker.addChangingListener(this);
SplineWaypoint item = (SplineWaypoint) getMissionItems().get(0);
delayPicker.setCurrentValue((int) item.getDelay());
altitudePicker.setCurrentValue((int) item.getCoordinate().getAltitude());
}
示例12: WheelHorizontalView
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的package包/类
/**
* Create a new wheel horizontal view.
*
* @param context
* the application environment.
* @param attrs
* a collection of attributes.
* @param defStyle
* The default style to apply to this view.
*/
public WheelHorizontalView(final Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// Create a dummy view adapter if we're in edit mode.
if (isInEditMode()) {
final NumericWheelAdapter adapter = new NumericWheelAdapter(context, 0, 100);
adapter.setItemResource(R.layout.wheel_text_centered);
setViewAdapter(adapter);
setCurrentItem(50);
}
}
示例13: onApiConnected
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的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);
}
示例14: onApiConnected
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的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());
}
示例15: setViewAdapter
import com.playuav.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; //导入依赖的package包/类
public void setViewAdapter(NumericWheelAdapter adapter) {
mSpinnerWheel.setViewAdapter(adapter);
}