Exemplo n.º 1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            var view = inflater.Inflate(Resource.Layout.CurrencyChartFragment, container, false);

            //Gets the bottom toolbar
            var bottomToolbar = (Toolbar)view.FindViewById(Resource.Id.currencyToolbarChartFragment);

            bottomToolbar.InflateMenu(Resource.Menu.bot_currency_menu);
            bottomToolbar.MenuItemClick += BottomToolbar_MenuItemClick;

            string contents;

            using (StreamReader sr = new StreamReader(filePath))
            {
                contents = sr.ReadToEnd();
            }

            //Finds and sets the webview
            Android.Webkit.WebView localWebView = view.FindViewById <Android.Webkit.WebView>(Resource.Id.chartWebView);
            localWebView.Settings.JavaScriptEnabled        = true;
            localWebView.Settings.DomStorageEnabled        = true;
            localWebView.Settings.BlockNetworkImage        = false;
            localWebView.Settings.DisplayZoomControls      = true;
            localWebView.Settings.LoadsImagesAutomatically = true;
            localWebView.LoadUrl(pathUri);

            return(view);
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.SignUpActivity);

            FindViewById <TextView>(Resource.Id.toolbarTitle).Text     = "Qeydiyyat";
            FindViewById <ImageButton>(Resource.Id.backBtn).Visibility = ViewStates.Visible;

            webview = FindViewById <Android.Webkit.WebView>(Resource.Id.signUp); //new Android.Webkit.WebView(this);
            webview.Settings.JavaScriptEnabled = true;
            webview.Settings.AllowUniversalAccessFromFileURLs = true;
            webview.Settings.AllowFileAccessFromFileURLs      = true;
            webview.Settings.AllowFileAccess      = false;
            webview.Settings.UseWideViewPort      = true;
            webview.Settings.LoadWithOverviewMode = true;
            webview.Settings.BuiltInZoomControls  = false;
            webview.Settings.DisplayZoomControls  = false;
            // webview.Settings.SupportZoom();

            //webview.LoadUrl(string.Format("file:///android_asset/pdfjs/web/viewer.html?file={0}", string.Format("file:///{0}", "Ghaznavi Beirami və d..pdf")));
            webview.LoadUrl("https://eservice.e-health.gov.az/Login/Login/RegisterStep1");//, string.Format("file:///{0}", "Ghaznavi Beirami və d..pdf")));


            webview.SetWebChromeClient(new Android.Webkit.WebChromeClient());

            // Create your application here
        }
 public override void OnPageFinished(Android.Webkit.WebView view, string url)
 {
     if (!pageCommitted)
     {
         view.LoadUrl(url);
     }
     base.OnPageFinished(view, url);
 }
Exemplo n.º 4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Main);
            // SetUpMap();
            Android.Webkit.WebView webView = (Android.Webkit.WebView)FindViewById(Resource.Id.webView);
            webView.Settings.JavaScriptEnabled = true;
            webView.LoadUrl("http://maps.googleapis.com/maps/api/staticmap?ll=36.97,%20-122&lci=bike&z=13&t=p&size=500x500&sensor=true");
        }
Exemplo n.º 5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            webView = FindViewById <Android.Webkit.WebView>(Resource.Id.webView1);
            webView.Settings.JavaScriptEnabled = true;
            webView.SetWebViewClient(new HelloWebViewClient());
            webView.LoadUrl("http://xn--80abc3calbgl7f.xn--p1ai/");
        }
Exemplo n.º 6
0
        public void OnClick(View view)
        {
            Intent intent = new Intent();

            switch (view.Id)
            {
            case Resource.Id.ll_card_about_2_shop:
                intent.SetData(Android.Net.Uri.Parse(Constant.APP_URL));
                intent.SetAction(Intent.ActionView);
                StartActivity(intent);
                break;

            case Resource.Id.ll_card_about_2_email:
                intent.SetAction(Intent.ActionSendto);
                intent.SetData(Android.Net.Uri.Parse(Constant.EMAIL));
                intent.PutExtra(Intent.ExtraSubject, GetString(Resource.String.about_email_intent));
                //intent.putExtra(Intent.EXTRA_TEXT, "Hi,");
                try
                {
                    StartActivity(intent);
                }
                catch (Exception e)
                {
                    Toast.MakeText(this, GetString(Resource.String.about_not_found_email), ToastLength.Short).Show();
                }
                break;

            case Resource.Id.ll_card_about_source_licenses:
                Dialog dialog = new Dialog(this, Resource.Style.DialogFullscreenWithTitle);
                dialog.SetTitle(GetString(Resource.String.about_source_licenses));
                dialog.SetContentView(Resource.Layout.dialog_source_licenses);

                Android.Webkit.WebView webView = dialog.FindViewById <Android.Webkit.WebView>(Resource.Id.web_source_licenses);
                webView.LoadUrl("file:///android_asset/source_licenses.html");

                Button btn_source_licenses_close = dialog.FindViewById <Button>(Resource.Id.btn_source_licenses_close);
                btn_source_licenses_close.SetOnClickListener(new BtnClickListener(dialog));
                dialog.Show();

                break;

            case Resource.Id.ll_card_about_2_git_hub:
                intent.SetData(Android.Net.Uri.Parse(Constant.GIT_HUB));
                intent.SetAction(Intent.ActionView);
                StartActivity(intent);
                break;

            case Resource.Id.fab_about_share:
                intent.SetAction(Intent.ActionSend);
                intent.PutExtra(Intent.ExtraText, Constant.SHARE_CONTENT);
                intent.SetType("text/plain");
                StartActivity(Intent.CreateChooser(intent, GetString(Resource.String.share_with)));
                break;
            }
        }
 public override bool ShouldOverrideUrlLoading(Android.Webkit.WebView view, string url)
 {
     try
     {
         if (url.EndsWith("pdf"))
         {
             pdfUrl = url;
             webView.LoadUrl("https://drive.google.com/viewerng/viewer?embedded=true&url=" + url);
         }
     }
     catch (Exception e)
     {
     }
     return(base.ShouldOverrideUrlLoading(view, url));
 }
        public override Object InstantiateItem(ViewGroup container, int position)
        {
            TabItem tab = TabCollection?[position];

            if (tab != null)
            {
                Android.Webkit.WebView webView = new Android.Webkit.WebView(termsAndPrivacyRenderer.Context);
                webView.Settings.JavaScriptEnabled = true;
                webView.LoadUrl(tab.Uri);

                container.AddView(webView);
                return(webView);
            }
            return(base.InstantiateItem(container, position));
        }
Exemplo n.º 9
0
        public bool ShowWebView(ref String _strUri)
        {
            bool bRst = true;

            try
            {
                m_webView.LoadUrl(_strUri);
                m_textUri.Text = _strUri;
            }
            catch (Exception)
            {
                bRst = false;
            }

            return(bRst);
        }
 public void Run()
 {
     _webView = new Android.Webkit.WebView(PrintServiceAndroidHelper.ActivityInstance);
     _webView.LoadUrl(_url);
     PrintServiceAndroidHelper.PrintFromWebView(_webView, _printJobConfiguration);
 }
Exemplo n.º 11
0
        private void DisplayMotoDetails()
        {
            if (DetectedPlate == "" && DetectedMotoModel == "")
            {
                return;
            }

            var alert = new AlertDialog.Builder(this);
            var view  = new BlankView(this);

            alert.SetView(view);

            var lID = Resource.Id.BlankLayoutContainer;

            if (DetectedPlate != "")
            {
                s.CreateAndAddLabelBoxRow(view, lID, "VERIFICAR PLACA");
                s.CreateAndAddLabelBoxRow(view, lID, "Placa: " + DetectedPlate);
                s.CreateAndAddDescriptionRow2(view, lID, "Insira a placa detectada nos campos abaixo para verificar marca, modelo e outras informações do veículo.");

                s.CreateAndAddDescriptionRow2(view, lID, "");

                var url = "https://cidadao.sinesp.gov.br/sinesp-cidadao/";

                var web = new Android.Webkit.WebView(this);

                web.LoadUrl(url);

                LinearLayout.LayoutParams param2 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent, 1.0f);
                param2.LeftMargin   = (int)(5 + 0.5f);
                param2.RightMargin  = (int)(5 + 0.5f);
                param2.TopMargin    = (int)(5 + 0.5f);
                param2.BottomMargin = (int)(5 + 0.5f);
                param2.Weight       = 1.0f;

                web.LayoutParameters = param2;

                var layout = view.FindViewById <LinearLayout>(lID);

                layout.AddView(web);
            }
            else
            {
                if (MotosList.ContainsKey(DetectedMotoModel))
                {
                    s.CreateAndAddLabelBoxRow(view, lID, "INFORMAÇÕES");

                    var moto = MotosList[DetectedMotoModel];

                    s.CreateAndAddDescriptionRow(view, lID, "Fabricante", moto.Fabricante);
                    s.CreateAndAddDescriptionRow(view, lID, "Modelo", moto.Modelo);
                    s.CreateAndAddDescriptionRow(view, lID, "Ciclo", moto.Ciclo);
                    s.CreateAndAddDescriptionRow(view, lID, "Cilindrada (cm3)", moto.Volume);
                    s.CreateAndAddDescriptionRow(view, lID, "Potência (cv)", moto.Potencia);
                    s.CreateAndAddDescriptionRow(view, lID, "Peso (kg)", moto.Peso);
                    s.CreateAndAddDescriptionRow(view, lID, "Peso/Potência (kg/cv)", moto.Peso_Pot);
                    s.CreateAndAddDescriptionRow(view, lID, "Comprimento (mm)", moto.Comprimento);
                    s.CreateAndAddDescriptionRow(view, lID, "Largura (mm)", moto.Largura);
                    s.CreateAndAddDescriptionRow(view, lID, "Altura (mm)", moto.Altura);
                    s.CreateAndAddDescriptionRow(view, lID, "Altura do Assento (mm)", moto.Altura_Assento);
                }
            }

            alert.SetCancelable(true);
            alert.SetPositiveButton("OK", (sender, e2) =>
            {
            });
            alert.Create().Show();
        }
Exemplo n.º 12
0
 public override void OnPageFinished(Android.Webkit.WebView view, string url) {
     base.OnPageFinished(view, url);
     view.LoadUrl("javascript:{(function() { window.alert('something'); })()};");
 }
 public void LoadUrl(string path) => webView.LoadUrl(path);