<commit_before>package ru.santaev.clipboardtranslator.ui;


import android.app.Activity;
import android.arch.lifecycle.LifecycleFragment;
import android.arch.lifecycle.ViewModelProviders;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.net.Uri;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import ru.santaev.clipboardtranslator.R;
import ru.santaev.clipboardtranslator.TranslatorApp;
import ru.santaev.clipboardtranslator.databinding.FragmentTranslateBinding;
import ru.santaev.clipboardtranslator.db.entity.Language;
import ru.santaev.clipboardtranslator.model.TranslateDirectionProvider;
import ru.santaev.clipboardtranslator.service.TranslateService;
import ru.santaev.clipboardtranslator.viewmodel.TranslateViewModel;

public class TranslateFragment extends LifecycleFragment {

    private static final int REQUEST_CODE_ORIGIN_LANG = 0;
    private static final int REQUEST_CODE_TARGET_LANG = 1;

    private TranslateViewModel viewModel;
    private FragmentTranslateBinding binding;
    private TranslateDirectionProvider translateDirectionProvider;

    public TranslateFragment() {
        // Required empty public constructor
    }

    public static TranslateFragment newInstance() {
        TranslateFragment fragment = new TranslateFragment();
        Bundle args = new Bundle();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        translateDirectionProvider = new TranslateDirectionProvider();
        ViewModelFactory factory = new ViewModelFactory(TranslatorApp.getInstance().getDataModel());
        viewModel = ViewModelProviders.of(this, factory).get(TranslateViewModel.class);
        observeModel();
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment<commit_msg>hide keyboard after open app<commit_after>package ru.santaev.clipboardtranslator.ui;


import android.app.Activity;
import android.arch.lifecycle.LifecycleFragment;
import android.arch.lifecycle.ViewModelProviders;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.net.Uri;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;

import ru.santaev.clipboardtranslator.R;
import ru.santaev.clipboardtranslator.TranslatorApp;
import ru.santaev.clipboardtranslator.databinding.FragmentTranslateBinding;
import ru.santaev.clipboardtranslator.db.entity.Language;
import ru.santaev.clipboardtranslator.model.TranslateDirectionProvider;
import ru.santaev.clipboardtranslator.service.TranslateService;
import ru.santaev.clipboardtranslator.viewmodel.TranslateViewModel;

public class TranslateFragment extends LifecycleFragment {

    private static final int REQUEST_CODE_ORIGIN_LANG = 0;
    private static final int REQUEST_CODE_TARGET_LANG = 1;

    private TranslateViewModel viewModel;
    private FragmentTranslateBinding binding;
    private TranslateDirectionProvider translateDirectionProvider;

    public TranslateFragment() {
        // Required empty public constructor
    }

    public static TranslateFragment newInstance() {
        TranslateFragment fragment = new TranslateFragment();
        Bundle args = new Bundle();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        translateDirectionProvider = new TranslateDirectionProvider();
        ViewModelFactory factory = new ViewModelFactory(TranslatorApp.getInstance().getDataModel());
        viewModel = ViewModelProviders.of(this, factory).get(TranslateViewModel.class);
        observeModel();

        getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
{'fraction_non_alphanumeric': 0.07224590531747813, 'fraction_numerical': 0.0008974646623289208, 'mean_word_length': 4.621689785624212, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '141329', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1129, 'n_words': 244}