From a0084df46e4943888517cd32ed487f7cfc14f327 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Tue, 3 Nov 2020 21:58:47 +0900 Subject: [PATCH] Fix Unresolved Kotlin class error during release build --- app/build.gradle | 5 ----- .../instagrabber/customviews/RamboTextViewV2.java | 15 ++++++--------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d72cf3c2..75bddda2 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,7 +40,6 @@ android { } - configurations.all { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' } @@ -82,8 +81,4 @@ dependencies { debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.5' testImplementation 'org.junit.jupiter:junit-jupiter:5.7.0' - - // temporary - implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.4.10' - implementation 'org.jetbrains:annotations:13.0' } diff --git a/app/src/main/java/awais/instagrabber/customviews/RamboTextViewV2.java b/app/src/main/java/awais/instagrabber/customviews/RamboTextViewV2.java index d17faedd..14f09798 100644 --- a/app/src/main/java/awais/instagrabber/customviews/RamboTextViewV2.java +++ b/app/src/main/java/awais/instagrabber/customviews/RamboTextViewV2.java @@ -3,8 +3,8 @@ package awais.instagrabber.customviews; import android.content.Context; import android.util.AttributeSet; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import java.util.ArrayList; import java.util.List; @@ -16,7 +16,6 @@ import io.github.armcha.autolink.MODE_HASHTAG; import io.github.armcha.autolink.MODE_MENTION; import io.github.armcha.autolink.MODE_URL; import io.github.armcha.autolink.Mode; -import kotlin.Unit; public class RamboTextViewV2 extends AutoLinkTextView { private final List onMentionClickListeners = new ArrayList<>(); @@ -24,7 +23,7 @@ public class RamboTextViewV2 extends AutoLinkTextView { private final List onURLClickListeners = new ArrayList<>(); private final List onEmailClickListeners = new ArrayList<>(); - public RamboTextViewV2(@NotNull final Context context, + public RamboTextViewV2(@NonNull final Context context, @Nullable final AttributeSet attrs) { super(context, attrs); init(); @@ -38,27 +37,25 @@ public class RamboTextViewV2 extends AutoLinkTextView { for (final OnMentionClickListener onMentionClickListener : onMentionClickListeners) { onMentionClickListener.onMentionClick(autoLinkItem); } - return Unit.INSTANCE; + return; } if (mode.equals(MODE_HASHTAG.INSTANCE)) { for (final OnHashtagClickListener onHashtagClickListener : onHashtagClickListeners) { onHashtagClickListener.onHashtagClick(autoLinkItem); } - return Unit.INSTANCE; + return; } if (mode.equals(MODE_URL.INSTANCE)) { for (final OnURLClickListener onURLClickListener : onURLClickListeners) { onURLClickListener.onURLClick(autoLinkItem); } - return Unit.INSTANCE; + return; } if (mode.equals(MODE_EMAIL.INSTANCE)) { for (final OnEmailClickListener onEmailClickListener : onEmailClickListeners) { onEmailClickListener.onEmailClick(autoLinkItem); } - return Unit.INSTANCE; } - return Unit.INSTANCE; }); }