Example usage for android.widget ListView setFastScrollEnabled

List of usage examples for android.widget ListView setFastScrollEnabled

Introduction

In this page you can find the example usage for android.widget ListView setFastScrollEnabled.

Prototype

public void setFastScrollEnabled(final boolean enabled) 

Source Link

Document

Specifies whether fast scrolling is enabled or disabled.

Usage

From source file:net.d53.syman.mobile.ui.GaugeListFragment.java

@Override
protected void configureList(Activity activity, ListView listView) {
    super.configureList(activity, listView);

    listView.setFastScrollEnabled(true);
}

From source file:net.d53.syman.mobile.ui.ContentListFragment.java

protected void configureList(Activity activity, ListView listView) {
    super.configureList(activity, listView);

    listView.setFastScrollEnabled(true);
    listView.setDividerHeight(0);/*from  w w w .  j  ava  2 s. c o m*/

    getListAdapter().addHeader(activity.getLayoutInflater().inflate(layout.content_list_item_labels, null));
}

From source file:net.d53.syman.mobile.ui.ReferrerListFragment.java

@Override
protected void configureList(Activity activity, ListView listView) {
    super.configureList(activity, listView);

    listView.setFastScrollEnabled(true);
    listView.setDividerHeight(0);//from  w w  w  .j a  va2  s .  c o  m

    getListAdapter().addHeader(activity.getLayoutInflater().inflate(layout.referrer_list_item_labels, null));
}

From source file:br.pro.menotti.opus.pt.DisplayPoints.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Intent intent = getIntent();//w  w w . j a  v  a 2s.c om
    final int book = intent.getIntExtra("book", 0);
    int chapter = intent.getIntExtra("chapter", 0);
    final String search_key = intent.getStringExtra("search_key");
    final boolean favorites = intent.getBooleanExtra("favorites", false);

    db = new SQLiteHelper(this);
    db.openDataBase();
    //      final String book_name = db.getBook(book).toString();

    ListView lv = (ListView) findViewById(android.R.id.list);
    lv.setFastScrollEnabled(true);

    if (favorites) {
        setTitle(getString(R.string.display_favorites));
        List<BookPoint> points = new ArrayList<BookPoint>();
        points = db.getFavoritePoints();
        lv.setAdapter(new ArrayAdapter<BookPoint>(this, android.R.layout.simple_list_item_1, points));
    } else if (search_key != null) {
        setTitle(getString(R.string.display_search) + ": " + search_key);
        List<BookPoint> points = new ArrayList<BookPoint>();
        points = db.getPoints(search_key);
        lv.setAdapter(new ArrayAdapter<BookPoint>(this, android.R.layout.simple_list_item_1, points));
    } else {
        setTitle(db.getBook(book) + ": " + db.getChapter(book, chapter));
        List<BookPoint> points = new ArrayList<BookPoint>();
        points = db.getBookPoints(book, chapter);
        lv.setAdapter(new ArrayAdapter<BookPoint>(this, android.R.layout.simple_list_item_1, points));
    }

    lv.setOnItemLongClickListener(new OnItemLongClickListener() {
        @Override
        public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
            db = new SQLiteHelper(getBaseContext());
            db.openDataBase();
            BookPoint bp = (BookPoint) parent.getItemAtPosition(position);
            DialogFragment newFragment = new DialogPoint(bp, favorites);
            newFragment.show(getSupportFragmentManager(), bp.toString());
            db.close();
            return true;
        }
    });

    db.close();
}

From source file:com.manuelpeinado.multichoiceadapter.demo.alphabetindexersample.AlphabetIndexerActivity.java

private void initList(Cursor cursor) {
    SharedPreferences prefs = getPreferences(MODE_PRIVATE);
    if (!prefs.getBoolean("dbInitialized", false)) {
        prefs.edit().putBoolean("dbInitialized", true).commit();
        rebuildList();/*from ww  w .j  av  a2s  . com*/
    }
    if (adapter == null) {
        adapter = new AlphabetIndexerCursorAdapter(savedInstanceState, this, cursor);
        adapter.setOnItemClickListener(this);
        ListView listView = getListView();
        listView.setFastScrollEnabled(true);
        adapter.setAdapterView(listView);
    } else {
        adapter.changeCursor(cursor);
    }
}

From source file:net.d53.syman.mobile.ui.TrafficListFragment.java

@Override
protected void configureList(Activity activity, ListView listView) {
    super.configureList(activity, listView);

    listView.setFastScrollEnabled(true);
    listView.setDividerHeight(0);//from  w  w  w .  ja  v a  2 s . c o  m

    View graph = activity.getLayoutInflater().inflate(layout.traffic_graph, null);
    barGraph = (GaugeGraphView) graph.findViewById(id.gauge_graph);
    getListAdapter().addHeader(graph);
    getListAdapter().addHeader(activity.getLayoutInflater().inflate(layout.traffic_list_item_labels, null));
}

From source file:com.pindroid.fragment.BrowseTagsFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    mAdapter = new SimpleCursorAdapter(this.getActivity(), R.layout.tag_view, null,
            new String[] { Tag.Name, Tag.Count }, new int[] { R.id.tag_name, R.id.tag_count }, 0);

    setListAdapter(mAdapter);/*  w w  w  .  j av a2 s .c  om*/

    getLoaderManager().initLoader(0, null, this);

    ListView lv = getListView();
    lv.setTextFilterEnabled(true);
    lv.setFastScrollEnabled(true);
    lv.setOnItemClickListener(clickListener);

    lv.setItemsCanFocus(false);
    lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
}

From source file:com.github.mobile.gauges.ui.ReferrerListFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    ListView listView = getListView();
    listView.setCacheColorHint(getResources().getColor(android.R.color.transparent));
    listView.setFastScrollEnabled(true);
    listView.setDividerHeight(0);//from w  w w  . j a  v a 2  s. c om

    if (getListAdapter() == null)
        listView.addHeaderView(
                getActivity().getLayoutInflater().inflate(layout.referrer_list_item_labels, null), null, false);
}

From source file:com.github.mobile.gauges.ui.ContentListFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    ListView listView = getListView();
    listView.setCacheColorHint(getResources().getColor(android.R.color.transparent));
    listView.setFastScrollEnabled(true);
    listView.setDividerHeight(0);/*from  ww  w .j av a 2s  .com*/

    if (getListAdapter() == null)
        listView.addHeaderView(getActivity().getLayoutInflater().inflate(layout.content_list_item_labels, null),
                null, false);
}

From source file:com.pindroid.fragment.BrowseNotesFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    setHasOptionsMenu(true);/*from   w w  w .  j a  v  a 2s . c  o  m*/

    mAdapter = new SimpleCursorAdapter(this.getActivity(), R.layout.note_view, null,
            new String[] { Note.Title }, new int[] { R.id.note_title }, 0);

    setListAdapter(mAdapter);

    getLoaderManager().initLoader(0, null, this);

    final ListView lv = getListView();
    lv.setTextFilterEnabled(true);
    lv.setFastScrollEnabled(true);

    lv.setItemsCanFocus(false);
    lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);

    lv.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            final Cursor c = (Cursor) lv.getItemAtPosition(position);
            Note n = NoteManager.CursorToNote(c);

            viewNote(n);
        }
    });

    getActivity().setTitle(getString(R.string.browse_my_notes_title));
}