@@ -3,11 +3,10 @@ package org.buffer.android.utils
3
3
import android.content.ActivityNotFoundException
4
4
import android.content.Context
5
5
import android.content.Intent
6
- import android.graphics.BitmapFactory
6
+ import android.graphics.Bitmap
7
7
import android.net.Uri
8
8
import android.util.Log
9
9
import androidx.annotation.ColorRes
10
- import androidx.annotation.DrawableRes
11
10
import androidx.browser.customtabs.CustomTabsIntent
12
11
import androidx.core.content.ContextCompat
13
12
@@ -17,9 +16,9 @@ object CustomTabUtil {
17
16
context : Context ,
18
17
uri : Uri ,
19
18
@ColorRes color : Int ,
20
- @DrawableRes backArrow : Int
19
+ closeBitmap : Bitmap
21
20
) {
22
- val intent = buildIntent(context, uri, color, backArrow )
21
+ val intent = buildIntent(context, uri, color, closeBitmap )
23
22
try {
24
23
context.startActivity(intent)
25
24
} catch (error: ActivityNotFoundException ) {
@@ -35,17 +34,12 @@ object CustomTabUtil {
35
34
context : Context ,
36
35
uri : Uri ,
37
36
@ColorRes color : Int ,
38
- @DrawableRes backArrow : Int
37
+ closeBitmap : Bitmap
39
38
): Intent {
40
39
val customTabsIntent = CustomTabsIntent .Builder ()
41
40
.setToolbarColor(ContextCompat .getColor(context, color))
42
41
.setShowTitle(true )
43
- .setCloseButtonIcon(
44
- BitmapFactory .decodeResource(
45
- context.resources,
46
- backArrow
47
- )
48
- )
42
+ .setCloseButtonIcon(closeBitmap)
49
43
.addDefaultShareMenuItem()
50
44
.build()
51
45
return customTabsIntent.intent.apply {
0 commit comments