本文整理匯總了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);
}