aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorTacoTheDank <SkytkRSfan3895@gmail.com>2020-12-23 22:36:22 +0000
committerTacoTheDank <SkytkRSfan3895@gmail.com>2020-12-23 22:36:22 +0000
commit6247868949e0469c4916ff859f1c7b87c7bc20b9 (patch)
tree881363781688560c14bc8927aa98faf8cb61e800 /app/src/main
parent4528b3d749fcd5b978d570159ebba13c5400284d (diff)
downloadinfinity-for-reddit-6247868949e0469c4916ff859f1c7b87c7bc20b9.tar
infinity-for-reddit-6247868949e0469c4916ff859f1c7b87c7bc20b9.tar.gz
infinity-for-reddit-6247868949e0469c4916ff859f1c7b87c7bc20b9.tar.bz2
infinity-for-reddit-6247868949e0469c4916ff859f1c7b87c7bc20b9.tar.lz
infinity-for-reddit-6247868949e0469c4916ff859f1c7b87c7bc20b9.tar.xz
infinity-for-reddit-6247868949e0469c4916ff859f1c7b87c7bc20b9.tar.zst
infinity-for-reddit-6247868949e0469c4916ff859f1c7b87c7bc20b9.zip
Update some libraries
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java13
1 files changed, 8 insertions, 5 deletions
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<ResolveInfo> 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) {