<commit_before>package ru.a1024bits.bytheway.ui.dialogs

import android.os.Bundle
import android.support.v4.app.DialogFragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.firebase.auth.PhoneAuthProvider
import kotlinx.android.synthetic.main.error_registration_dialog.*
import kotlinx.android.synthetic.main.error_registration_dialog.view.*
import ru.a1024bits.bytheway.R
import ru.a1024bits.bytheway.ui.activity.RegistrationActivity

class ErrorStandartRegistrationDialog : DialogFragment() {
    lateinit var activity: RegistrationActivity

    override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return layoutInflater.inflate(R.layout.error_registration_dialog, container, false)
    }

    override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        isCancelable = false
        view?.sendButtonCode?.setOnClickListener({
            activity.mVerificationId?.let {
                PhoneAuthProvider.getCredential(it, verificationsData.text.toString())?.let { credentialIt ->
                    activity.signInGoogle(credentialIt)
                }
            }
        })
        view?.sendButtonPhone?.setOnClickListener({
            if (verificationsData.text.toString().contains(Regex("^(380)")))
                verificationsData.setText(StringBuilder("+").append(verificationsData.text.toString()))<commit_msg>add 7 to list numbers which must start with "+"<commit_after>package ru.a1024bits.bytheway.ui.dialogs

import android.os.Bundle
import android.support.v4.app.DialogFragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.firebase.auth.PhoneAuthProvider
import kotlinx.android.synthetic.main.error_registration_dialog.*
import kotlinx.android.synthetic.main.error_registration_dialog.view.*
import ru.a1024bits.bytheway.R
import ru.a1024bits.bytheway.ui.activity.RegistrationActivity

class ErrorStandartRegistrationDialog : DialogFragment() {
    lateinit var activity: RegistrationActivity

    override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return layoutInflater.inflate(R.layout.error_registration_dialog, container, false)
    }

    override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        isCancelable = false
        view?.sendButtonCode?.setOnClickListener({
            activity.mVerificationId?.let {
                PhoneAuthProvider.getCredential(it, verificationsData.text.toString())?.let { credentialIt ->
                    activity.signInGoogle(credentialIt)
                }
            }
        })
        view?.sendButtonPhone?.setOnClickListener({
            if (verificationsData.text.toString().contains(Regex("^((380)|(7))")))
                verificationsData.setText(StringBuilder("+").append(verificationsData.text.toString()))
{'fraction_non_alphanumeric': 0.09941897998708844, 'fraction_numerical': 0.010974822466107165, 'mean_word_length': 3.9663461538461537, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4445495', 'n_tokens_mistral': 875, 'n_tokens_neox': 799, 'n_words': 132}