public ViewHolder(Android.Content.Context context, Android.Views.View itemView) : base(itemView) { mContext = context; mConvertView = itemView; mViews = new Android.Util.SparseArray <Android.Views.View>(); }
public ViewHolder(Android.Content.Context context, Android.Views.View itemView, Android.Views.ViewGroup parent, int position) { mContext = context; mConvertView = itemView; mPosition = position; mViews = new Android.Util.SparseArray <Android.Views.View>(); mConvertView.Tag = new Jbox <ViewHolder>(this); }
public void ReceiveDetections(Detector.Detections detections) { Android.Util.SparseArray barcodes = detections.DetectedItems; for (int i = 0; i < barcodes.Size(); i++) { Barcode barcode = barcodes.ValueAt(i) as Barcode; string value = barcode.DisplayValue; try { Uri appId = Uri.Parse(value); if (!appId.Scheme.Equals("layer")) { throw new Java.Lang.IllegalArgumentException("URI is not an App ID"); } if (!appId.Authority.Equals("")) { throw new Java.Lang.IllegalArgumentException("URI is not an App ID"); } IList <string> segments = appId.PathSegments; if (segments.Count != 3) { throw new Java.Lang.IllegalArgumentException("URI is not an App ID"); } if (!segments[0].Equals("apps")) { throw new Java.Lang.IllegalArgumentException("URI is not an App ID"); } if (!segments[1].Equals("staging") && !segments[1].Equals("production")) { throw new Java.Lang.IllegalArgumentException("URI is not an App ID"); } UUID uuid = UUID.FromString(segments[2]); if (Util.Log.IsLoggable(Util.Log.VERBOSE)) { Util.Log.v("Captured Layer App ID: " + appId + ", UUID: " + uuid); } if (_appIdScanner.mAppIdCallback == null) { return; } _appIdScanner.mAppIdCallback.OnLayerAppIdScanned(_appIdScanner, appId.ToString()); } catch (System.Exception e) { // Not this barcode... if (Util.Log.IsLoggable(Util.Log.ERROR)) { Util.Log.e("Barcode does not contain an App ID URI: " + value, e); } } } }