Skip to content

Commit

Permalink
ANDROID-11177 Enable Lint and fix issues (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeslat authored Dec 22, 2022
1 parent b1bb000 commit 4614c99
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
4 changes: 4 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ android {
dimension "loggerMode"
}
}
lintOptions {
warningsAsErrors true
lintConfig file("lint-custom.xml")
}
}

dependencies {
Expand Down
13 changes: 13 additions & 0 deletions library/lint-custom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="GradleDependency" severity="ignore" />
<issue id="MergeRootFrame">
<ignore path="src/enabled/res/layout/activity_app_logger.xml" />
</issue>
<issue id="AlwaysShowAction">
<ignore path="src/enabled/res/menu/menu_app_logger.xml" />
</issue>


<issue id="OldTargetApi" severity="ignore" />
</lint>
6 changes: 0 additions & 6 deletions library/lint.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class AppLoggerActivity : AppCompatActivity() {
): Chip =
LayoutInflater
.from(context)
.inflate(R.layout.log_category_chip, null)
.inflate(R.layout.log_category_chip, this, false)
.let { it as Chip }
.let {
@ColorInt val chipUncheckedBackgroundColor: Int =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ internal class AppLoggerViewModel : ViewModel() {
} ?: this

private fun String.lowerCaseContains(anotherString: String) =
toLowerCase().contains(anotherString.toLowerCase())
toLowerCase(Locale.ROOT).contains(anotherString.toLowerCase(Locale.ROOT))

private fun List<LogEntry>.filterBySelectedCategories(): List<LogEntry> {
val isEmptyCategoriesSelection = selectedCategories.isEmpty()
Expand Down

0 comments on commit 4614c99

Please sign in to comment.