Cleanup filters.

This commit is contained in:
Erik C. Thauvin 2020-07-28 03:17:41 -07:00
parent 98dc25b3b9
commit 161c5ff643
2 changed files with 7 additions and 8 deletions

View file

@ -128,7 +128,7 @@ class MainActivity : AppCompatActivity(), AnkoLogger {
val tmp: Config? = try {
Gson().fromJson(
InputStreamReader(contentResolver.openInputStream(intent.data!!)),
InputStreamReader(contentResolver.openInputStream(intent.data!!)!!),
Config::class.java
)
} catch (jse: JsonSyntaxException) {
@ -260,6 +260,7 @@ class MainActivity : AppCompatActivity(), AnkoLogger {
// programming title
textView {
topPadding = dip(10)
bottomPadding = dip(10)
text = getString(R.string.programming_heading)
setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18f)
typeface = Typeface.DEFAULT_BOLD
@ -338,7 +339,7 @@ class MainActivity : AppCompatActivity(), AnkoLogger {
alert.show()
}
}
return super.onOptionsItemSelected(item)
return super.onOptionsItemSelected(item!!)
}
@SuppressLint("NeedOnRequestPermissionsResult")

View file

@ -51,16 +51,14 @@ class MinMaxFilter(
if (zeros) {
if (size > 1 && len != size) {
i = if (i == 0) {
if (i == 0) {
return true
} else {
s.padEnd(size, '0').toInt()
i = s.padEnd(size, '0').toInt()
}
}
} else {
if (len > 1 && s.startsWith("0")) {
return false
}
} else if (len > 1 && s.startsWith("0")) {
return false
}
return i in IntRange(min, max)