Skip to content

Commit

Permalink
Update sample app Log value
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurg committed Jun 22, 2023
1 parent b7d234d commit 06328cb
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package og.android.sample.toggleiconview

import android.os.Build
import android.os.Bundle
import android.util.Log
import android.widget.LinearLayout
Expand Down Expand Up @@ -54,10 +55,17 @@ class MainActivity : AppCompatActivity() {
}

toggleIconView.setOnCheckedChangeListener { view: ToggleIconView, _: Boolean ->
val value = "[${view::class.qualifiedName.toString()}:onCheckedChanged]\n" +
val value = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
"[${view::class.qualifiedName.toString()}:onCheckedChanged]\n" +
"isChecked: ${toggleIconView.isChecked}\n" +
"tooltipText: ${toggleIconView.tooltipText}\n" +
"contentDescription: ${toggleIconView.contentDescription}"
} else {
"[${view::class.qualifiedName.toString()}:onCheckedChanged]\n" +
"isChecked: ${toggleIconView.isChecked}\n" +
"tooltipText: not-supported\n" +
"contentDescription: ${toggleIconView.contentDescription}"
}
Log.d("TOGGLEICONVIEW_SAMPLE", value)
}
}
Expand Down

0 comments on commit 06328cb

Please sign in to comment.