<commit_before>package com.example.ismailamrani.comptable.ui.dialogs;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.widget.SearchView;
import android.text.TextUtils;
import android.view.Window;

import com.example.ismailamrani.comptable.R;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by <NAME> on 10/05/2016.
 */
public class PurchaseChooserDialog extends Dialog {

    @Bind(R.id.dialogSearchView)
    SearchView dialogSearchView;

    private List<String> items;
    private String hint;

    public PurchaseChooserDialog(Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.purchase_dialog);
        ButterKnife.bind(this);

        if (!TextUtils.isEmpty(hint))
            setSearchHint(hint);
    }

    public PurchaseChooserDialog whoseItemsAre(List<String> items) {
        this.items = new ArrayList<>(items);
        return this;
    }

    public PurchaseChooserDialog whoseSearchHintIs(String hint) {
        this.hint = hint;
        return this;
    }

    /**
     * Specifies the query hint of the SearchView.<commit_msg>PurchaseChooserDialog: dismiss on 'CANCEL' clicked.<commit_after>package com.example.ismailamrani.comptable.ui.dialogs;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.widget.SearchView;
import android.text.TextUtils;
import android.view.View;
import android.view.Window;

import com.example.ismailamrani.comptable.R;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by <NAME> on 10/05/2016.
 */
public class PurchaseChooserDialog extends Dialog {

    @Bind(R.id.dialogSearchView)
    SearchView dialogSearchView;

    private List<String> items;
    private String hint;

    public PurchaseChooserDialog(Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.purchase_dialog);
        ButterKnife.bind(this);

        if (!TextUtils.isEmpty(hint))
            setSearchHint(hint);
    }

    public void onCancel(View view) {
        dismiss();
    }

    public PurchaseChooserDialog whoseItemsAre(List<String> items) {
        this.items = new ArrayList<>(items);
        return this;
    }

    public PurchaseChooserDialog whoseSearchHintIs(String hint) {
        this.hint = hint;
        return this;
    }

    /**
     * Specifies the query hint of the SearchView.
{'fraction_non_alphanumeric': 0.09523809523809523, 'fraction_numerical': 0.006211180124223602, 'mean_word_length': 3.405775075987842, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1120977', 'n_tokens_mistral': 893, 'n_tokens_neox': 840, 'n_words': 176}