List of usage examples for android.widget LinearLayout setNestedScrollingEnabled
public void setNestedScrollingEnabled(boolean enabled)
From source file:app.jorge.mobile.com.transportalert.ScrollingActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_scrolling); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar);/*from ww w . ja v a2s . co m*/ fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(this); LinearLayout item = (LinearLayout) findViewById(R.id.rv); addAllCards(item); // asynchronous Retrofit retrofit = new Retrofit.Builder().baseUrl(getString(R.string.url_tfl_api)) .addConverterFactory(GsonConverterFactory.create()).build(); TaskService taskService = retrofit.create(TaskService.class); Call<List<StatusLine>> call = taskService.login(getString(R.string.app_id), getString(R.string.app_key)); call.enqueue(this); //view.setVisibility(View.GONE); item.setNestedScrollingEnabled(true); mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout); mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary); mSwipeRefreshLayout.setOnRefreshListener(this); if (firstTime) { // if running is false // call your intent funtions Toast.makeText(getApplicationContext(), "FIRST TIME", Toast.LENGTH_LONG).show(); scheduleAlarm(); firstTime = false; } else { Toast.makeText(getApplicationContext(), "It is RUNNING!!!!!!!", Toast.LENGTH_LONG).show(); } }