While using Stetho in the sample project of one of my open source libraries, I noticed a crash.
The crash:
Process: com.afollestad.aestheticsample, PID: 8673
java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed
at android.graphics.Canvas.checkValidClipOp(Canvas.java:779)
at android.graphics.Canvas.clipRect(Canvas.java:826)
at com.facebook.stetho.inspector.elements.android.ViewHighlightOverlays$ViewHighlightOverlaysJellybeanMR2$MainHighlightDrawable.draw(ViewHighlightOverlays.java:141)
at android.view.ViewOverlay$OverlayViewGroup.dispatchDraw(ViewOverlay.java:256)
This is the visual layout:
I get a crash when inspecting a MultiSelectListPreference, I'm using an AndroidX PreferenceFragmentCompat, not sure if it would happen in the legacy Support Library's as well.
I've made the contents below expandable so it's not overwhelming to look at, at first glance.
The preferences XML:
```xml
```
The code that uses the preferences XML:
```kotlin
import android.os.Bundle
import androidx.preference.PreferenceFragmentCompat
import com.afollestad.aesthetic.AestheticActivity
class SettingsFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(
savedInstanceState: Bundle?,
rootKey: String?
) = setPreferencesFromResource(R.xml.preferences, rootKey)
}
class SettingsActivity : AestheticActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_settings)
if (savedInstanceState == null) {
supportFragmentManager
.beginTransaction()
.add(R.id.container, SettingsFragment())
.commit()
}
}
}
```
While using Stetho in the sample project of one of my open source libraries, I noticed a crash.
The crash:
This is the visual layout:
I get a crash when inspecting a
MultiSelectListPreference
, I'm using an AndroidX PreferenceFragmentCompat, not sure if it would happen in the legacy Support Library's as well.I've made the contents below expandable so it's not overwhelming to look at, at first glance.
The preferences XML:
The code that uses the preferences XML: