Java Code Examples for android.widget.ListView#setFocusable()

The following examples show how to use android.widget.ListView#setFocusable() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test_scroll);
    mLooperViewPager = (LoopViewPager) findViewById(R.id.viewpager);
    CircleIndicator indicator = (CircleIndicator) findViewById(R.id.indicator);
    mLooperViewPager.setAdapter(new PicAdapter(TestScrollViewActivity.this));
    mLooperViewPager.setOnDispatchTouchEventListener(mDispatchOnTouchListener);
    mLooperViewPager.setLooperPic(true);
    mListView = (ListView) findViewById(R.id.lv_data);
    mListView.setFocusable(false);
    if (mDataAdapter == null) {
        mDataAdapter = new TextAdapter();
        mListView.setAdapter(mDataAdapter);
    } else {
        mDataAdapter.notifyDataSetChanged();
    }
    setListViewHeightBasedOnChildren(mListView);
    indicator.setViewPager(mLooperViewPager);
}
 
Example 2
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 3
/**
 * Render custom item
 */
public void renderListView() {
    // get all records

    AboutJSONParser aboutJSONParser = new AboutJSONParser("vulnerabilities.json", getApplicationContext());
    ArrayList<AboutRecord> list = aboutJSONParser.parse();

    AboutAdapter adapter = new AboutAdapter(list, getApplicationContext());

    ListView listView = (ListView) findViewById(R.id.listview_about);
    listView.setFocusable(false);
    listView.setAdapter(adapter);

    this.setListViewHeightBasedOnChildren(listView, adapter);
}
 
Example 4
@Override
    public void findAndBindViews(final View contentView) {
        setDefaultImageRightVisible(true, R.attr.img_nav_font);
        setDefaultImageLeftVisible(true, R.attr.img_nav_back);
        mScrollView = (ScrollView) contentView.findViewById(R.id.scrollview);
        mPb_line = (ProgressBar) contentView.findViewById(R.id.pb_line);
        mLl_bottom = contentView.findViewById(R.id.ll_bottom);
        mLl_line = contentView.findViewById(R.id.ll_line);
        mTv_newest_commit = contentView.findViewById(R.id.tv_newest_commit);
        mLl_comment = contentView.findViewById(R.id.ll_comment);
        mLl_line_inner = contentView.findViewById(R.id.ll_line_inner);
        mTv_end = (TextView) contentView.findViewById(R.id.tv_end);
        mTv_end.setOnClickListener(this);
        mListView = (ListView) contentView.findViewById(R.id.listview);
        mIv_collect = mLl_bottom.findViewById(R.id.iv_collect);
        mIv_collect.setOnClickListener(this);
        mTv_edit = mLl_bottom.findViewById(R.id.tv_edit);
        mTv_edit.setOnClickListener(this);
        mIv_msg = mLl_bottom.findViewById(R.id.iv_msg);
        mIv_msg.setOnClickListener(this);
        mIv_share = mLl_bottom.findViewById(R.id.iv_share);
        mIv_share.setOnClickListener(this);
        mWebContent = (WebView) contentView.findViewById(R.id.webview);
        mTv_show_orgin = (TextView) contentView.findViewById(R.id.tv_show_orgin);
        mGv_tags = (GridView) contentView.findViewById(R.id.gv_tags);
        mTv_show_orgin.setOnClickListener(this);

        Bundle extras = getArguments();
        if (extras != null) {
            setTitleBarVisible(extras.getBoolean("titlebarVisible", true));
            _isBottomBarVisible = extras.getBoolean("bottombarVisible", true);
            if (!_isBottomBarVisible) {
                mTv_show_orgin.setBackgroundColor(Color.parseColor(ThemeAttrTools.getValueOfColorStrAttr(mContext, R.attr.s_web_bg)));
                mTv_show_orgin.setTextColor(Color.parseColor(ThemeAttrTools.getValueOfColorStrAttr(mContext, R.attr.s_web_txt_c)));
                mTv_show_orgin.getPaint().setUnderlineText(true);
                mLl_comment.setVisibility(View.GONE);
                mLl_bottom.setVisibility(View.GONE);
                mLl_line.setVisibility(View.GONE);
            }
            setTitleBarVisible(extras.getBoolean("titlebarVisible", true));
            setTitleBarVisible(extras.getBoolean("titlebarVisible", true));
            // link_type 1代表获取topic基本信息的url, 2代表获取topic详情的Url
            int linkType = extras.getInt("link_type");
            if (linkType == 1) {
                //banner_type "1"外链, "2"内容
                if ("1".equals(extras.getString("banner_type"))) {
                    mOnlyLink = extras.getString("link");
                    loadWebUrl(mOnlyLink);
                    return;
                }
            }
            initWebView(extras.getString("link"));
        }

        mListView.setFocusable(false);
        mGv_tags.setFocusable(false);
        mGv_tags.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
                if (mAdapterTag != null) {
                    ActivityDetailsMore.gotoFragmentTagContent(mContext, mAdapterTag.getItem(position));
                }
            }
        });
//        mWebContent.setFocusable(false); //导致网页中的输入框无法输入内容

        mDisplay = getActivity().getWindowManager().getDefaultDisplay();

        contentView.getViewTreeObserver().addOnGlobalLayoutListener(
                new ViewTreeObserver.OnGlobalLayoutListener() {
                    @SuppressWarnings("deprecation")
                    @Override
                    public void onGlobalLayout() {
                        if (mDialogReply == null || !mDialogReply.isShowing()) {
                            return;
                        }
                        Rect r = new Rect();
                        contentView.getWindowVisibleDisplayFrame(r);
                        int height = mDisplay.getHeight() - r.bottom;
                        mDialogReply.setLayoutBoardHeight(height);
                        // mListView.smoothScrollBy(-distance, 0);
                        // mListView.smoothScrollByOffset(distance);
                    }
                });
    }