use of flying.grub.tamtime.data.persistence.FavoriteStopLine 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);
}
use of flying.grub.tamtime.data.persistence.FavoriteStopLine in project TamTime by flyingrub.
the class HomeFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.view_recycler, container, false);
setHasOptionsMenu(true);
getActivity().setTitle(getString(R.string.home));
favoriteStopLine = new FavoriteStopLine(getContext());
favHomeView = new FavHomeView(getActivity());
favHomeView.setUpdateStopLine(new FavHomeView.AddStopLine() {
@Override
public void update(StopZone stop, Line line) {
favoriteStopLine.addLineStop(line, stop);
setupFavStopLine();
}
});
searchView = new SearchView(getActivity());
favStopLinesRecycler = (RecyclerView) view.findViewById(R.id.recycler_view);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false);
favStopLinesRecycler.setLayoutManager(layoutManager);
favStopLinesRecycler.setItemAnimator(new DefaultItemAnimator());
favStopLinesRecycler.setHasFixedSize(false);
favStopLinesRecycler.setBackgroundColor(getResources().getColor(R.color.windowBackgroundCard));
setupFavStopLine();
return view;
}
Aggregations