Search in sources :

Example 1 with CompleteAdapter

use of de.baumann.browser.View.CompleteAdapter in project browser by scoute-dich.

the class BrowserActivity method updateAutoComplete.

@Override
public void updateAutoComplete() {
    RecordAction action = new RecordAction(this);
    action.open(false);
    List<Record> list = action.listBookmarks();
    list.addAll(action.listHistory());
    action.close();
    CompleteAdapter adapter = new CompleteAdapter(this, list);
    inputBox.setAdapter(adapter);
    adapter.notifyDataSetChanged();
    inputBox.setDropDownWidth(ViewUnit.getWindowWidth(this));
    inputBox.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            String url = ((TextView) view.findViewById(R.id.record_item_url)).getText().toString();
            inputBox.setText(url);
            inputBox.setSelection(url.length());
            updateAlbum(url);
            hideSoftInput(inputBox);
        }
    });
}
Also used : ImageView(android.widget.ImageView) HorizontalScrollView(android.widget.HorizontalScrollView) NinjaWebView(de.baumann.browser.View.NinjaWebView) AutoCompleteTextView(android.widget.AutoCompleteTextView) DynamicGridView(org.askerov.dynamicgrid.DynamicGridView) View(android.view.View) AdapterView(android.widget.AdapterView) WebView(android.webkit.WebView) TextView(android.widget.TextView) ListView(android.widget.ListView) VideoView(android.widget.VideoView) Paint(android.graphics.Paint) RecordAction(de.baumann.browser.Database.RecordAction) Record(de.baumann.browser.Database.Record) Adapter_Record(de.baumann.browser.View.Adapter_Record) CompleteAdapter(de.baumann.browser.View.CompleteAdapter) AdapterView(android.widget.AdapterView) AutoCompleteTextView(android.widget.AutoCompleteTextView) TextView(android.widget.TextView)

Aggregations

Paint (android.graphics.Paint)1 View (android.view.View)1 WebView (android.webkit.WebView)1 AdapterView (android.widget.AdapterView)1 AutoCompleteTextView (android.widget.AutoCompleteTextView)1 HorizontalScrollView (android.widget.HorizontalScrollView)1 ImageView (android.widget.ImageView)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 VideoView (android.widget.VideoView)1 Record (de.baumann.browser.Database.Record)1 RecordAction (de.baumann.browser.Database.RecordAction)1 Adapter_Record (de.baumann.browser.View.Adapter_Record)1 CompleteAdapter (de.baumann.browser.View.CompleteAdapter)1 NinjaWebView (de.baumann.browser.View.NinjaWebView)1 DynamicGridView (org.askerov.dynamicgrid.DynamicGridView)1