For #2390 - Adds views for every onboarding card
parent
8928b19079
commit
b2e6b59e91
@ -0,0 +1,22 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
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/. */
|
||||
|
||||
package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import kotlinx.android.synthetic.main.onboarding_firefox_account.view.*
|
||||
import org.mozilla.fenix.R
|
||||
|
||||
class OnboardingFirefoxAccountViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
|
||||
init {
|
||||
val appName = view.context.getString(R.string.app_name)
|
||||
view.header_text.text = view.context.getString(R.string.onboarding_firefox_account_header, appName)
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val LAYOUT_ID = R.layout.onboarding_firefox_account
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
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/. */
|
||||
|
||||
package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import kotlinx.android.synthetic.main.onboarding_theme_picker.view.*
|
||||
import org.mozilla.fenix.R
|
||||
|
||||
class OnboardingPrivacyNoticeViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
|
||||
init {
|
||||
val appName = view.context.getString(R.string.app_name)
|
||||
view.description_text.text = view.context.getString(R.string.onboarding_privacy_notice_description, appName)
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val LAYOUT_ID = R.layout.onboarding_privacy_notice
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
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/. */
|
||||
|
||||
package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding
|
||||
|
||||
import android.text.SpannableString
|
||||
import android.text.Spanned
|
||||
import android.text.style.ImageSpan
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import kotlinx.android.synthetic.main.onboarding_private_browsing.view.*
|
||||
import org.mozilla.fenix.R
|
||||
|
||||
class OnboardingPrivateBrowsingViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
|
||||
init {
|
||||
val icon = ImageSpan(view.context, R.drawable.ic_private_browsing)
|
||||
val text = SpannableString(view.context.getString(R.string.onboarding_private_browsing_description))
|
||||
|
||||
val spanStartIndex = text.indexOf(IMAGE_PLACEHOLDER)
|
||||
text.setSpan(
|
||||
icon,
|
||||
spanStartIndex,
|
||||
spanStartIndex + IMAGE_PLACEHOLDER.length,
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
|
||||
view.description_text.text = text
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val IMAGE_PLACEHOLDER = "%s"
|
||||
const val LAYOUT_ID = R.layout.onboarding_private_browsing
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
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/. */
|
||||
|
||||
package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import kotlinx.android.synthetic.main.onboarding_tracking_protection.view.*
|
||||
import org.mozilla.fenix.R
|
||||
|
||||
class OnboardingTrackingProtectionViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
|
||||
init {
|
||||
val appName = view.context.getString(R.string.app_name)
|
||||
view.description_text.text = view.context.getString(
|
||||
R.string.onboarding_tracking_protection_description,
|
||||
appName
|
||||
)
|
||||
}
|
||||
companion object {
|
||||
const val LAYOUT_ID = R.layout.onboarding_tracking_protection
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- 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/. -->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/onboarding_card"
|
||||
style="@style/OnboardingCardLight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/header_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:text="@string/onboarding_firefox_account_header"
|
||||
android:textAppearance="@style/HeaderTextStyle" />
|
||||
</LinearLayout>
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- 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/. -->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/onboarding_card"
|
||||
style="@style/OnboardingCardLight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/header_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:text="@string/onboarding_privacy_notice_header"
|
||||
android:textAppearance="@style/HeaderTextStyle" />
|
||||
<TextView
|
||||
android:id="@+id/description_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/onboarding_privacy_notice_description"
|
||||
android:textAppearance="@style/Body14TextStyle" />
|
||||
</LinearLayout>
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- 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/. -->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/onboarding_card"
|
||||
style="@style/OnboardingCardLight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/header_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:text="@string/onboarding_private_browsing_header"
|
||||
android:textAppearance="@style/HeaderTextStyle" />
|
||||
<TextView
|
||||
android:id="@+id/description_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/onboarding_private_browsing_description"
|
||||
android:textAppearance="@style/Body14TextStyle" />
|
||||
</LinearLayout>
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- 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/. -->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/onboarding_card"
|
||||
style="@style/OnboardingCardLight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/header_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:text="@string/onboarding_tracking_protection_header"
|
||||
android:textAppearance="@style/HeaderTextStyle" />
|
||||
<TextView
|
||||
android:id="@+id/description_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/onboarding_tracking_protection_description"
|
||||
android:textAppearance="@style/Body14TextStyle" />
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue