Exemple #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            var container = (LinearLayout)FindViewById(Resource.Id.container);

            var title = container.FindViewById <TextView>(Resource.Id.textView);

            title.Text = Texts.scanbot_sdk_demo;

            progress = FindViewById <ProgressBar>(Resource.Id.progressBar);

            var scanner      = (LinearLayout)container.FindViewById(Resource.Id.document_scanner);
            var scannerTitle = (TextView)scanner.FindViewById(Resource.Id.textView);

            scannerTitle.Text = DocumentScanner.Instance.Title;

            foreach (ListItem item in DocumentScanner.Instance.Items)
            {
                var child = new FragmentButton(this)
                {
                    Data             = item,
                    Text             = item.Title,
                    LayoutParameters = GetParameters()
                };
                scanner.AddView(child);
                buttons.Add(child);
            }

            var collectors      = (LinearLayout)container.FindViewById(Resource.Id.data_collectors);
            var collectorsTitle = (TextView)collectors.FindViewById(Resource.Id.textView);

            collectorsTitle.Text = DataDetectors.Instance.Title;

            foreach (ListItem item in DataDetectors.Instance.Items)
            {
                var child = new FragmentButton(this)
                {
                    Data             = item,
                    Text             = item.Title,
                    LayoutParameters = GetParameters()
                };
                collectors.AddView(child);
                buttons.Add(child);
            }

            LicenseIndicator.Text = Texts.no_license_found_the_app_will_terminate_after_one_minute;
        }
 void AddItemsTo(LinearLayout container, List <ListItem> items)
 {
     foreach (ListItem item in items)
     {
         var child = new FragmentButton(this)
         {
             Data             = item,
             Text             = item.Title,
             LayoutParameters = ViewUtils.GetParameters(this)
         };
         container.AddView(child);
         buttons.Add(child);
     }
 }