2019-05-16 07:33:09 +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-16 07:33:09 +02:00
|
|
|
|
|
|
|
package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding
|
|
|
|
|
|
|
|
import android.view.View
|
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
2019-05-21 00:05:10 +02:00
|
|
|
import kotlinx.android.synthetic.main.onboarding_privacy_notice.view.*
|
2019-05-16 07:33:09 +02:00
|
|
|
import org.mozilla.fenix.R
|
2020-06-25 20:21:31 +02:00
|
|
|
import org.mozilla.fenix.components.metrics.Event
|
|
|
|
import org.mozilla.fenix.ext.components
|
2020-04-06 20:00:47 +02:00
|
|
|
import org.mozilla.fenix.home.sessioncontrol.OnboardingInteractor
|
2019-05-16 07:33:09 +02:00
|
|
|
|
2020-04-06 20:00:47 +02:00
|
|
|
class OnboardingPrivacyNoticeViewHolder(
|
|
|
|
view: View,
|
|
|
|
private val interactor: OnboardingInteractor
|
|
|
|
) : RecyclerView.ViewHolder(view) {
|
2019-05-16 07:33:09 +02:00
|
|
|
|
|
|
|
init {
|
2019-06-27 01:03:06 +02:00
|
|
|
view.header_text.setOnboardingIcon(R.drawable.ic_onboarding_privacy_notice)
|
2019-05-21 00:05:10 +02:00
|
|
|
|
2019-05-16 07:33:09 +02:00
|
|
|
val appName = view.context.getString(R.string.app_name)
|
|
|
|
view.description_text.text = view.context.getString(R.string.onboarding_privacy_notice_description, appName)
|
2019-05-21 00:05:10 +02:00
|
|
|
|
|
|
|
view.read_button.setOnClickListener {
|
2020-06-25 20:21:31 +02:00
|
|
|
it.context.components.analytics.metrics.track(Event.OnboardingPrivacyNotice)
|
2020-04-06 20:00:47 +02:00
|
|
|
interactor.onReadPrivacyNoticeClicked()
|
2019-05-21 00:05:10 +02:00
|
|
|
}
|
2019-05-16 07:33:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
companion object {
|
|
|
|
const val LAYOUT_ID = R.layout.onboarding_privacy_notice
|
|
|
|
}
|
|
|
|
}
|