本文整理汇总了Java中com.google.zxing.client.android.InactivityTimer类的典型用法代码示例。如果您正苦于以下问题:Java InactivityTimer类的具体用法?Java InactivityTimer怎么用?Java InactivityTimer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InactivityTimer类属于com.google.zxing.client.android包,在下文中一共展示了InactivityTimer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ScanHelper
import com.google.zxing.client.android.InactivityTimer; //导入依赖的package包/类
public ScanHelper(Activity activity, SurfaceView surfaceView) {
this.activity = activity;
this.capturePreview = surfaceView;
this.hasSurface = false;
this.mInactivityTimer = new InactivityTimer(activity);
this.mBeepManager = new BeepManager(activity);
}
示例2: onCreateView
import com.google.zxing.client.android.InactivityTimer; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_section_scan, container, false);
FrameLayout frameLayout = (FrameLayout) view.findViewById(R.id.camera_preview);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
surfaceView = new SurfaceView(getActivity());
surfaceView.setLayoutParams(layoutParams);
viewfinderView = new ViewfinderView(getActivity());
viewfinderView.setLayoutParams(layoutParams);
frameLayout.addView(surfaceView);
frameLayout.addView(viewfinderView);
inactivityTimer = new InactivityTimer(this.getActivity());
ambientLightManager = new AmbientLightManager(this.getActivity());
Button closeButton = (Button) view.findViewById(R.id.button_close);
closeButton.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
if (listener != null) {
listener.onButtonClick(PayPageState.PAY_FORM, null);
} else {
Log.e("", "WTF Listener null");
}
}
}
);
return view;
}
示例3: onCreate
import com.google.zxing.client.android.InactivityTimer; //导入依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
hasSurface = false;
inactivityTimer = new InactivityTimer(getActivity());
beepManager = new BeepManager(getActivity());
ambientLightManager = new AmbientLightManager(getActivity());
PreferenceManager.setDefaultValues(getActivity(), R.xml.preferences, false);
}