protected override void OnCreate(Bundle bundle) { Log.Debug(TAG, "Creating a new RedLaserSDK object"); var settings = new RedLaserSettings(); settings.AlignBarcode = "Align barcode inside box"; settings.HoldStill = "Hold still for scan"; base.OnCreate (bundle, settings); var extras = Intent.Extras.GetBundle("ScanBundle"); Hints.Upce = extras.GetBoolean(DO_UPCE); Hints.Ean8 = extras.GetBoolean(DO_EAN8); Hints.Ean13 = extras.GetBoolean(DO_EAN13); Hints.QRCode = extras.GetBoolean(DO_QRCODE); Hints.Code128 = extras.GetBoolean(DO_CODE128); Hints.Code39 = extras.GetBoolean(DO_CODE39); Hints.Code93 = extras.GetBoolean(DO_CODE93); Hints.DataMatrix = extras.GetBoolean(DO_DATAMATRIX); Hints.ITF = extras.GetBoolean(DO_ITF); Hints.RSS14 = extras.GetBoolean(DO_RSS14); Hints.Sticky = extras.GetBoolean(DO_STICKY); //SetButtons("Button", "Button 2", "Button 3"); Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); }
protected virtual void OnCreate(Bundle bundle, RedLaserSettings settings) { base.OnCreate (bundle); this.settings = settings; StatusManager.Initialize(this); Log.Debug(TAG, "Starting capture activity"); var window = Window; window.AddFlags(WindowManagerFlags.KeepScreenOn); this.mBarcodeScanLayout = new BarcodeScanLayout(this, this.settings.HoldStill, this.settings.AlignBarcode); SetContentView(this.mBarcodeScanLayout); var metrics = new DisplayMetrics(); WindowManager.DefaultDisplay.GetMetrics(metrics); this.mWidth = metrics.WidthPixels; this.mHeight = metrics.HeightPixels; this.mDensity = metrics.Density; var logo = new ImageView(this); logo.SetScaleType(ImageView.ScaleType.Matrix); logo.SetImageResource(LogoResource); var matrix = new Matrix(); matrix.PostRotate(270.0f); if(mWidth < mHeight) { var temp = mWidth; mWidth = mHeight; mHeight = temp; } var offset = 0; if(mDensity == 1.0f) { offset = 100; } matrix.PostTranslate((float)(mWidth / 2.0d + mWidth / 8 * mDensity) + offset, (float)(mHeight / 2.80 + 160.0f * mDensity)); logo.ImageMatrix = matrix; CameraManager.Init(Application); viewfinderView = mBarcodeScanLayout.ViewFinderView; handler = null; hasSurface = false; }