当前位置: 首页>>代码示例>>Java>>正文


Java VehicleMode.getVehicleModePerDroneType方法代码示例

本文整理汇总了Java中com.o3dr.services.android.lib.drone.property.VehicleMode.getVehicleModePerDroneType方法的典型用法代码示例。如果您正苦于以下问题:Java VehicleMode.getVehicleModePerDroneType方法的具体用法?Java VehicleMode.getVehicleModePerDroneType怎么用?Java VehicleMode.getVehicleModePerDroneType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.o3dr.services.android.lib.drone.property.VehicleMode的用法示例。


在下文中一共展示了VehicleMode.getVehicleModePerDroneType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateItemView

import com.o3dr.services.android.lib.drone.property.VehicleMode; //导入方法依赖的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()));
          }
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:26,代码来源:InfoBarItem.java

示例2: handleIntent

import com.o3dr.services.android.lib.drone.property.VehicleMode; //导入方法依赖的package包/类
private void handleIntent(Intent intent) {
    VehicleMode flightMode = intent.getParcelableExtra(WearReceiverService.EXTRA_EVENT_DATA);
    if(flightMode == null)
        flightMode = VehicleMode.UNKNOWN;

    List<VehicleMode> vehicleModes = VehicleMode.getVehicleModePerDroneType(flightMode.getDroneType());
    WearableListView listView = (WearableListView) findViewById(R.id.wear_list);
    listView.setAdapter(new VehicleModeAdapter(vehicleModes));
    listView.setClickListener(this);

    RecyclerView.LayoutManager layoutMgr = listView.getLayoutManager();
    if (layoutMgr != null) {
        int currentPos = vehicleModes.indexOf(flightMode);
        if (currentPos != -1)
            layoutMgr.scrollToPosition(currentPos);
    }
}
 
开发者ID:DroidPlanner,项目名称:tower-wear,代码行数:18,代码来源:FlightModesSelectionActivity.java

示例3: updateFlightModeTelem

import com.o3dr.services.android.lib.drone.property.VehicleMode; //导入方法依赖的package包/类
private void updateFlightModeTelem() {
    final Drone drone = getDrone();

    final boolean isDroneConnected = drone.isConnected();
    final int droneType;
    if (isDroneConnected) {
        Type type = drone.getAttribute(AttributeType.TYPE);
        droneType = type.getDroneType();
    } else {
        droneType = -1;
    }

    if (droneType != lastDroneType) {
        final List<VehicleMode> flightModes = VehicleMode.getVehicleModePerDroneType(droneType);

        modeAdapter.clear();
        modeAdapter.addAll(flightModes);
        modeAdapter.notifyDataSetChanged();

        lastDroneType = droneType;
    }

    if (isDroneConnected) {
        final State droneState = drone.getAttribute(AttributeType.STATE);
        flightModeTelem.forcedSetSelection(modeAdapter.getPosition(droneState.getVehicleMode()));
    }
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:28,代码来源:ActionBarTelemFragment.java

示例4: updateVehicleModesForType

import com.o3dr.services.android.lib.drone.property.VehicleMode; //导入方法依赖的package包/类
protected void updateVehicleModesForType(int droneType) {

        List<VehicleMode> vehicleModes = VehicleMode.getVehicleModePerDroneType(droneType);
        ArrayAdapter<VehicleMode> vehicleModeArrayAdapter = new ArrayAdapter<VehicleMode>(this, android.R.layout.simple_spinner_item, vehicleModes);
        vehicleModeArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        this.modeSelector.setAdapter(vehicleModeArrayAdapter);
    }
 
开发者ID:3drobotics,项目名称:DroneKit-Android-Starter,代码行数:8,代码来源:MainActivity.java


注:本文中的com.o3dr.services.android.lib.drone.property.VehicleMode.getVehicleModePerDroneType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。