目录

RemoteView

Class Info

public class RemoteView extends FrameLayout

控制相机预览和扫码的视图,用于Customized View Mode扫码方式。

Nested Class Summary

Qualifier and Type

Class Name and Description

static class

RemoteView.Builder

用来构造RemoteView的工具类。

Public Method Summary

Qualifier and Type

Method Name and Description

boolean

getLightStatus()

获取闪光灯状态。

void

onCreate(Bundle saveInstance)

用于RemoteView的生命周期管理,需要您显式调用,通常在发起调用的Activity的onCreate函数中调用。

final void

onDestroy()

用于RemoteView的生命周期管理,需要您显式调用,通常在发起调用的Activity的onDestroy函数中调用。

final void

onPause()

用于RemoteView的生命周期管理,需要您显式调用,通常在发起调用的Activity的onPause函数中调用。

final void

onResume()

用于RemoteView的生命周期管理,需要您显式调用,通常在发起调用的Activity的onResume函数中调用。

final void

onStart()

用于RemoteView的生命周期管理,需要您显式调用,通常在发起调用的Activity的onStart函数中调用。

final void

onStop()

用于RemoteView的生命周期管理,需要您显式调用,通常在发起调用的Activity的onStop函数中调用。

void

pauseContinuouslyScan()

暂停扫码。

void

resumeContinuouslyScan()

恢复扫码。

void

setOnLightVisibleCallback(OnLightVisibleCallBack onLightVisibleCallBack)

设置判断环境光亮明暗监听。

void

setOnResultCallback(OnResultCallback onResultCallback)

设置扫码结果回调接口。

boolean

switchLight()

切换闪光灯。

Public Methods

[h2]getLightStatus

Method

public boolean getLightStatus()

获取闪光灯状态。

Returns

Type

Description

boolean

闪光灯状态。
  • true:闪光灯开启状态。
  • false:闪光灯关闭状态。

[h2]onCreate

Method

public void onCreate(Bundle saveInstance)

用于RemoteView的生命周期管理,需要您显式调用,通常在发起调用的Activity的onCreate函数中调用。

Parameters

Name

Description

saveInstance

保存上一个状态的变量。

[h2]onDestroy

Method

public final void onDestroy()

用于RemoteView的生命周期管理,需要您显式调用,通常在发起调用的Activity的onDestroy函数中调用。

[h2]onPause

Method

public final void onPause()

用于RemoteView的生命周期管理,需要您显式调用,通常在发起调用的Activity的onPause函数中调用。

[h2]onResume

Method

public final void onResume()

用于RemoteView的生命周期管理,需要您显式调用,通常在发起调用的Activity的onResume函数中调用。

[h2]onStart

Method

public final void onStart()

用于RemoteView的生命周期管理,需要您显式调用,通常在发起调用的Activity的onStart函数中调用。

[h2]onStop

Method

public final void onStop()

用于RemoteView的生命周期管理,需要您显式调用,通常在发起调用的Activity的onStop函数中调用。

[h2]pauseContinuouslyScan

Method

public void pauseContinuouslyScan()

暂停扫码。

[h2]resumeContinuouslyScan

Method

public void resumeContinuouslyScan()

恢复扫码。

[h2]setOnLightVisibleCallback

Method

public void setOnLightVisibleCallback(OnLightVisibleCallBack onLightVisibleCallBack)

设置判断环境光亮明暗监听。

Parameters

Name

Description

onLightVisibleCallBack

根据环境光亮明暗实现回调函数,光线由明亮到暗或由暗到明亮回调,后续处理由您实现。

[h2]setOnResultCallback

Method

public void setOnResultCallback(OnResultCallback onResultCallback)

设置扫码结果回调接口。

Parameters

Name

Description

onResultCallback

您接收结果的接口,由您实现。

[h2]switchLight

Method

public boolean switchLight()

切换闪光灯。

Returns

Type

Description

boolean

操作结果。

  • true:切换成功。
  • false:切换失败。