mindorks-cct is a sample application showing use of Chrome Custom Tabs with new androidx library.
dependencies {
implementation 'androidx.browser:browser:1.0.0'
}
val builder = CustomTabsIntent.Builder()
builder.setToolbarColor(ContextCompat.getColor(this@MainActivity, R.color.colorPrimary))
builder.addDefaultShareMenuItem()
builder.addMenuItem("MENU_ITEM_NAME", pendingIntent)
builder.setShowTitle(true)
builder.setCloseButtonIcon(bitmap)
builder.setActionButton(bitmap, "Android", pendingIntent, true)
builder.setStartAnimations(this, android.R.anim.fade_in, android.R.anim.fade_out)
builder.setExitAnimations(this, android.R.anim.fade_in, android.R.anim.fade_out)
By default, if we don't set any animations then the Custom Tab will enter from the Bottom to the Top and exit from the Top to the Bottom.
Amit Shekhar - Topic Suggestion