Skip to content

Commit

Permalink
Fix tooltipText NoSuchMethodError exception under Android O
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurg committed Jun 22, 2023
1 parent 2188546 commit 405179b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package og.android.lib.toggleiconview

import android.content.Context
import android.os.Build
import android.util.AttributeSet
import androidx.annotation.DrawableRes
import androidx.appcompat.widget.AppCompatImageView
Expand Down Expand Up @@ -70,6 +71,10 @@ abstract class ToggleIconView @JvmOverloads constructor(
}

private fun setTooltipTextByCheckState(isChecked: Boolean) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
return
}

tooltipText = if (isChecked) {
mCheckedTooltipText
} else {
Expand Down

0 comments on commit 405179b

Please sign in to comment.