List of usage examples for android.widget ListView setTextFilterEnabled
public void setTextFilterEnabled(boolean textFilterEnabled)
From source file:fm.krui.kruifm.TwitterFragment.java
@Override public void onImageDownloaded(Bitmap bitmap) { Log.v(TAG, "Twitter profile picture saved."); // Build adapter using downloaded bitmap adapter = new TweetAdapter(getActivity(), tweetList, bitmap); // Bind adapter to this list to display its data. setListAdapter(adapter);/*from w ww. ja va 2 s. com*/ final ListView lv = getListView(); lv.setTextFilterEnabled(true); showLoadingScreen(false); }
From source file:com.pindroid.fragment.SelectTagsFragment.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); setHasOptionsMenu(true);/* ww w.j a v a2s .co m*/ mAdapter = new SimpleCursorAdapter(this.getActivity(), android.R.layout.simple_list_item_multiple_choice, null, new String[] { Tag.Name }, new int[] { android.R.id.text1 }, 0); setListAdapter(mAdapter); getLoaderManager().initLoader(0, null, this); ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setFastScrollEnabled(true); lv.setItemsCanFocus(false); lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); }
From source file:com.jimsuplee.femaleastronauts.FemaleAstronautsActivity.java
@Override public void onCreate(Bundle savedInstanceState) { //photoMap.put("ACAZ C.2 2 seat fighter",R.drawable.belgium); //Shannon_Walker //Dorothy_Marie_Dottie_Metcalf_Lindenburger super.onCreate(savedInstanceState); Context ctx = getApplicationContext(); setContentView(R.layout.activity_female_astronauts); Resources res = ctx.getResources(); String[] options = res.getStringArray(R.array.astronauts); TypedArray icons = res.obtainTypedArray(R.array.astronaut_icons); setListAdapter(new ImageAndTextAdapter(ctx, R.layout.main_list_item, options, icons)); ListView listView = getListView(); listView.setTextFilterEnabled(true); listView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { //Intent i = new Intent(""); Intent iAstronaut = new Intent("com.jimsuplee.femaleastronauts.Astronaut"); //NO/*from ww w .j ava2 s . c o m*/ //Intent iAstronaut = new Intent("Astronaut"); //NO:This item is not a TextView but is a LinearLayout //String astronautChoice = ((TextView) view).getText().toString(); LinearLayout ll = (LinearLayout) view; TextView tv = (TextView) ll.findViewById(R.id.option_text); String astronautChoice = tv.getText().toString(); iAstronaut.putExtra("astronautChoice", astronautChoice); //startActivityForResult(iAstronaut, 0); //Log.w(TAG, "In Astronaut, about to startActivity(iAstronaut)"); startActivity(iAstronaut); //i.setData(Uri.parse(astronautChoice)); //setResult(RESULT_OK, i); //finish(); } }); }
From source file:com.deliciousdroid.fragment.MainSearchResultsFragment.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); base = (FragmentBaseActivity) getActivity(); base.setTitle(R.string.main_search_results_title); String[] MENU_ITEMS = new String[] { getString(R.string.search_results_bookmark), getString(R.string.search_results_tag), getString(R.string.search_results_global_tag) }; setListAdapter(new ArrayAdapter<String>(base, R.layout.main_view, MENU_ITEMS)); final Intent intent = base.getIntent(); if (Intent.ACTION_SEARCH.equals(intent.getAction())) { if (intent.hasExtra(SearchManager.QUERY)) { Intent i = new Intent(base, MainSearchResultsFragment.class); i.putExtras(intent.getExtras()); startActivity(i);/*from www.j a va 2 s.co m*/ base.finish(); } else { base.onSearchRequested(); } } else if (Intent.ACTION_VIEW.equals(intent.getAction())) { Uri data = intent.getData(); String path = null; String tagname = null; if (data != null) { path = data.getPath(); tagname = data.getQueryParameter("tagname"); } if (data.getScheme() == null || !data.getScheme().equals("content")) { Intent i = new Intent(Intent.ACTION_VIEW, data); startActivity(i); base.finish(); } else if (path.contains("bookmarks") && TextUtils.isDigitsOnly(data.getLastPathSegment())) { Intent viewBookmark = new Intent(base, ViewBookmark.class); viewBookmark.setData(data); Log.d("View Bookmark Uri", data.toString()); startActivity(viewBookmark); base.finish(); } else if (tagname != null) { Intent viewTags = new Intent(base, BrowseBookmarks.class); viewTags.setData(data); Log.d("View Tags Uri", data.toString()); startActivity(viewTags); base.finish(); } } ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (position == 0) { searchActionListener.onBookmarkSearch(); } else if (position == 1) { searchActionListener.onTagSearch(); } else if (position == 2) { searchActionListener.onGlobalTagSearch(); } } }); }
From source file:mobisocial.musubi.ui.fragments.EmailUnclaimedMembersFragment.java
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setFastScrollEnabled(true);/*w w w . j ava 2 s. co m*/ //registerForContextMenu(lv); lv.setOnItemClickListener(this); lv.setCacheColorHint(Color.WHITE); }
From source file:com.tmendes.birthdaydroid.ContactListFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment_contact_list, container, false); this.ctx = container.getContext(); PreferenceManager.setDefaultValues(this.ctx, R.xml.preferences, false); this.birthdayData = BirthDayDataList.getBirthDayDataList(this.ctx); getPermissionToReadUserContacts();/*from ww w . j a v a2s . c om*/ this.adapter = new BirthDayArrayAdapter(this.ctx, this.birthdayData.getList()); ListView listView = (ListView) v.findViewById(R.id.lvContacts); listView.setTextFilterEnabled(true); listView.setAdapter(this.adapter); inputSearch = (EditText) v.findViewById(R.id.inputSearch); getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); inputSearch.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) { // When user changed the Text adapter.getFilter().filter(cs.toString()); } @Override public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) { } @Override public void afterTextChanged(Editable arg0) { String text = inputSearch.getText().toString(); adapter.getFilter().filter(text); } }); this.updateSettings(); return v; }
From source file:org.authme.android.core.DeviceListFragment.java
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); // Restore the previously serialized activated item position. if (savedInstanceState != null && savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) { setActivatedPosition(savedInstanceState.getInt(STATE_ACTIVATED_POSITION)); }//from w w w. ja v a2 s . c o m ListView lv = getListView(); lv.setTextFilterEnabled(true); /* Register the button */ Button button = (Button) getView().findViewById(R.id.ReloadButton); if (button != null) { button.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { LoadDevicesTask loadDevicesTask = new LoadDevicesTask(); //noinspection unchecked loadDevicesTask.execute(); } }); } }
From source file:cz.tomas.StockAnalyze.activity.NewsActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.news_layout); this.listView = (PullToRefreshListView) this.findViewById(R.id.listView); listView.setOnRefreshListener(new OnRefreshListener() { @Override//from w w w . j a v a2 s. c om public void onRefresh() { refresh(); } }); final ListView refreshableView = listView.getRefreshableView(); refreshableView.setTextFilterEnabled(true); refreshableView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long rowId) { Intent intent = new Intent(NewsActivity.this, NewsDetailActivity.class); intent.putExtra(EXTRA_NEWS_POSITION, position - refreshableView.getHeaderViewsCount()); startActivity(intent); } }); this.adapter = new NewsListAdapter(this, null); refreshableView.setAdapter(this.adapter); this.getSupportLoaderManager().initLoader(0, null, this); }
From source file:br.com.oficinapp.blog.restclient.MainActivity.java
/** Lifecycle: Atividade criada. */ @Override//from ww w . ja va 2s . co m public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.state_list); ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Toast.makeText(getApplicationContext(), ((TextView) view).getText(), Toast.LENGTH_SHORT).show(); } }); }
From source file:org.authme.android.core.AuthListFragment.java
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); // Restore the previously serialized activated item position. if (savedInstanceState != null && savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) { setActivatedPosition(savedInstanceState.getInt(STATE_ACTIVATED_POSITION)); }//from www . j av a 2s .co m ListView lv = getListView(); lv.setTextFilterEnabled(true); /* Register the button */ Button button = (Button) getView().findViewById(R.id.ReloadButton); if (button != null) { button.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { authListAdapter.loadAuths(); doNotificationClear(); } }); } }