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


Java ControlExtension类代码示例

本文整理汇总了Java中com.sonyericsson.extras.liveware.extension.util.control.ControlExtension的典型用法代码示例。如果您正苦于以下问题:Java ControlExtension类的具体用法?Java ControlExtension怎么用?Java ControlExtension使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ControlExtension类属于com.sonyericsson.extras.liveware.extension.util.control包,在下文中一共展示了ControlExtension类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createControlExtension

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
@Override
public ControlExtension createControlExtension(final String hostAppPackageName) {
    ScreenSize size = new ScreenSize(this);
    final int width = size.getWidth();
    final int height = size.getHeight();
    List<DeviceInfo> list = RegistrationAdapter.getHostApplication(this, hostAppPackageName).getDevices();
    for (DeviceInfo device : list) {
        for (DisplayInfo display : device.getDisplays()) {
            if (display.sizeEquals(width, height)) {
                GlassesDroneControl glassesDroneControl = new GlassesDroneControl(this, hostAppPackageName);
                return glassesDroneControl;
            }
        }
    }
    throw new IllegalArgumentException("No control for: " + hostAppPackageName);
}
 
开发者ID:sonyxperiadev,项目名称:DroneControl,代码行数:17,代码来源:DroneControlExtensionService.java

示例2: createControlExtension

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
/**
 * Creates ControlExtension object for the accessory.
 * This creates the HelloWorldControl object after verifying
 * that the connected accessory is a SmartEyeglass.
 */
@Override
public ControlExtension createControlExtension(
        final String hostAppPackageName) {
    ScreenSize size = new ScreenSize(this);
    final int width = size.getWidth();
    final int height = size.getHeight();
    List<DeviceInfo> list = RegistrationAdapter.getHostApplication(
            this, hostAppPackageName).getDevices();
    for (DeviceInfo device : list) {
        for (DisplayInfo display : device.getDisplays()) {
            if (display.sizeEquals(width, height)) {
                return new ARCouponControl(this,
                        hostAppPackageName, Message);
            }
        }
    }
    throw new IllegalArgumentException("No control for: "
            + hostAppPackageName);
}
 
开发者ID:jphacks,项目名称:KB_1511,代码行数:25,代码来源:ARCouponExtensionService.java

示例3: destroyAllControls

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
/**
 * Destroy all controls. Inform all controls that they shall free any
 * resources such as threads and registered broad cast receivers.
 */
public void destroyAllControls() {
    Iterator<ControlExtension> iterator = mControls.values().iterator();
    while (iterator.hasNext()) {
        ControlExtension control = iterator.next();
        control.destroy();
    }
}
 
开发者ID:fbarriga,项目名称:sony-smartband-logger,代码行数:12,代码来源:ExtensionService.java

示例4: createControlExtension

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
@Override
public ControlExtension createControlExtension(String hostAppPackageName) {
	// First we check if the API level and screen size required for
	// SampleControlSmartWatch2 is supported
	boolean advancedFeaturesSupported = DeviceInfoHelper.
			isSmartWatch2ApiAndScreenDetected(this, hostAppPackageName);
	if (advancedFeaturesSupported) {
		return new ControlSmartWatch2(
				hostAppPackageName, this, new Handler());
	} else {
		// If not we return an API level 1 control based on screen size
		throw new IllegalArgumentException("No control for: "
				+ hostAppPackageName);
	}
}
 
开发者ID:asamm,项目名称:locus-addon-smartwatch2,代码行数:16,代码来源:MainExtensionService.java

示例5: createControlExtension

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
@Override
public ControlExtension createControlExtension(String hostAppPackageName) {
    // First we check if the API level and screen size required for
    // SampleControlSmartWatch2 is supported
    boolean advancedFeaturesSupported = DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected(
            this, hostAppPackageName);
    if (advancedFeaturesSupported) {
        return new SampleControlSmartWatch2(hostAppPackageName, this, new Handler());
    }
    throw new IllegalArgumentException("No control for: " + hostAppPackageName);

}
 
开发者ID:hecosire,项目名称:hecosire-androidapp,代码行数:13,代码来源:SampleExtensionService.java

示例6: createControlExtension

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
@Override
public ControlExtension createControlExtension(String hostAppPackageName) {
    // First we check if the host application API level and screen size
    // is supported by the extension.
    boolean advancedFeaturesSupported = DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected(
        this, hostAppPackageName);
    if (advancedFeaturesSupported) {
        return new ScreenControl(hostAppPackageName, this, new Handler());
    } else {
        throw new IllegalArgumentException("No control for: " + hostAppPackageName);
    }
}
 
开发者ID:zasadnyy,项目名称:vision-trainer-sw2,代码行数:13,代码来源:ExtensionService.java

示例7: createControlExtension

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
@Override
public ControlExtension createControlExtension(String hostAppPackageName) {
    // First we check if the API level and screen size required for
    // SampleControlSmartWatch2 is supported
    Log.d(MyExtensionService.LOG_TAG, "create control exteions " + hostAppPackageName);
    return new ControlSmartWatch2(hostAppPackageName, this, new Handler());
 }
 
开发者ID:grimpy,项目名称:XbmcXtraMote,代码行数:8,代码来源:MyExtensionService.java

示例8: createControlExtension

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
@Override
public ControlExtension createControlExtension(String hostAppPackageName) {
  if (!DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected(this, hostAppPackageName))
    throw new IllegalArgumentException("SmartWatch 2 not found");

  return new SwControlFlow(hostAppPackageName);
}
 
开发者ID:trashkalmar,项目名称:MrParkingNavigator,代码行数:8,代码来源:SwService.java

示例9: createControlExtension

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
@Override
public ControlExtension createControlExtension( String hostAppPackageName ) {
    return new LoggerControl( hostAppPackageName, this );
}
 
开发者ID:fbarriga,项目名称:sony-smartband-logger,代码行数:5,代码来源:ExtensionService.java

示例10: createControlExtension

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
@Override
public ControlExtension createControlExtension(final String hostAppPackageName) {
    return new SWControlExtension(this, hostAppPackageName);
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:5,代码来源:SWExtensionService.java

示例11: destroyAllControls

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
/**
 * Destroy all controls. Inform all controls that they shall free any
 * resources such as threads and registered broad cast receivers.
 */
public void destroyAllControls() {
  for (ControlExtension control : mControls.values())
    control.destroy();
}
 
开发者ID:trashkalmar,项目名称:MrParkingNavigator,代码行数:9,代码来源:ExtensionService.java

示例12: doActionOnAllControls

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
/**
 * Trigger action for all controls. Use this method to take the same action
 * on all controls.
 *
 * @param requestCode Code defined by the caller used to distinguish between
 *            different actions.
 * @param bundle Optional bundle with additional information.
 */
public void doActionOnAllControls(int requestCode, Bundle bundle) {
    Iterator<ControlExtension> iterator = mControls.values().iterator();
    while (iterator.hasNext()) {
        ControlExtension control = iterator.next();
        control.onDoAction(requestCode, bundle);
    }
}
 
开发者ID:fbarriga,项目名称:sony-smartband-logger,代码行数:16,代码来源:ExtensionService.java

示例13: doActionOnControl

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
/**
 * Trigger action on a control.
 *
 * @param requestCode Code defined by the caller used to distinguish between
 *            different actions.
 * @param hostAppPackageName The host app package name.
 * @param bundle Optional bundle with additional information.
 *
 * @returns True if the widget exists. False otherwise.
 */
public boolean doActionOnControl(int requestCode, String hostAppPackageName, Bundle bundle) {
    ControlExtension control = mControls.get(hostAppPackageName);
    if (control != null) {
        control.onDoAction(requestCode, bundle);
        return true;
    }
    return false;
}
 
开发者ID:fbarriga,项目名称:sony-smartband-logger,代码行数:19,代码来源:ExtensionService.java

示例14: doActionOnControl

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
/**
 * Trigger action on a control.
 *
 * @param requestCode Code defined by the caller used to distinguish between
 *            different actions.
 * @param hostAppPackageName The host app package name.
 * @param bundle Optional bundle with additional information.
 * @returns True if the widget exists. False otherwise.
 */
public boolean doActionOnControl(int requestCode, String hostAppPackageName, Bundle bundle) {
    ControlExtension control = mControls.get(hostAppPackageName);
    if (control != null) {
        control.onDoAction(requestCode, bundle);
        return true;
    }
    return false;
}
 
开发者ID:asamm,项目名称:locus-addon-smartwatch2,代码行数:18,代码来源:ExtensionService.java

示例15: doActionOnControl

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
/**
 * Trigger action on a control.
 *
 * @param requestCode        Code defined by the caller used to distinguish between
 *                           different actions.
 * @param hostAppPackageName The host app package name.
 * @param bundle             Optional bundle with additional information.
 * @return True if the widget exists. False otherwise.
 */
public boolean doActionOnControl(int requestCode, String hostAppPackageName, Bundle bundle) {
  ControlExtension control = mControls.get(hostAppPackageName);
  if (control != null) {
    control.onDoAction(requestCode, bundle);
    return true;
  }
  return false;
}
 
开发者ID:trashkalmar,项目名称:MrParkingNavigator,代码行数:18,代码来源:ExtensionService.java


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