Search in sources :

Example 1 with SlidingTabLayout

use of flying.grub.tamtime.slidingTab.SlidingTabLayout in project TamTime by flyingrub.

the class OneStopActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_slidingtabs);
    Bundle bundle = getIntent().getExtras();
    stop_zone_id = bundle.getInt("stop_zone_id");
    stop = Data.getData().getMap().getStopZoneById(stop_zone_id);
    toolbar = (Toolbar) findViewById(R.id.toolbar_actionbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowTitleEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setTitle(stop.getName());
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
    viewPager = (ViewPager) findViewById(R.id.viewpager);
    viewPager.setAdapter(new OneStopPageAdapter(getSupportFragmentManager()));
    favoriteStops = new FavoriteStops(getApplicationContext());
    favoriteStopLine = new FavoriteStopLine(getApplicationContext());
    slidingTabLayout = new SlidingTabLayout(getApplicationContext());
    slidingTabLayout = (SlidingTabLayout) findViewById(R.id.sliding_tabs);
    slidingTabLayout.setSelectedIndicatorColors(getResources().getColor(R.color.textClearColor));
    slidingTabLayout.setDividerColors(getResources().getColor(R.color.primaryColor));
    slidingTabLayout.setViewPager(viewPager);
}
Also used : Bundle(android.os.Bundle) SlidingTabLayout(flying.grub.tamtime.slidingTab.SlidingTabLayout) FavoriteStops(flying.grub.tamtime.data.persistence.FavoriteStops) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) FavoriteStopLine(flying.grub.tamtime.data.persistence.FavoriteStopLine)

Example 2 with SlidingTabLayout

use of flying.grub.tamtime.slidingTab.SlidingTabLayout in project TamTime by flyingrub.

the class OneLineActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_slidingtabs);
    Bundle bundle = getIntent().getExtras();
    linePosition = bundle.getInt("id");
    toolbar = (Toolbar) findViewById(R.id.toolbar_actionbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowTitleEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(true);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
    line = Data.getData().getMap().getLine(linePosition);
    viewPager = (ViewPager) findViewById(R.id.viewpager);
    viewPager.setAdapter(new OneLinePageAdapter(getSupportFragmentManager()));
    slidingTabLayout = new SlidingTabLayout(getApplicationContext());
    slidingTabLayout = (SlidingTabLayout) findViewById(R.id.sliding_tabs);
    slidingTabLayout.setSelectedIndicatorColors(getResources().getColor(R.color.textClearColor));
    slidingTabLayout.setDividerColors(getResources().getColor(R.color.primaryColor));
    slidingTabLayout.setViewPager(viewPager);
    Log.d(TAG, line.getDisruptEventList() + "");
    if (line.getDisruptEventList().size() > 0) {
        showInfo(line.getDisruptEventList().get(0).toString());
    }
    if (linePosition > 19) {
    // createAskDialog();
    }
}
Also used : Bundle(android.os.Bundle) SlidingTabLayout(flying.grub.tamtime.slidingTab.SlidingTabLayout) View(android.view.View)

Aggregations

Bundle (android.os.Bundle)2 View (android.view.View)2 SlidingTabLayout (flying.grub.tamtime.slidingTab.SlidingTabLayout)2 RecyclerView (android.support.v7.widget.RecyclerView)1 FavoriteStopLine (flying.grub.tamtime.data.persistence.FavoriteStopLine)1 FavoriteStops (flying.grub.tamtime.data.persistence.FavoriteStops)1