Skip to content

Commit

Permalink
Update sample app
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurg committed Jul 17, 2022
1 parent 382a498 commit 57791c4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package og.android.sample.toggleiconview

import android.os.Bundle
import android.util.Log
import android.widget.LinearLayout
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import og.android.lib.toggleiconview.ToggleIconView

Expand Down Expand Up @@ -47,12 +47,9 @@ class MainActivity : AppCompatActivity() {
toggleIconView.toggle()
}

toggleIconView.setOnCheckedChangeListener { _: ToggleIconView, isChecked: Boolean ->
Toast.makeText(
this,
"onCheckedChanged: $isChecked",
Toast.LENGTH_SHORT
).show()
toggleIconView.setOnCheckedChangeListener { view: ToggleIconView, _: Boolean ->
val value = "[${view::class.qualifiedName.toString()}:onCheckedChanged] isChecked: ${toggleIconView.isChecked()}"
Log.d("TOGGLEICONVIEW_SAMPLE", value)
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#09c"
android:gravity="center"
android:padding="12dp"
android:text="Touch an icon and search for 'TOGGLEICONVIEW_SAMPLE' tag in Logcat"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textColor="#fff" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down

0 comments on commit 57791c4

Please sign in to comment.