本文整理汇总了Java中com.integreight.onesheeld.sdk.ShieldFrame.getArgument方法的典型用法代码示例。如果您正苦于以下问题:Java ShieldFrame.getArgument方法的具体用法?Java ShieldFrame.getArgument怎么用?Java ShieldFrame.getArgument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.integreight.onesheeld.sdk.ShieldFrame
的用法示例。
在下文中一共展示了ShieldFrame.getArgument方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //导入方法依赖的package包/类
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
if (frame.getShieldId() == UIShield.BUZZER_SHIELD.getId()) {
byte argumentValue = frame.getArgument(0)[0];
switch (argumentValue) {
case BUZZER_ON:
// turn on bin
playSound();
if (isResumed)
if (eventHandler != null)
eventHandler.onSpeakerChange(true);
break;
case BUZZER_OFF:
// turn off bin
stopBuzzer();
if (eventHandler != null && isResumed)
eventHandler.onSpeakerChange(false);
break;
default:
break;
}
}
}
示例2: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //导入方法依赖的package包/类
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
if (frame.getShieldId() == SHIELD_ID) {
switch (frame.getFunctionId()) {
case ENABLE_FULL_COLORS:
if (colorEventHandler != null) {
colorEventHandler.enableFullColor();
}
recevedFramesOperation = RECEIVED_FRAMES.NINE_FRAMES;
notifyColorDetectionOperation();
break;
case ENABLE_NORMAL_COLOR:
if (colorEventHandler != null) {
colorEventHandler.enableNormalColor();
}
recevedFramesOperation = RECEIVED_FRAMES.CENTER;
notifyColorDetectionOperation();
break;
case SET_PALLETE:
currentPallete = ColorPalette.get(frame.getArgument(0)[0]);
if (colorEventHandler != null) {
colorEventHandler.setPallete(currentPallete);
}
break;
case SET_CALC_MODE:
colorType = frame.getArgument(0)[0] == AVERAGE_COLOR ? COLOR_TYPE.AVERAGE : COLOR_TYPE.COMMON;
if (colorEventHandler != null) {
colorEventHandler.changeCalculationMode(colorType);
}
break;
case SET_PATCH_SIZE:
patchSize = frame.getArgument(0)[0] == SMALL_PATCH ? PATCH_SIZE.SMALL : frame.getArgument(0)[0] == MED_PATCH ? PATCH_SIZE.MEDIUM : PATCH_SIZE.LARGE;
if (colorEventHandler != null) {
colorEventHandler.changePatchSize(patchSize);
}
notifyPatchSize();
break;
}
}
}
示例3: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //导入方法依赖的package包/类
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
// TODO Auto-generated method stub
if (frame.getShieldId() == UIShield.FACEBOOK_SHIELD.getId()) {
lastPost = frame.getArgumentAsString(0);
if (isFacebookLoggedInAlready()) {
if (ConnectionDetector.isConnectingToInternet(getApplication()
.getApplicationContext())) {
if (eventHandler != null)
eventHandler.startProgress();
if (frame.getFunctionId() == UPDATE_STATUS_METHOD_ID)
publishStory(lastPost);
else if (frame.getFunctionId() == UPLOAD_PHOTO_METHOD_ID) {
String imgPath = null;
byte sourceFolderId = frame.getArgument(1)[0];
if (sourceFolderId == CameraUtils.FROM_ONESHEELD_FOLDER)
imgPath = CameraUtils
.getLastCapturedImagePathFromOneSheeldFolder(activity,true);
else if (sourceFolderId == CameraUtils.FROM_CAMERA_FOLDER)
imgPath = CameraUtils
.getLastCapturedImagePathFromCameraFolder(activity);
if (imgPath != null) {
uploadImage(imgPath, lastPost);
}
}
} else
Toast.makeText(
getApplication().getApplicationContext(),
R.string.general_toasts_please_check_your_internet_connection_and_try_again_toast,
Toast.LENGTH_SHORT).show();
}
}
}
示例4: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //导入方法依赖的package包/类
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
if (frame.getShieldId() == UIShield.CAMERA_SHIELD.getId()) {
switch (frame.getFunctionId()) {
case QUALITY_METHOD_ID:
byte quality_mode = frame.getArgument(0)[0];
switch (quality_mode) {
case 1:
QUALITY_MODE = 40;
break;
case 2:
QUALITY_MODE = 70;
break;
case 3:
QUALITY_MODE = 100;
break;
default:
break;
}
break;
case FLASH_METHOD_ID:
byte flash_mode = frame.getArgument(0)[0];
switch (flash_mode) {
case 0:
FLASH_MODE = "off";
break;
case 1:
FLASH_MODE = "on";
break;
case 2:
FLASH_MODE = "auto";
break;
default:
break;
}
break;
case CAPTURE_METHOD_ID:
numberOfFrames++;
Log.d("Camera", "Frames number = " + numberOfFrames);
CameraCapture camCapture = new CameraCapture(FLASH_MODE, false,
QUALITY_MODE, new Date().getTime());
if (capturesQueue == null)
capturesQueue = new ConcurrentLinkedQueue<>();
capturesQueue.add(camCapture);
checkQueue();
break;
case FRONT_CAPTURE:
numberOfFrames++;
Log.d("Camera", "Frames number front = " + numberOfFrames);
CameraCapture frontCamCapture = new CameraCapture(FLASH_MODE,
true, QUALITY_MODE, new Date().getTime());
if (capturesQueue == null)
capturesQueue = new ConcurrentLinkedQueue<>();
capturesQueue.add(frontCamCapture);
checkQueue();
break;
default:
break;
}
}
}