private void SetBubbleVisibilityOnMainThread(TrackedBarcode barcode, bool visible) { this.mainHandler.Post(() => { this.listener?.SetBubbleVisibility(barcode, visible); }); }
public View ViewForTrackedBarcode(BarcodeTrackingAdvancedOverlay overlay, TrackedBarcode trackedBarcode) { return(this.listener?.GetOrCreateViewForBubbleData( trackedBarcode, this.bubbleDataProvider.GetDataForBarcode(trackedBarcode.Barcode.Data), this.listener.ShouldShowBubble(trackedBarcode))); }
private bool ShouldHideOverlay(TrackedBarcode trackedCode, nfloat captureViewWidth) { // If the barcode is wider than the desired percent of the data capture view's width, // show it to the user. var width = trackedCode.Location.Width(this.captureView); return((width / captureViewWidth) <= BarcodeToScreenTresholdRatio); }
public int GetColorForCode(TrackedBarcode barcode, long trackingId) { if (!bubbles.ContainsKey(trackingId)) { return(0); } return(bubbles[trackingId].highlightColor); }
private UIOffset GetYOffSet(TrackedBarcode code) { var barcodeHeight = GetBarcodeHeight(code.PredictedLocation); var stockViewHeight = StockView.StandardHeight; const float stockViewDistance = 8.0f; var yOffset = -(barcodeHeight / 2 + stockViewHeight / 2 + stockViewDistance); return(new UIOffset(0, yOffset)); }
public PointWithUnit OffsetForTrackedBarcode( BarcodeTrackingAdvancedOverlay overlay, TrackedBarcode trackedBarcode, View view) { // We want to center the view on top of the barcode. return(new PointWithUnit( new FloatWithUnit(0f, MeasureUnit.Fraction), new FloatWithUnit(-1f, MeasureUnit.Fraction))); }
public View GetViewForCode(TrackedBarcode barcode, long trackingId) { if (!bubbles.ContainsKey(trackingId)) { return(null); } LayoutInflater inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService); return(bubbles[trackingId].GetView(context, inflater)); }
public Brush BrushForTrackedBarcode(BarcodeTrackingBasicOverlay overlay, TrackedBarcode trackedBarcode) { if (IsValidBarcode(trackedBarcode.Barcode)) { return(defaultBrush); } else { return(rejectedBrush); } }
public Point GetOffsetForCode(TrackedBarcode barcode, long trackingId) { if (!bubbles.ContainsKey(trackingId)) { return(null); } BaseBubble indicator = bubbles[trackingId]; return(new Point(-UiUtils.PxFromDp(context, indicator.GetWidth()) / 2, -UiUtils.PxFromDp(context, indicator.GetHeight()))); }
public BaseBubble CreateBubble(IndicatorState indicatorState, TrackedBarcode barcode) { BubbleData barcodeData = MockBubbleDataObject(barcode.Data); switch (indicatorState) { case IndicatorState.MINIMISED: return(new MinimisedBubble(context, barcodeData)); case IndicatorState.MAXIMISED: return(new MaximisedBubble(context, barcodeData)); default: return(new NoBubble(context, barcodeData)); } }
private UIView CreateStockOverlay(TrackedBarcode trackedBarcode) { var identifier = trackedBarcode.Identifier; UIView overlay; if (this.overlays.Keys.Contains(identifier)) { overlay = this.overlays[identifier]; } else { // Get the information you want to show from your back end system/database. overlay = StockOverlay.Create(ShelfCount, BackroomCount, trackedBarcode.Barcode.Data); this.overlays[identifier] = overlay; } overlay.Hidden = this.ShouldHideOverlay(trackedBarcode, this.captureView.Frame.Width); return(overlay); }
public Brush BrushForTrackedBarcode(BarcodeTrackingBasicOverlay overlay, TrackedBarcode trackedBarcode) { return(BrushExtensions.HighlightedBrush); }
public void OnTrackedBarcodeTapped(BarcodeTrackingBasicOverlay overlay, TrackedBarcode trackedBarcode) { // Handle barcode click if necessary. }
public Anchor AnchorForTrackedBarcode( BarcodeTrackingAdvancedOverlay overlay, TrackedBarcode trackedBarcode) { return(Anchor.TopCenter); }
public bool ShouldRejectCode(MatrixScan matrixScan, TrackedBarcode barcode) { return(false); }
public PointWithUnit OffsetForTrackedBarcode(BarcodeTrackingAdvancedOverlay overlay, TrackedBarcode trackedBarcode) { // We set the offset's height to be equal of the 100 percent of our overlay. // The minus sign means that the overlay will be above the barcode. return(new PointWithUnit() { X = new FloatWithUnit() { Value = 0, Unit = MeasureUnit.Fraction }, Y = new FloatWithUnit() { Value = -1, Unit = MeasureUnit.Fraction } }); }
public Anchor AnchorForTrackedBarcode(BarcodeTrackingAdvancedOverlay overlay, TrackedBarcode trackedBarcode) { // The offset of our overlay will be calculated from the top center anchoring point. return(Anchor.TopCenter); }
public UIView ViewForTrackedBarcode(BarcodeTrackingAdvancedOverlay overlay, TrackedBarcode trackedBarcode) { return(CreateStockOverlay(trackedBarcode)); }
public Scandit.DataCapture.Core.UI.Style.Brush BrushForTrackedBarcode(BarcodeTrackingBasicOverlay overlay, TrackedBarcode trackedBarcode) { return(this.Element.TrackedBarcodesBrush.ConvertToNative()); }
public void OnCodeTouched(TrackedBarcode barcode, long trackingId) { bubbleClickAction(barcode); }
public void OnTrackedBarcodeTapped(BarcodeTrackingBasicOverlay overlay, TrackedBarcode trackedBarcode) { }
void BubbleClick(TrackedBarcode barcode) { detail.Text = barcode.Data; detail.Visibility = ViewStates.Visible; }
public NativeBrush BrushForTrackedBarcode(BarcodeTrackingBasicOverlay overlay, TrackedBarcode trackedBarcode) { // This method is used to change the overlay color for a tracked barcode. return(this.Element.TrackedBarcodesBrush.ConvertToNative()); }