List of usage examples for android.widget ListView setTextFilterEnabled
public void setTextFilterEnabled(boolean textFilterEnabled)
From source file:com.savedollars.ProductShippingPriceDisplay.java
@Override protected void onCreate(Bundle savedInstanceState) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites() .detectNetwork().penaltyLog().build()); JSONData = (getIntent().getStringExtra("JsonData")); if (JSONData != null) { parseJsonData(JSONData);//ww w. jav a2 s. c om } super.onCreate(savedInstanceState); setContentView(R.layout.pdtshippingpriceview); // Setting Product Name TextView productName = (TextView) findViewById(R.id.pdtNameTextView); productName.setText(pdtName); Iterator objMapIterator = sortedMap.entrySet().iterator(); int rowIndex = 0; PDT_INFO = new String[totalCount][2]; while (objMapIterator.hasNext()) { Map.Entry keyValuePairs = (Map.Entry) objMapIterator.next(); String key = ProductTotalPriceDisplay.merchantNames[rowIndex]; PDT_INFO[rowIndex][0] = key; PDT_INFO[rowIndex][1] = "$" + String.valueOf(sortedMap.get(key)); rowIndex++; } ListViewAdapter listv = new ListViewAdapter(this, PDT_INFO); setListAdapter(listv); final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { lv.getItemAtPosition(position); String pdtKey = PDT_INFO[position][0]; String merchantLink = (String) merchantLinkMap.get(pdtKey); Uri uri = Uri.parse(merchantLink); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); } }); }
From source file:markson.visuals.sitapp.CCActivity.java
public void json() { ListAdapter adapter = new SimpleAdapter(this, mylist, R.layout.jsontest, new String[] { "cclass", "fdate" }, new int[] { R.id.item_title, R.id.item_subtitle }); setListAdapter(adapter);/*from w ww .j a va 2 s . co m*/ final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { @SuppressWarnings("unchecked") HashMap<String, String> o = (HashMap<String, String>) lv.getItemAtPosition(position); // Toast.makeText(eventActivity.this,"ID '" + o.get("link") + // "' was clicked.",Toast.LENGTH_SHORT).show(); TextView title = (TextView) findViewById(R.id.item_title); Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/roboto/Roboto-Regular.ttf"); title.setTypeface(tf); TextView subtitle = (TextView) findViewById(R.id.item_subtitle); subtitle.setTypeface(tf); date = o.get("date"); cclass = o.get("cclass"); num = o.get("num"); instructor = o.get("instructor"); crn = o.get("crn"); fdate = o.get("date"); time = o.get("time"); download(); } }); }
From source file:com.savedollars.ProductStockDisplay.java
@Override protected void onCreate(Bundle savedInstanceState) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites() .detectNetwork().penaltyLog().build()); JSONData = (getIntent().getStringExtra("JsonData")); if (JSONData != null) { parseJsonData(JSONData);/*w w w.j a v a 2 s . c o m*/ } super.onCreate(savedInstanceState); setContentView(R.layout.pdtstockview); // Setting Product Name TextView productName = (TextView) findViewById(R.id.pdtNameTextView); productName.setText(pdtName); Iterator it = sortedMap.keySet().iterator(); int rowIndex = 0; PDT_INFO = new String[totalCount][2]; while (it.hasNext()) { String key = ProductTotalPriceDisplay.merchantNames[rowIndex]; String availability = (String) availabilityMap.get(key); PDT_INFO[rowIndex][0] = key; PDT_INFO[rowIndex][1] = availability; rowIndex++; it.next(); } ListViewAdapter listv = new ListViewAdapter(this, PDT_INFO); setListAdapter(listv); final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { lv.getItemAtPosition(position); String pdtKey = PDT_INFO[position][0]; String merchantLink = (String) merchantLinkMap.get(pdtKey); Uri uri = Uri.parse(merchantLink); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); } }); }
From source file:com.savedollars.ProductPriceDisplay.java
@SuppressWarnings({ "rawtypes", "unused" }) @Override//w w w . j a v a 2 s.co m protected void onCreate(Bundle savedInstanceState) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites() .detectNetwork().penaltyLog().build()); JSONData = (getIntent().getStringExtra("JsonData")); if (JSONData != null) { parseJsonData(JSONData); } super.onCreate(savedInstanceState); setContentView(R.layout.pdtpriceview); // Setting Product Name TextView productName = (TextView) findViewById(R.id.pdtNameTextView); productName.setText(pdtName); Iterator objMapIterator = sortedMap.entrySet().iterator(); int rowIndex = 0; PDT_INFO = new String[totalCount][2]; while (objMapIterator.hasNext()) { Map.Entry keyValuePairs = (Map.Entry) objMapIterator.next(); String key = ProductTotalPriceDisplay.merchantNames[rowIndex]; PDT_INFO[rowIndex][0] = key; PDT_INFO[rowIndex][1] = "$" + sortedMap.get(key); rowIndex++; } ListViewAdapter listv = new ListViewAdapter(this, PDT_INFO); setListAdapter(listv); final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { lv.getItemAtPosition(position); String pdtKey = PDT_INFO[position][0]; String merchantLink = (String) merchantLinkMap.get(pdtKey); Uri uri = Uri.parse(merchantLink); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); } }); }
From source file:markson.visuals.sitapp.eventActivity.java
public void json() { ListAdapter adapter = new SimpleAdapter(this, mylist, R.layout.jsontest, new String[] { "name", "description" }, new int[] { R.id.item_title, R.id.item_subtitle }); setListAdapter(adapter);// w ww.j a v a 2 s.co m final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { @SuppressWarnings("unchecked") HashMap<String, String> o = (HashMap<String, String>) lv.getItemAtPosition(position); // Toast.makeText(eventActivity.this,"ID '" + o.get("link") + // "' was clicked.",Toast.LENGTH_SHORT).show(); TextView title = (TextView) findViewById(R.id.item_title); Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/roboto/Roboto-Regular.ttf"); title.setTypeface(tf); TextView subtitle = (TextView) findViewById(R.id.item_subtitle); subtitle.setTypeface(tf); date = o.get("pubDate"); link = o.get("link"); description = o.get("description"); name = o.get("name"); download(); } }); }
From source file:com.microsoft.live.sample.hotmail.ContactsActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.view_contacts); ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { @Override//from w w w . j a v a 2s . com public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Contact contact = (Contact) parent.getItemAtPosition(position); ViewContactDialog dialog = new ViewContactDialog(ContactsActivity.this, contact); dialog.setOwnerActivity(ContactsActivity.this); dialog.show(); } }); LinearLayout layout = new LinearLayout(this); Button newCalendarButton = new Button(this); newCalendarButton.setText("New Contact"); newCalendarButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { CreateContactDialog dialog = new CreateContactDialog(ContactsActivity.this); dialog.setOwnerActivity(ContactsActivity.this); dialog.show(); } }); layout.addView(newCalendarButton); lv.addHeaderView(layout); mAdapter = new ContactsListAdapter(this); setListAdapter(mAdapter); LiveSdkSampleApplication app = (LiveSdkSampleApplication) getApplication(); mClient = app.getConnectClient(); }
From source file:edu.stanford.mobisocial.dungbeetle.ui.fragments.FeedMembersFragment.java
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setFastScrollEnabled(true);/*from ww w .j av a2s. c om*/ //registerForContextMenu(lv); lv.setOnItemClickListener(this); //lv.setCacheColorHint(Feed.colorFor(groupName, Feed.BACKGROUND_ALPHA)); }
From source file:com.savedollars.ProductTotalPriceDisplay.java
@Override protected void onCreate(Bundle savedInstanceState) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites() .detectNetwork().penaltyLog().build()); String barcodeNumber = (getIntent().getStringExtra("barcodeNumber")); /*/*from w ww.j av a 2 s. c om*/ * If barcode number is scanned from main screen, Google API server call * is made to retrieve the product information. If we are returning from * existing view ( shipping, stocks) no server call is made. We display * the product information already stored in JSONData */ if (barcodeNumber != null) { getProductDetails(barcodeNumber); } else { JSONData = (getIntent().getStringExtra("JsonData")); parseJsonData(JSONData); } super.onCreate(savedInstanceState); if (totalCount == 0) { setContentView(R.layout.nopdtinfo); } else { setContentView(R.layout.pdttotalpriceview); // Setting Product Name TextView productName = (TextView) findViewById(R.id.pdtNameTextView); productName.setText(pdtName); Iterator objMapIterator = sortedMap.entrySet().iterator(); int rowIndex = 0; PDT_INFO = new String[totalCount][2]; while (objMapIterator.hasNext()) { Map.Entry keyValuePairs = (Map.Entry) objMapIterator.next(); PDT_INFO[rowIndex][0] = String.valueOf(keyValuePairs.getKey()); PDT_INFO[rowIndex][1] = "$" + String.valueOf(keyValuePairs.getValue()); rowIndex++; } ListViewAdapter listv = new ListViewAdapter(this, PDT_INFO); setListAdapter(listv); final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { lv.getItemAtPosition(position); String pdtKey = PDT_INFO[position][0]; String merchantLink = (String) merchantLinkMap.get(pdtKey); Uri uri = Uri.parse(merchantLink); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); } }); } }
From source file:org.solovyev.android.calculator.math.edit.AbstractMathEntityListFragment.java
@Override public void onViewCreated(View root, Bundle savedInstanceState) { super.onViewCreated(root, savedInstanceState); fragmentHelper.onViewCreated(this, root); final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(final AdapterView<?> parent, final View view, final int position, final long id) { final AMenuItem<T> onClick = getOnClickAction(); if (onClick != null) { onClick.onClick(((T) parent.getItemAtPosition(position)), getActivity()); }/*from w w w .ja v a 2 s . c o m*/ } }); getListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { final T item = (T) parent.getItemAtPosition(position); final List<LabeledMenuItem<T>> menuItems = getMenuItemsOnLongClick(item); if (!menuItems.isEmpty()) { final ContextMenuBuilder<LabeledMenuItem<T>, T> menuBuilder = ContextMenuBuilder.newInstance( AbstractMathEntityListFragment.this.getActivity(), "math-entity-menu", ListContextMenu.newInstance(menuItems)); menuBuilder.build(item).show(); } return true; } }); }
From source file:abanyu.transphone.taxi.controller.LoginController.java
public void makeListView(List<String> listElems) { String arr[];/*w w w . ja va 2 s.c o m*/ arr = new String[listElems.size()]; for (int idx = 0; idx < listElems.size(); idx++) { String elem = listElems.get(idx); arr[idx] = elem; } loginMVC.getLoginView() .setListAdapter(new ArrayAdapter<String>(loginMVC.getLoginView(), R.layout.listnode, arr)); ListView listView = loginMVC.getLoginView().getListView(); listView.setTextFilterEnabled(true); listView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { itemClicked = ((TextView) view).getText().toString(); if (thisMode == JSONMode.GET) setLoginDataIDs(); else getServerData(); //dont have anything to set } }); }