Search in sources :

Example 1 with SqlBean

use of framework.db.SqlBean in project AndroidDevelop by 7449.

the class SearchActivity method startDialog.

private void startDialog() {
    List<SqlBean> fictionNameAll = GreenDaoDbUtils.getFictionNameAll();
    View view = View.inflate(getApplicationContext(), R.layout.dialog_search, null);
    editText = (EditText) view.findViewById(R.id.search_et);
    final FlowLayout flowLayout = (FlowLayout) view.findViewById(R.id.flow);
    flowLayout.removeAllViews();
    alertDialog = new AlertDialog.Builder(this).setTitle(getString(R.string.fiction_name)).setView(view).setNegativeButton(getString(R.string.dialog_unok), null).setPositiveButton(getString(R.string.dialog_ok), this).create();
    alertDialog.show();
    for (int i = 0; i < fictionNameAll.size(); i++) {
        FlowText textView = new FlowText(flowLayout.getContext());
        textView.setText(fictionNameAll.get(i).getTitle());
        textView.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                FlowText flowText = (FlowText) v;
                fictionName = flowText.getText().toString().trim();
                startNetWork();
                alertDialog.dismiss();
            }
        });
        flowLayout.addView(textView);
    }
    editText.setOnFocusChangeListener(this);
}
Also used : FlowLayout(org.apmem.tools.layouts.FlowLayout) SqlBean(framework.db.SqlBean) FlowText(framework.widget.FlowText) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) SearchView(com.fiction.y.search.v.SearchView)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 SearchView (com.fiction.y.search.v.SearchView)1 SqlBean (framework.db.SqlBean)1 FlowText (framework.widget.FlowText)1 FlowLayout (org.apmem.tools.layouts.FlowLayout)1