Search in sources :

Example 11 with CustomTabsIntent

use of android.support.customtabs.CustomTabsIntent in project XposedInstaller by rovo89.

the class NavUtil method startURL.

public static void startURL(Activity activity, Uri uri) {
    if (!XposedApp.getPreferences().getBoolean("chrome_tabs", true)) {
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
        intent.putExtra(Browser.EXTRA_APPLICATION_ID, activity.getPackageName());
        activity.startActivity(intent);
        return;
    }
    CustomTabsIntent.Builder customTabsIntent = new CustomTabsIntent.Builder();
    customTabsIntent.setShowTitle(true);
    customTabsIntent.setToolbarColor(activity.getResources().getColor(R.color.colorPrimary));
    customTabsIntent.build().launchUrl(activity, uri);
}
Also used : CustomTabsIntent(android.support.customtabs.CustomTabsIntent) CustomTabsIntent(android.support.customtabs.CustomTabsIntent) Intent(android.content.Intent)

Example 12 with CustomTabsIntent

use of android.support.customtabs.CustomTabsIntent in project actor-platform by actorapp.

the class BaseUrlSpan method buildChromeIntent.

public static CustomTabsIntent buildChromeIntent() {
    CustomTabsIntent.Builder customTabsIntent = new CustomTabsIntent.Builder();
    //        Intent sendIntent = new Intent(Intent.ACTION_SEND);
    //        sendIntent.setType("*/*");
    //        PendingIntent pi = PendingIntent.getActivity(AndroidContext.getContext()    , 0, sendIntent, 0);
    Intent actionIntent = new Intent(AndroidContext.getContext(), ChromeCustomTabReceiver.class);
    PendingIntent pi = PendingIntent.getBroadcast(AndroidContext.getContext(), 0, actionIntent, 0);
    customTabsIntent.setToolbarColor(ActorSDK.sharedActor().style.getMainColor()).setActionButton(BitmapFactory.decodeResource(AndroidContext.getContext().getResources(), R.drawable.ic_share_white_24dp), "Share", pi).setCloseButtonIcon(BitmapFactory.decodeResource(AndroidContext.getContext().getResources(), R.drawable.ic_arrow_back_white_24dp));
    return customTabsIntent.build();
}
Also used : CustomTabsIntent(android.support.customtabs.CustomTabsIntent) CustomTabsIntent(android.support.customtabs.CustomTabsIntent) Intent(android.content.Intent) PendingIntent(android.app.PendingIntent) PendingIntent(android.app.PendingIntent)

Aggregations

CustomTabsIntent (android.support.customtabs.CustomTabsIntent)12 Intent (android.content.Intent)7 PendingIntent (android.app.PendingIntent)3 ActivityNotFoundException (android.content.ActivityNotFoundException)3 Context (android.content.Context)1 PackageInfo (android.content.pm.PackageInfo)1 PackageManager (android.content.pm.PackageManager)1 Uri (android.net.Uri)1 Handler (android.os.Handler)1 TaskStackBuilder (android.support.v4.app.TaskStackBuilder)1 Toolbar (android.support.v7.widget.Toolbar)1 SpannableStringBuilder (android.text.SpannableStringBuilder)1 LinkMovementMethod (android.text.method.LinkMovementMethod)1 View (android.view.View)1 TextView (android.widget.TextView)1 BillingActivity (com.battlelancer.seriesguide.billing.BillingActivity)1 AmazonBillingActivity (com.battlelancer.seriesguide.billing.amazon.AmazonBillingActivity)1 Artwork (com.google.android.apps.muzei.api.Artwork)1 Date (java.util.Date)1