<commit_before>/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
 * 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.focus.firstrun

import android.content.Context
import android.support.v4.view.PagerAdapter
import android.support.v4.view.ViewPager
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
import android.widget.TextView

import org.mozilla.focus.R

class FirstrunPagerAdapter(
    private val context: Context,
    private val listener: View.OnClickListener
) : PagerAdapter() {

    private data class FirstrunPage(val title: String, val text: String, val imageResource: Int) {
        val contentDescription = title + text
    }

    private val pages: Array<FirstrunPage>

    init {
        val appName = context.getString(R.string.app_name)
        this.pages = arrayOf(
                FirstrunPage(
                        context.getString(R.string.firstrun_defaultbrowser_title),
                        context.getString(R.string.firstrun_defaultbrowser_text2),
                        R.drawable.onboarding_img1),
                FirstrunPage(
                        context.getString(R.string.firstrun_search_title),
                        context.getString(R.string.firstrun_search_text),
                        R.drawable.onboarding_img4),
                FirstrunPage(
                        context.getString(R.string.firstrun_shortcut_title),
                        context.getString(R.string.firstrun_shortcut_text, appName),
                        R.drawable.onboarding_img3),
                FirstrunPage(
                        context.getString(R.string.firstrun_privacy_title),
                        context.getString(R.string.firstrun_privacy_text, appName),
                        R.drawable.onboarding_img2))
    }

    private fun getView(position: Int, pager: ViewPager): View {
        val view = LayoutInflater.from(context).inflate(R.layout.firstrun_page, pager, false)

        val page = pages[position]

        val titleView: TextView = view.findViewById(R.id.title)<commit_msg>Fixes usage of a string that was renamed to be re-translated<commit_after>/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
 * 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.focus.firstrun

import android.content.Context
import android.support.v4.view.PagerAdapter
import android.support.v4.view.ViewPager
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
import android.widget.TextView

import org.mozilla.focus.R

class FirstrunPagerAdapter(
    private val context: Context,
    private val listener: View.OnClickListener
) : PagerAdapter() {

    private data class FirstrunPage(val title: String, val text: String, val imageResource: Int) {
        val contentDescription = title + text
    }

    private val pages: Array<FirstrunPage>

    init {
        val appName = context.getString(R.string.app_name)
        this.pages = arrayOf(
                FirstrunPage(
                        context.getString(R.string.firstrun_defaultbrowser_title),
                        context.getString(R.string.firstrun_defaultbrowser_text_new),
                        R.drawable.onboarding_img1),
                FirstrunPage(
                        context.getString(R.string.firstrun_search_title),
                        context.getString(R.string.firstrun_search_text),
                        R.drawable.onboarding_img4),
                FirstrunPage(
                        context.getString(R.string.firstrun_shortcut_title),
                        context.getString(R.string.firstrun_shortcut_text, appName),
                        R.drawable.onboarding_img3),
                FirstrunPage(
                        context.getString(R.string.firstrun_privacy_title),
                        context.getString(R.string.firstrun_privacy_text, appName),
                        R.drawable.onboarding_img2))
    }

    private fun getView(position: Int, pager: ViewPager): View {
        val view = LayoutInflater.from(context).inflate(R.layout.firstrun_page, pager, false)

        val page = pages[position]

        val titleView: TextView = view.findViewById(R.id.title)
{'fraction_non_alphanumeric': 0.08657917019475021, 'fraction_numerical': 0.005292125317527519, 'mean_word_length': 2.3558238636363638, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3956973', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1239, 'n_words': 287}