Example usage for android.widget ListView setChoiceMode

List of usage examples for android.widget ListView setChoiceMode

Introduction

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

Prototype

public void setChoiceMode(int choiceMode) 

Source Link

Document

Defines the choice behavior for the List.

Usage

From source file:com.abcvoipsip.ui.favorites.FavListFragment.java

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    // View management
    mDualPane = getResources().getBoolean(R.bool.use_dual_panes);

    // Modify list view
    ListView lv = getListView();
    lv.setVerticalFadingEdgeEnabled(true);
    // lv.setCacheColorHint(android.R.color.transparent);
    if (mDualPane) {
        lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
        lv.setItemsCanFocus(false);/*  www.  j  a v a2s.c  o  m*/
    } else {
        lv.setChoiceMode(ListView.CHOICE_MODE_NONE);
        lv.setItemsCanFocus(true);
    }

    // Start out with a progress indicator.
    // setListShown(false);

}

From source file:ni.org.ics.estudios.appmovil.wizard.ui.ReviewFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_page, container, false);

    TextView titleView = (TextView) rootView.findViewById(android.R.id.title);
    titleView.setText(R.string.review);// w w  w .  j  a v  a 2  s .co m
    titleView.setTextColor(getResources().getColor(R.color.review_green));

    ListView listView = (ListView) rootView.findViewById(android.R.id.list);
    setListAdapter(mReviewAdapter);
    listView.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE);
    return rootView;
}

From source file:com.iftw.materialnavigation.wizard.ui.ReviewFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_page, container, false);

    TextView titleView = (TextView) rootView.findViewById(android.R.id.title);
    titleView.setText("Review");
    titleView.setTextColor(getResources().getColor(R.color.step_pager_selected_tab_color));

    ListView listView = (ListView) rootView.findViewById(android.R.id.list);
    setListAdapter(mReviewAdapter);//  w  w  w  .java  2s .  c om
    listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    return rootView;
}

From source file:wizard.ui.ReviewFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.add_balance_fragment_page, container, false);

    TextView titleView = (TextView) rootView.findViewById(android.R.id.title);
    titleView.setText(R.string.review);//from  w  w  w. j ava2 s.c  om
    titleView.setTextColor(getResources().getColor(R.color.review_green));

    ListView listView = (ListView) rootView.findViewById(android.R.id.list);
    setListAdapter(mReviewAdapter);
    listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    return rootView;
}

From source file:com.pixplicity.wizardpager.wizard.ui.ReviewFragment.java

public View getView(LayoutInflater inflater, ViewGroup container) {
    View rootView = inflater.inflate(R.layout.fragment_page_list, container, false);

    TextView titleView = (TextView) rootView.findViewById(android.R.id.title);
    titleView.setText(R.string.wizard_review);
    titleView.setTextColor(getResources().getColor(R.color.submit_background));

    ListView listView = (ListView) rootView.findViewById(android.R.id.list);
    setListAdapter(mReviewAdapter);/* ww  w.  j a  v a  2 s.  co m*/
    listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    return rootView;
}

From source file:com.grottworkshop.gwswizardpager.ui.ReviewFragment.java

@SuppressWarnings("deprecation")
@Override//  ww w  . ja  v a2  s  .c o  m
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_page, container, false);

    TextView titleView = (TextView) rootView.findViewById(android.R.id.title);
    titleView.setText(R.string.review);
    //TODO: getColor depreciated
    titleView.setTextColor(getResources().getColor(R.color.review_green));

    ListView listView = (ListView) rootView.findViewById(android.R.id.list);
    setListAdapter(mReviewAdapter);
    listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    return rootView;
}

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 2 s . co 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));
}

From source file:pl.arnea.footballadventuremanager.wizardpager.wizard.ui.ReviewFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.wizardpager_single_page_fragment, container, false);

    TextView titleView = (TextView) rootView.findViewById(android.R.id.title);
    titleView.setText(R.string.review);/*w  w  w.  j a va2 s . c om*/
    titleView.setTextColor(getResources().getColor(R.color.review_green));

    ListView listView = (ListView) rootView.findViewById(android.R.id.list);
    setListAdapter(mReviewAdapter);
    listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    return rootView;
}

From source file:com.sharpcart.android.wizardpager.wizard.ui.ReviewFragment.java

@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
        final Bundle savedInstanceState) {
    final View rootView = inflater.inflate(R.layout.fragment_page, container, false);

    final TextView titleView = (TextView) rootView.findViewById(android.R.id.title);
    titleView.setText(R.string.review);/*from   w w w  .  j ava 2 s .c om*/
    titleView.setTextColor(getResources().getColor(R.color.review_green));

    final ListView listView = (ListView) rootView.findViewById(android.R.id.list);
    setListAdapter(mReviewAdapter);
    listView.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE);
    return rootView;
}

From source file:dev.dworks.libs.awizard.model.ui.ReviewFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_page, container, false);

    TextView titleView = (TextView) rootView.findViewById(android.R.id.title);
    titleView.setText(R.string.review);//from w w w  . ja v  a  2 s  .  com
    ((TextView) rootView.findViewById(android.R.id.title)).setText(mPage.getTitle());
    titleView.setTextColor(getResources().getColor(R.color.review_green));

    ListView listView = (ListView) rootView.findViewById(android.R.id.list);
    setListAdapter(mReviewAdapter);
    listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    return rootView;
}