2019-05-07 22:28:38 +02:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2019-07-12 20:38:15 +02:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2019-05-07 22:28:38 +02:00
|
|
|
|
2020-07-31 22:24:14 +02:00
|
|
|
package org.mozilla.fenix.exceptions.viewholders
|
2019-05-07 22:28:38 +02:00
|
|
|
|
|
|
|
import android.view.View
|
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
2020-07-31 22:24:14 +02:00
|
|
|
import com.google.android.material.button.MaterialButton
|
2019-05-07 22:28:38 +02:00
|
|
|
import org.mozilla.fenix.R
|
2020-07-31 22:24:14 +02:00
|
|
|
import org.mozilla.fenix.exceptions.ExceptionsInteractor
|
2019-05-07 22:28:38 +02:00
|
|
|
|
|
|
|
class ExceptionsDeleteButtonViewHolder(
|
|
|
|
view: View,
|
2020-07-31 22:24:14 +02:00
|
|
|
private val interactor: ExceptionsInteractor<*>
|
2019-05-07 22:28:38 +02:00
|
|
|
) : RecyclerView.ViewHolder(view) {
|
|
|
|
|
|
|
|
init {
|
2020-07-31 22:24:14 +02:00
|
|
|
val deleteButton: MaterialButton = view.findViewById(R.id.removeAllExceptions)
|
2019-05-07 22:28:38 +02:00
|
|
|
deleteButton.setOnClickListener {
|
2019-07-19 01:07:48 +02:00
|
|
|
interactor.onDeleteAll()
|
2019-05-07 22:28:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|