Example usage for android.view View setFocusable

List of usage examples for android.view View setFocusable

Introduction

In this page you can find the example usage for android.view View setFocusable.

Prototype

public void setFocusable(@Focusable int focusable) 

Source Link

Document

Sets whether this view can receive focus.

Usage

From source file:org.mythdroid.remote.NavRemote.java

/**
 * Setup the interactive views/*from   w w w .  jav a2 s.c o m*/
 * @param gesture true for 'gesture' layout, false for 'button'
 */
private void setupViews(boolean gesture) {
    setContentView(gesture ? R.layout.nav_gesture_remote : R.layout.nav_remote);

    locView = (TextView) findViewById(R.id.loc);
    itemView = (TextView) findViewById(R.id.item);

    if (locS != null)
        locView.setText(locS);
    if (itemS != null)
        itemView.setText(itemS);

    if (feMgr != null)
        try {
            updateLoc();
        } catch (IOException e) {
            ErrUtil.err(this, e);
        } catch (IllegalArgumentException e) {
            ErrUtil.reportErr(this, e);
        }

    if (gesture) {
        findViewById(R.id.back).setOnClickListener(this);
        return;
    }

    final View view = findViewById(R.id.nav_remote);

    for (final View v : view.getTouchables()) {
        v.setOnClickListener(this);
        v.setFocusable(false);
    }

}

From source file:com.hobby.uiframework.widget.PagerSlidingTab.java

private void addTab(final int position, View tab) {
    tab.setFocusable(true);
    tab.setOnClickListener(new OnClickListener() {
        @Override/*from  w ww  . j  a  v  a 2 s  . c o  m*/
        public void onClick(View v) {
            if (position != selectedPosition) {
                pager.setCurrentItem(position);
            }

        }
    });

    tab.setPadding(tabPadding, 0, tabPadding, 0);
    tabsContainer.addView(tab, position, shouldExpand ? expandedTabLayoutParams : defaultTabLayoutParams);
}

From source file:ar.com.xpasta.Controls.PagerSlidingTabStrip.java

private void addTab(final int position, View tab) {
    tab.setFocusable(true);
    tab.setOnClickListener(new OnClickListener() {
        @Override//w  w w.j av  a  2s.  co  m
        public void onClick(View v) {
            pager.setCurrentItem(position);
        }
    });
    tab.setPadding(tabPadding, 0, tabPadding, 0);
    tabsContainer.addView(tab, position, shouldExpand ? expandedTabLayoutParams : defaultTabLayoutParams);
}

From source file:com.example.jingzhongjie.tabbarviewtest.widget.PagerSlidingTabStrip.java

private void addTab(final int position, View tab) {
    tab.setFocusable(true);
    tab.setOnClickListener(new OnClickListener() {
        @Override/* ww  w.j a va2  s  .  c  o m*/
        public void onClick(View v) {
            pager.setCurrentItem(position);
        }
    });

    int padding = shouldExpand ? 0 : tabPadding;
    tab.setPadding(padding, 0, padding, 0);
    tabsContainer.addView(tab, position, shouldExpand ? expandedTabLayoutParams : defaultTabLayoutParams);
}

From source file:com.gc.materialdesign.views.PagerSlidingTabStrip.java

private void addTab(final int position, View tab) {
    tab.setFocusable(true);
    tab.setOnClickListener(new OnClickListener() {
        @Override/* ww  w .j  a v a2s.  c  o  m*/
        public void onClick(View v) {
            pager.setCurrentItem(position);
            updateTabStyles(position);
        }
    });
    tab.setPadding(tabPadding, 0, tabPadding, 0);
    tabsContainer.addView(tab, position, shouldExpand ? expandedTabLayoutParams : defaultTabLayoutParams);
}

From source file:com.cardvlaue.sys.redenvelope.PagerSlidingTabStrip.java

private void addTab(final int position, View tab) {
    tab.setFocusable(true);
    tab.setOnClickListener(v -> pager.setCurrentItem(position));

    tab.setPadding(tabPadding, 0, tabPadding, 0);
    tabsContainer.addView(tab, position, shouldExpand ? expandedTabLayoutParams : defaultTabLayoutParams);
}

From source file:com.chenl.widgets.flippablestackview.indicator.OrientedPagerSlidingTabLayout.java

private void addTab(final int position, View tab) {
    tab.setFocusable(true);
    tab.setOnClickListener(new OnClickListener() {
        @Override/*w w  w .  j  a  v  a2  s. com*/
        public void onClick(View v) {
            mPager.setCurrentItem(position);
        }
    });
    tab.setPadding(tabPadding, 0, tabPadding, 0);
    LinearLayout.LayoutParams params = shouldExpand ? expandedTabLayoutParams : defaultTabLayoutParams;
    params.setMargins(tabMargins, tabMargins, tabMargins, tabMargins);
    tabsContainer.addView(tab, position, params);
}

From source file:com.mn.tiger.widget.viewpager.TGPagerSlidingTabStrip.java

private void addTab(final int position, View tab) {
    tab.setFocusable(true);
    tab.setOnClickListener(new OnClickListener() {
        @Override//from w  w  w.  j a va  2 s .c  o  m
        public void onClick(View v) {
            pager.setCurrentItem(position);
        }
    });

    tab.setPadding(tabPaddingLeftRight, tabPaddingTop, tabPaddingLeftRight, tabPaddingBottom);
    tabsContainer.addView(tab, position, shouldExpand ? expandedTabLayoutParams : defaultTabLayoutParams);
}

From source file:sad.zzq.com.selectaddressdemo.views.PagerSlidingTabStrip.java

private void addTab(final int position, final View tab) {
    tab.setFocusable(true);
    tab.setOnClickListener(new OnClickListener() {

        @Override//  ww w .  j  a  v  a2 s  . co m
        public void onClick(View arg0) {
            mTabOnClickListener.onClick(tab, position);
        }
    });

    tab.setPadding(tabPadding, 0, tabPadding, 0);
    tabsContainer.addView(tab, position, shouldExpand ? expandedTabLayoutParams : defaultTabLayoutParams);
}

From source file:com.cumt.view.PagerSlidingTabStrip.java

private void addTab(final int position, View tab) {
    tab.setFocusable(true);
    tab.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            pager.setCurrentItem(position);
        }/* ww  w . j av  a2 s. c o  m*/
    });

    tab.setPadding(tabPadding, 0, tabPadding, 0);
    tabsContainer.addView(tab, position, shouldExpand ? expandedTabLayoutParams : defaultTabLayoutParams);
}