Example usage for android.widget LinearLayout setNextFocusUpId

List of usage examples for android.widget LinearLayout setNextFocusUpId

Introduction

In this page you can find the example usage for android.widget LinearLayout setNextFocusUpId.

Prototype

public void setNextFocusUpId(int nextFocusUpId) 

Source Link

Document

Sets the id of the view to use when the next focus is #FOCUS_UP .

Usage

From source file:com.etg.bhavanas.collapsetablayout.MainActivity.java

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

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);/*from   www  .  j a  v a 2  s . c o  m*/

    final ActionBar ab = getSupportActionBar();
    ab.setHomeAsUpIndicator(R.drawable.ic_menu);
    ab.setDisplayHomeAsUpEnabled(true);

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);

    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    if (navigationView != null) {
        setupDrawerContent(navigationView);
    }

    ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
    if (viewPager != null) {
        setupViewPager(viewPager);
    }

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Snackbar.make(view, "Here's a Snackbar", Snackbar.LENGTH_LONG).setAction("Action", null).show();
        }
    });

    TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
    tabLayout.setupWithViewPager(viewPager);
    LinearLayout ll_edit = (LinearLayout) findViewById(R.id.ll_edit);
    ll_edit.setNextFocusUpId(R.id.tabs);
}