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);
             }
         }
     }
 }
Esempio n. 2
0
 public virtual void AddFootView(Android.Views.View view)
 {
     mFootViews.Put(mFootViews.Size() + BaseItemTypeFooter, view);
 }
Esempio n. 3
0
 public virtual void AddHeaderView(Android.Views.View view)
 {
     mHeaderViews.Put(mHeaderViews.Size() + BaseItemTypeHeader, view);
 }
 public virtual int GetItemViewDelegateCount()
 {
     return(delegates.Size());
 }