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


Java AttributeType.FOLLOW_STATE属性代码示例

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


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

示例1: onReceive

@Override
public void onReceive(Context context, Intent intent) {
    switch(intent.getAction()){
        case AttributeType.FOLLOW_STATE:
        case AttributeType.GUIDED_STATE:
            updateLayout();
            break;
    }
}
 
开发者ID:DroidPlanner,项目名称:tower-wear,代码行数:9,代码来源:BaseActionFragment.java

示例2: onVehicleDataUpdated

@Override
protected void onVehicleDataUpdated(String dataType, byte[] eventData) {
    switch (dataType) {
        case AttributeType.STATE:
            vehicleState = eventData == null ? null : ParcelableUtils.unmarshall(eventData, State.CREATOR);
            final boolean isFollowMeReady = vehicleState != null && vehicleState.isConnected()
                    && vehicleState.isArmed() && vehicleState.isFlying();
            if (!isFollowMeReady)
                finish();
            else {
                gridView.setKeepScreenOn(appPrefs.keepScreenBright());
            }
            broadcastManager.sendBroadcast(new Intent(dataType).putExtra(EXTRA_VEHICLE_STATE, vehicleState));
            break;

        case AttributeType.FOLLOW_STATE:
            followState = eventData == null ? null : ParcelableUtils.unmarshall(eventData,
                    WearFollowState.CREATOR);
            broadcastManager.sendBroadcast(new Intent(dataType).putExtra(EXTRA_VEHICLE_FOLLOW_STATE, followState));
            break;

        case AttributeType.GUIDED_STATE:
            guidedState = eventData == null ? null : ParcelableUtils.unmarshall(eventData,
                    GuidedState.CREATOR);
            broadcastManager.sendBroadcast(new Intent(dataType).putExtra(EXTRA_GUIDED_STATE, guidedState));
            break;
    }
}
 
开发者ID:DroidPlanner,项目名称:tower-wear,代码行数:28,代码来源:WearUIActivity.java

示例3: onDroneEvent

@Override
public void onDroneEvent(String event, Bundle bundle) {
    String attributeType = null;
    switch (event) {
        case AttributeEvent.STATE_CONNECTED:
        case AttributeEvent.STATE_DISCONNECTED:
            //Update all of the vehicle's properties.
            Log.d(TAG, "Received drone connection event: " + event);
            updateAllVehicleAttributes();
            break;

        case AttributeEvent.STATE_UPDATED:
        case AttributeEvent.STATE_VEHICLE_MODE:
        case AttributeEvent.STATE_ARMING:
            //Retrieve the state attribute
            attributeType = AttributeType.STATE;
            break;

        case AttributeEvent.BATTERY_UPDATED:
            //Retrieve the battery attribute
            attributeType = AttributeType.BATTERY;
            break;

        case AttributeEvent.SIGNAL_UPDATED:
            //Retrieve the signal attribute
            attributeType = AttributeType.SIGNAL;
            break;

        case AttributeEvent.GPS_POSITION:
        case AttributeEvent.GPS_FIX:
        case AttributeEvent.GPS_COUNT:
            attributeType = AttributeType.GPS;
            break;

        case AttributeEvent.GUIDED_POINT_UPDATED:
            attributeType = AttributeType.GUIDED_STATE;
            break;

        case AttributeEvent.FOLLOW_START:
        case AttributeEvent.FOLLOW_STOP:
        case AttributeEvent.FOLLOW_UPDATE:
            attributeType = AttributeType.FOLLOW_STATE;
            break;

        case AttributeEvent.HOME_UPDATED:
            attributeType = AttributeType.HOME;
            break;
    }

    updateVehicleAttribute(attributeType);
}
 
开发者ID:DroidPlanner,项目名称:tower-wear,代码行数:51,代码来源:DroneService.java


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