Search in sources :

Example 1 with FavoriteStopLine

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);
}
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 FavoriteStopLine

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;
}
Also used : FavoriteStopLine(flying.grub.tamtime.data.persistence.FavoriteStopLine) Line(flying.grub.tamtime.data.map.Line) SearchView(flying.grub.tamtime.layout.SearchView) FavHomeView(flying.grub.tamtime.layout.FavHomeView) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) SearchView(flying.grub.tamtime.layout.SearchView) FavHomeView(flying.grub.tamtime.layout.FavHomeView) StopZone(flying.grub.tamtime.data.map.StopZone) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator) FavoriteStopLine(flying.grub.tamtime.data.persistence.FavoriteStopLine)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)2 View (android.view.View)2 FavoriteStopLine (flying.grub.tamtime.data.persistence.FavoriteStopLine)2 Bundle (android.os.Bundle)1 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 Line (flying.grub.tamtime.data.map.Line)1 StopZone (flying.grub.tamtime.data.map.StopZone)1 FavoriteStops (flying.grub.tamtime.data.persistence.FavoriteStops)1 FavHomeView (flying.grub.tamtime.layout.FavHomeView)1 SearchView (flying.grub.tamtime.layout.SearchView)1 SlidingTabLayout (flying.grub.tamtime.slidingTab.SlidingTabLayout)1