From 6247868949e0469c4916ff859f1c7b87c7bc20b9 Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Wed, 23 Dec 2020 17:36:22 -0500 Subject: Update some libraries --- .../infinityforreddit/activities/LinkResolverActivity.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java index bac8f3da..27fa8298 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java @@ -10,7 +10,9 @@ import android.os.Bundle; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; +import androidx.browser.customtabs.CustomTabColorSchemeParams; import androidx.browser.customtabs.CustomTabsIntent; +import androidx.browser.customtabs.CustomTabsService; import java.util.ArrayList; import java.util.List; @@ -23,8 +25,6 @@ import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; -import static androidx.browser.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION; - public class LinkResolverActivity extends AppCompatActivity { public static final String EXTRA_MESSAGE_FULLNAME = "ENF"; @@ -276,7 +276,7 @@ public class LinkResolverActivity extends AppCompatActivity { ArrayList packagesSupportingCustomTabs = new ArrayList<>(); for (ResolveInfo info : resolvedActivityList) { Intent serviceIntent = new Intent(); - serviceIntent.setAction(ACTION_CUSTOM_TABS_CONNECTION); + serviceIntent.setAction(CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION); serviceIntent.setPackage(info.activityInfo.packageName); // Check if this package also resolves the Custom Tabs service. if (pm.resolveService(serviceIntent, 0) != null) { @@ -291,8 +291,11 @@ public class LinkResolverActivity extends AppCompatActivity { if (!resolveInfos.isEmpty()) { CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(); // add share action to menu list - builder.addDefaultShareMenuItem(); - builder.setToolbarColor(mCustomThemeWrapper.getColorPrimary()); + builder.setShareState(CustomTabsIntent.SHARE_STATE_ON); + builder.setDefaultColorSchemeParams( + new CustomTabColorSchemeParams.Builder() + .setToolbarColor(mCustomThemeWrapper.getColorPrimary()) + .build()); CustomTabsIntent customTabsIntent = builder.build(); customTabsIntent.intent.setPackage(resolveInfos.get(0).activityInfo.packageName); if (uri.getScheme() == null) { -- cgit v1.2.3