<commit_before>package com.tasomaniac.openwith.settings

import android.content.Intent
import android.support.v7.preference.Preference
import com.tasomaniac.openwith.R
import com.tasomaniac.openwith.data.Analytics
import com.tasomaniac.openwith.intro.IntroActivity
import com.tasomaniac.openwith.preferred.PreferredAppsActivity
import javax.inject.Inject

class GeneralSettings @Inject constructor(
    fragment: SettingsFragment,
    private val analytics: Analytics
) : Settings(fragment) {

  override fun setup() {
    addPreferencesFromResource(R.xml.pref_general)

    findPreference(R.string.pref_key_about).onPreferenceClickListener = onPreferenceClickListener
    findPreference(R.string.pref_key_preferred).onPreferenceClickListener = onPreferenceClickListener
  }

  private val onPreferenceClickListener = Preference.OnPreferenceClickListener {
    when {
      it.isKeyEquals(R.string.pref_key_about) -> {
        startActivity(Intent(activity, IntroActivity::class.java))
      }
      it.isKeyEquals(R.string.pref_key_preferred) -> {
        startActivity(Intent(activity, PreferredAppsActivity::class.java))
      }
    }

    analytics.sendEvent("Preference", "Item Click", it.key)
    true
  }
}
<commit_msg>Add click handling back for Browser settings<commit_after>package com.tasomaniac.openwith.settings

import android.content.Intent
import android.support.v7.preference.Preference
import com.tasomaniac.openwith.R
import com.tasomaniac.openwith.browser.PreferredBrowserActivity
import com.tasomaniac.openwith.data.Analytics
import com.tasomaniac.openwith.intro.IntroActivity
import com.tasomaniac.openwith.preferred.PreferredAppsActivity
import javax.inject.Inject

class GeneralSettings @Inject constructor(
    fragment: SettingsFragment,
    private val analytics: Analytics
) : Settings(fragment) {

  override fun setup() {
    addPreferencesFromResource(R.xml.pref_general)

    findPreference(R.string.pref_key_about).onPreferenceClickListener = onPreferenceClickListener
    findPreference(R.string.pref_key_preferred).onPreferenceClickListener = onPreferenceClickListener
    findPreference(R.string.pref_key_browser).onPreferenceClickListener = onPreferenceClickListener
  }

  private val onPreferenceClickListener = Preference.OnPreferenceClickListener {
    when {
      it.isKeyEquals(R.string.pref_key_about) -> {
        startActivity(Intent(activity, IntroActivity::class.java))
      }
      it.isKeyEquals(R.string.pref_key_preferred) -> {
        startActivity(Intent(activity, PreferredAppsActivity::class.java))
      }
      it.isKeyEquals(R.string.pref_key_browser) -> {
        startActivity(Intent(activity, PreferredBrowserActivity::class.java))
      }
    }

    analytics.sendEvent("Preference", "Item Click", it.key)
    true
  }
}

{'fraction_non_alphanumeric': 0.0886575735821967, 'fraction_numerical': 0.0007178750897343862, 'mean_word_length': 4.955128205128205, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7151517', 'n_tokens_mistral': 827, 'n_tokens_neox': 808, 'n_words': 115}