Back to project page BusTicketer.
The source code is released under:
Copyright (c) 2013, Nelspike All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Red...
If you think the Android project BusTicketer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package bus.ticketer.passenger; /* w ww .j a v a 2 s . c om*/ import bus.ticketer.adapters.CentralPagerAdapter; import bus.ticketer.listeners.BusTabListener; import bus.ticketer.listeners.SwipeListener; import android.app.ActionBar; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.*; import android.support.v4.view.ViewPager; /* * http://192.168.0.136:81/client/create/ */ public class CentralActivity extends FragmentActivity { CentralPagerAdapter mCentralActivity; ViewPager mViewPager; BusTicketer app; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_central); app = (BusTicketer) getApplicationContext(); boolean waiting = getIntent().getBooleanExtra("Waiting", false); boolean successVal = getIntent().getBooleanExtra("Success", false); app.setWaitingValidation(waiting); app.setSuccessValidity(successVal); tabHandler(); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE){ setContentView(R.layout.activity_central); } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) { setContentView(R.layout.activity_central); } } public void tabHandler() { mCentralActivity = new CentralPagerAdapter(getSupportFragmentManager()); mViewPager = (ViewPager) findViewById(R.id.CentralPager); mViewPager.setAdapter(mCentralActivity); mViewPager.setOnPageChangeListener(new SwipeListener(mViewPager, CentralActivity.this)); app.setAppViewPager(mViewPager); final ActionBar actionBar = getActionBar(); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowHomeEnabled(false); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); ActionBar.TabListener tabListener = new BusTabListener(mViewPager); actionBar.addTab(actionBar.newTab().setText("Validate") .setTabListener(tabListener)); actionBar.addTab(actionBar.newTab().setText("Buy Tickets") .setTabListener(tabListener)); /*actionBar.addTab(actionBar.newTab().setText("History") .setTabListener(tabListener));*/ } }