Esempio n. 1
0
        public virtual void OnServiceConnected(CustomTabsClient client)
        {
            System.Diagnostics.Debug.WriteLine("CustomTabsActivityHelper.OnServiceConnected");

            custom_tabs_client = client;
            if (CustomTabsConfiguration.IsWarmUpUsed)
            {
                System.Diagnostics.Debug.WriteLine("    warmup");

                custom_tabs_client.Warmup(0L);
            }
            if (connection_callback != null)
            {
                System.Diagnostics.Debug.WriteLine("    connection_callback.OnCustomTabsConnected()");

                connection_callback.OnCustomTabsConnected();
            }

            return;
        }
Esempio n. 2
0
 public override void OnCustomTabsServiceConnected(ComponentName name, CustomTabsClient client)
 {
     customTabsServiceConnected?.Invoke(client);
 }
        private static void CustomTabsActivityManager_CustomTabsServiceConnected(ComponentName name, CustomTabsClient client)
        {
            var builder = new CustomTabsIntent.Builder(_customTabs.Session)
                          .SetToolbarColor(Color.Rgb(255, 255, 255))
                          .SetShowTitle(true)
                          .EnableUrlBarHiding();

            var customTabsIntent = builder.Build();

            //THESE FLAGS ARE VERY IMPORTANT. PLEASE READ DOCUMENTATION: https://developer.android.com/reference/android/content/Intent
            customTabsIntent.Intent.AddFlags(ActivityFlags.ClearTop | ActivityFlags.SingleTop);

            var ctx = Platform.CurrentActivity;

            CustomTabsHelper.AddKeepAliveExtra(ctx, customTabsIntent.Intent);

            customTabsIntent.LaunchUrl(ctx, global::Android.Net.Uri.Parse(_uri.OriginalString));
        }
        static void CustomTabsActivityManager_CustomTabsServiceConnected(ComponentName name, CustomTabsClient client)
        {
            var builder = new CustomTabsIntent.Builder(CustomTabsActivityManager.Session)
                          .SetShowTitle(true);

            var customTabsIntent = builder.Build();

            customTabsIntent.Intent.AddFlags(ActivityFlags.SingleTop | ActivityFlags.NoHistory | ActivityFlags.NewTask);

            CustomTabsHelper.AddKeepAliveExtra(ParentActivity, customTabsIntent.Intent);

            customTabsIntent.LaunchUrl(ParentActivity, global::Android.Net.Uri.Parse(uri.OriginalString));
        }
Esempio n. 5
0
 public override void OnServiceDisconnected(ComponentName name)
 {
     Client = null;
 }
Esempio n. 6
0
 public override void OnCustomTabsServiceConnected(ComponentName name, CustomTabsClient client)
 {
     Client = client;
     Client.Warmup(0L);
     Session = Client.NewSession(callback: null);
 }
 public void OnServiceDisconnected()
 {
     mClient            = null;
     mCustomTabsSession = null;
     mConnectionCallback?.OnCustomTabsDisconnected();
 }
 public void OnServiceConnected(CustomTabsClient client)
 {
     mClient = client;
     mClient.Warmup(0L);
     mConnectionCallback?.OnCustomTabsConnected();
 }
Esempio n. 9
0
 private void OnConnected(CustomTabsClient client)
 {
     this.client = client;
 }