chrome-custom-tabs

setCloseButtonIcon(Bitmap drawable) is not working with SVGs in ChromeCustomTab

做~自己de王妃 提交于 2019-12-02 08:03:46
I need to change the default cross-icon in ChromeCustomTab Android, I am changing it with back-icon using the code below: Bitmap icon = BitmapFactory.decodeResource(context.getResources(),R.drawable.ic_arrow_back_white_24dp); It is working fine with PNGs but not with SVGs. As per this documentation, we have to maintain size of image according to this documentation. https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent.html#KEY_ICON I think it is not working because they are not following the dimensions given in Documentation. You need to return a valid Bitmap .

Android Chrome Custom Tabs add Copy Link to options menu

跟風遠走 提交于 2019-12-01 17:50:52
How to add 'Copy link' option to Chrome Custom Tabs options menu in Android. Adding custom menu items in CustomTabs is like this. CustomTabsIntent.Builder customTabsIntent = new CustomTabsIntent.Builder(); String menuItemTitle = App.s(R.string.share); PendingIntent menuItemPendingIntent = createPendingIntentShare(url); customTabsIntent.addMenuItem(menuItemTitle, menuItemPendingIntent); I want to add Copy Link option just like Twitter do in his app browser. I am not sure how I can copy link to Clipboard in CustomTabs. Create a BroadcastReceiver : public class CustomTabsBroadcastReceiver extends

Can I inject Javascript code into Chrome Custom Tabs

佐手、 提交于 2019-12-01 15:39:22
In my app, I am currently using a web view to display some content. Then, I use Javascript injection to quickly fill out the form for the user. The only issue is, Webviews are incredibly slow compared to Chrome Custom tabs. Is it possible to inject Javascript code into these custom tabs? For example, here is some code I currently use: myWebView.loadUrl("javascript:document.getElementById('join_first_name').value='" + name + "';void(0); "); No; that would be a critical security hole. Since custom tabs use cookies, settings, and password managers from the user's real Chrome instance, you cannot

Can I inject Javascript code into Chrome Custom Tabs

纵饮孤独 提交于 2019-12-01 13:44:09
问题 In my app, I am currently using a web view to display some content. Then, I use Javascript injection to quickly fill out the form for the user. The only issue is, Webviews are incredibly slow compared to Chrome Custom tabs. Is it possible to inject Javascript code into these custom tabs? For example, here is some code I currently use: myWebView.loadUrl("javascript:document.getElementById('join_first_name').value='" + name + "';void(0); "); 回答1: No; that would be a critical security hole.

Is there any way to load html content in chrome custom tab

你说的曾经没有我的故事 提交于 2019-12-01 07:55:13
Is it possible to load local html content using chrome custom tab in android? I searched the web, could not find the solution, can anyone help.. It's not possible to directly load HTML content using Chrome Custom Tabs but you could try saving the content to a local file and providing a file:// URL to see if that works. 来源: https://stackoverflow.com/questions/38179084/is-there-any-way-to-load-html-content-in-chrome-custom-tab

Is there any way to load html content in chrome custom tab

╄→尐↘猪︶ㄣ 提交于 2019-12-01 06:53:35
问题 Is it possible to load local html content using chrome custom tab in android? I searched the web, could not find the solution, can anyone help.. 回答1: It's not possible to directly load HTML content using Chrome Custom Tabs but you could try saving the content to a local file and providing a file:// URL to see if that works. 来源: https://stackoverflow.com/questions/38179084/is-there-any-way-to-load-html-content-in-chrome-custom-tab

Chrome Custom Tab does not go back to app

北慕城南 提交于 2019-12-01 05:16:45
I have a WebView that loads a HTML with links inside. Those links are opened using Chrome Custom Tabs. Strange scenario: Open Chrome browser Open app Press any link (this will open a Chrome Custom Tab) Press the back button or the "x" button on the Custom Tab Instead of going back to the app the chrome browser is shown. [updated] The launch mode of my activity, set in the AndroidManifest, is singleInstance. The problem is that my activity had the launch mode "singleInstance". Changing to "singleTask" or not having a launchMode set in the AndroidManifest solves the problem. Don't know why is

Lock orientation for custom tabs

送分小仙女□ 提交于 2019-12-01 05:14:44
I would like to lock the orientation using Chrome Custom Tabs. Is this something I can do with the Low Level API or do I need to get a new method added for this functionality? My use case is that I have an app that has custom tabs and I want it to always show the custom tab in portrait, never landscape. Custom Tabs does not currently provide an API that allows the developer to lock the orientation. As a best practice, developers should always think twice before forcing a specific orientation, as it may be annoying to force the user to use one. Locking the orientation looks more like something

How to hide url in Chrome custom tab android

随声附和 提交于 2019-12-01 02:43:47
I have implemented new Chrome Custom Tab in android, I am using the following code to open Uri uri = Uri.parse("https://akash.plobal.com/ploicy"); CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder(); intentBuilder.setToolbarColor(Color.BLACK); intentBuilder.setShowTitle(true); intentBuilder.build().launchUrl(getActivity(), uri); I need to hide url below the title in toolbar It is not currently possible to hide the url below the title. The urls needs to visible to the user, so that they can know in which site they are. By removing this from the UI, a malicious site could

Chrome Custom Tab does not go back to app

老子叫甜甜 提交于 2019-12-01 02:24:24
问题 I have a WebView that loads a HTML with links inside. Those links are opened using Chrome Custom Tabs. Strange scenario: Open Chrome browser Open app Press any link (this will open a Chrome Custom Tab) Press the back button or the "x" button on the Custom Tab Instead of going back to the app the chrome browser is shown. [updated] The launch mode of my activity, set in the AndroidManifest, is singleInstance. 回答1: The problem is that my activity had the launch mode "singleInstance". Changing to