diff --git a/app/src/main/java/com/kareemradwan/stepeer/MainActivity.kt b/app/src/main/java/com/kareemradwan/stepeer/MainActivity.kt index f6bf91b..cd13fd4 100644 --- a/app/src/main/java/com/kareemradwan/stepeer/MainActivity.kt +++ b/app/src/main/java/com/kareemradwan/stepeer/MainActivity.kt @@ -15,7 +15,7 @@ class MainActivity : AppCompatActivity(), SteeperView.SteeperHandler { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) - val order1 = Order(1, "Step1") + val order1 = Order(1, "Step1" , true) order1.setChecked(true) val adapter = OrderAdapter( this, listOf( diff --git a/app/src/main/java/com/kareemradwan/stepeer/Order.kt b/app/src/main/java/com/kareemradwan/stepeer/Order.kt index 2d9705e..c7c7594 100644 --- a/app/src/main/java/com/kareemradwan/stepeer/Order.kt +++ b/app/src/main/java/com/kareemradwan/stepeer/Order.kt @@ -6,15 +6,19 @@ import kotlinx.android.parcel.Parcelize @Parcelize class Order( val id: Int, - val title: String -) : IStep() { + val title: String, + private var status: Boolean = false +) : IStep { /** * You Can Override this Method to Add Some Code */ override fun isChecked(): Boolean { // You can put some code here - return super.isChecked() + return status } + override fun setChecked(isChecked: Boolean) { + status = isChecked + } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 3d9adbf..e610db1 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -20,8 +20,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="20dp" - app:checked_color="#342987" - app:unchecked_color="#909090" /> + />