1
0
Fork 0

For #2836: Fixes custom tab close button color

master
Sawyer Blatz 2019-05-31 07:41:27 -07:00 committed by Jeff Boek
parent 301984733a
commit 35a745d67d
1 changed files with 3 additions and 0 deletions

View File

@ -10,6 +10,8 @@ import android.content.pm.PackageManager
import android.net.Uri
import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.IntentReceiverActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.getColorFromAttr
import java.io.UnsupportedEncodingException
import java.net.URLEncoder
import java.util.Locale
@ -45,6 +47,7 @@ object SupportUtils {
}
fun createCustomTabIntent(context: Context, url: String) = Intent(Intent.ACTION_VIEW).apply {
putExtra("android.support.customtabs.extra.TOOLBAR_COLOR", R.attr.foundation.getColorFromAttr(context))
putExtra("android.support.customtabs.extra.SESSION", true)
setClassName(context.applicationContext, IntentReceiverActivity::class.java.name)
data = Uri.parse(url)