1 /*
2  * Copyright 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package androidx.appcompat
18 
19 import androidx.appcompat.app.SetActionBarDetector
20 import androidx.appcompat.res.ColorStateListAlphaDetector
21 import androidx.appcompat.res.ColorStateListLoadingDetector
22 import androidx.appcompat.res.DrawableLoadingDetector
23 import androidx.appcompat.res.ImageViewTintDetector
24 import androidx.appcompat.view.OnClickXmlDetector
25 import androidx.appcompat.widget.SwitchUsageCodeDetector
26 import androidx.appcompat.widget.SwitchUsageXmlDetector
27 import androidx.appcompat.widget.TextViewCompoundDrawablesApiDetector
28 import androidx.appcompat.widget.TextViewCompoundDrawablesXmlDetector
29 import com.android.tools.lint.client.api.IssueRegistry
30 import com.android.tools.lint.client.api.Vendor
31 import com.android.tools.lint.detector.api.CURRENT_API
32 
33 @Suppress("UnstableApiUsage")
34 class AppCompatIssueRegistry : IssueRegistry() {
35     override val minApi = CURRENT_API
36     override val api = 16
37     override val issues
38         get() =
39             listOf(
40                 SetActionBarDetector.USING_CORE_ACTION_BAR,
41                 ColorStateListAlphaDetector.NOT_USING_ANDROID_ALPHA,
42                 ColorStateListLoadingDetector.NOT_USING_COMPAT_LOADING,
43                 DrawableLoadingDetector.NOT_USING_COMPAT_LOADING,
44                 ImageViewTintDetector.USING_ANDROID_TINT,
45                 SwitchUsageCodeDetector.USING_CORE_SWITCH_CODE,
46                 SwitchUsageXmlDetector.USING_CORE_SWITCH_XML,
47                 TextViewCompoundDrawablesApiDetector.NOT_USING_COMPAT_TEXT_VIEW_DRAWABLE_APIS,
48                 TextViewCompoundDrawablesXmlDetector.NOT_USING_COMPAT_TEXT_VIEW_DRAWABLE_ATTRS,
49                 OnClickXmlDetector.USING_ON_CLICK_IN_XML
50             )
51 
52     override val vendor =
53         Vendor(
54             feedbackUrl = "https://issuetracker.google.com/issues/new?component=460343",
55             identifier = "androidx.appcompat",
56             vendorName = "Android Open Source Project",
57         )
58 }
59