本文整理汇总了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);
}
示例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);
}
示例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();
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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());
}
示例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);
}
示例9: createControlExtension
import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
@Override
public ControlExtension createControlExtension( String hostAppPackageName ) {
return new LoggerControl( hostAppPackageName, this );
}
示例10: createControlExtension
import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; //导入依赖的package包/类
@Override
public ControlExtension createControlExtension(final String hostAppPackageName) {
return new SWControlExtension(this, hostAppPackageName);
}
示例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();
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}