diff options
author | Tor Norbye <tnorbye@google.com> | 2020-12-08 17:18:12 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2020-12-09 16:49:44 +0000 |
commit | 8659b5fd5623e2af2624010ba522a09a7a666566 (patch) | |
tree | 4adeeb691a11bbcc126ff56706096978c3942ee1 /lint/src | |
parent | d305422bdb7e347a7cc42594f95ff00709dcd440 (diff) | |
download | idea-8659b5fd5623e2af2624010ba522a09a7a666566.tar.gz |
Remove obsolete constraint layout detector version check
Lint had some version comparisons to make sure users were using at
least 1.0.2. This was important in early days when there were serious
problems in the layout editor since the constraint layout in the IDE
was not loaded from the project. That's no longer issue, and
ConstraintLayout does not need special handling; the generalized "new
version available" check for all libraries in GradleDetector is
enough.
Test: Existing
Bug: None
Change-Id: I02d6a132cd8c73cc10196ea1ff358716d7720fa0
Diffstat (limited to 'lint/src')
-rw-r--r-- | lint/src/com/android/tools/idea/lint/common/AndroidLintGradleDependencyInspection.java | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/lint/src/com/android/tools/idea/lint/common/AndroidLintGradleDependencyInspection.java b/lint/src/com/android/tools/idea/lint/common/AndroidLintGradleDependencyInspection.java index 828096f5bf7..cc074c8c98e 100644 --- a/lint/src/com/android/tools/idea/lint/common/AndroidLintGradleDependencyInspection.java +++ b/lint/src/com/android/tools/idea/lint/common/AndroidLintGradleDependencyInspection.java @@ -16,63 +16,10 @@ */ package com.android.tools.idea.lint.common; -import static com.android.tools.lint.checks.ConstraintLayoutDetector.LATEST_KNOWN_VERSION; - -import com.android.tools.lint.checks.ConstraintLayoutDetector; import com.android.tools.lint.checks.GradleDetector; -import com.android.tools.lint.detector.api.LintFix; -import com.intellij.openapi.module.Module; -import com.intellij.openapi.module.ModuleUtilCore; -import com.intellij.psi.PsiElement; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class AndroidLintGradleDependencyInspection extends AndroidLintInspectionBase { public AndroidLintGradleDependencyInspection() { super(LintBundle.message("android.lint.inspections.gradle.dependency"), GradleDetector.DEPENDENCY); } - - public static void upgrade(@Nullable Module module) { - if (module != null) { - LintIdeSupport.get().updateToLatest(module, LATEST_KNOWN_VERSION); - } - } - - @NotNull - @Override - public LintIdeQuickFix[] getQuickFixes(@NotNull PsiElement startElement, - @NotNull PsiElement endElement, - @NotNull String message, - @Nullable LintFix fixData) { - boolean updateConstraintLayout = LintFix.getBoolean(fixData, ConstraintLayoutDetector.KEY_UPGRADE_CONSTRAINT_LAYOUT, false); - if (updateConstraintLayout) { - // Is this an upgrade message from the ConstraintLayoutDetector instead? - return new LintIdeQuickFix[]{new UpgradeConstraintLayoutFix()}; - } - return super.getQuickFixes(startElement, endElement, message, fixData); - } - - public static class UpgradeConstraintLayoutFix implements LintIdeQuickFix { - @Override - public void apply(@NotNull PsiElement startElement, - @NotNull PsiElement endElement, - @NotNull AndroidQuickfixContexts.Context context) { - Module module = ModuleUtilCore.findModuleForPsiElement(startElement); - upgrade(module); - } - - @Override - public boolean isApplicable(@NotNull PsiElement startElement, - @NotNull PsiElement endElement, - @NotNull AndroidQuickfixContexts.ContextType contextType) { - return true; - } - - @NotNull - @Override - public String getName() { - return "Upgrade to recommended version"; - } - } } |