Java Code Examples for android.widget.ListView.setFocusableInTouchMode()

The following are Jave code examples for showing how to use setFocusableInTouchMode() of the android.widget.ListView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: GitHub   File: XScrollViewActivity.java   Source Code and License Vote up 6 votes
protected void initView() {
    mHandler = new Handler();

    mScrollView = (XScrollView) findViewById(R.id.scroll_view);
    mScrollView.setPullRefreshEnable(true);
    mScrollView.setPullLoadEnable(true);
    mScrollView.setAutoLoadEnable(true);
    mScrollView.setIXScrollViewListener(this);
    mScrollView.setRefreshTime(getTime());

    View content = LayoutInflater.from(this).inflate(R.layout.vw_scroll_view_content, null);

    if (null != content) {
        mListView = (ListView) content.findViewById(R.id.content_list);
        mListView.setFocusable(false);
        mListView.setFocusableInTouchMode(false);

        mAdapter = new ArrayAdapter<String>(this, R.layout.vw_list_item, mItems);
        mListView.setAdapter(mAdapter);
        measureHeight();
    }

    mScrollView.setView(content);
}
 
Example 2
Project: microMathematics   File: FileListView.java   Source Code and License Vote up 6 votes
FileListView(Commander c)
{
    commander = c;
    listView = (ListView) commander.findViewById(R.id.fman_list_view);
    listView.setItemsCanFocus(false);
    listView.setFocusableInTouchMode(true);
    listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
    listView.setOnItemClickListener(this);
    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    {
        TypedValue outValue = new TypedValue();
        commander.getContext().getTheme().resolveAttribute(R.attr.selectableItemBackground, outValue, true);
        listView.setSelector(outValue.resourceId);
    }
    commander.registerForContextMenu(listView);
    statusPanel = (LinearLayout) commander.findViewById(R.id.fman_status_panel);
    statusPanelDivider = commander.findViewById(R.id.fman_status_panel_divider);
    statusBar = (TextView) commander.findViewById(R.id.fman_status_bar);
}