Search in sources :

Example 11 with StopZone

use of flying.grub.tamtime.data.map.StopZone in project TamTime by flyingrub.

the class FavoriteStopLine method getFromPref.

private void getFromPref() {
    SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
    favoriteStopLine = new ArrayList<>();
    for (String info : defaultSharedPreferences.getStringSet(TAG, new HashSet<String>())) {
        String[] infos = info.split("<>");
        StopZone s = Data.getData().getMap().getStopZoneById(Integer.parseInt(infos[0]));
        Line l = Data.getData().getMap().getLineByNum(Integer.parseInt(infos[1]));
        favoriteStopLine.add(new LineStop(s, l));
    }
}
Also used : Line(flying.grub.tamtime.data.map.Line) SharedPreferences(android.content.SharedPreferences) StopZone(flying.grub.tamtime.data.map.StopZone)

Aggregations

StopZone (flying.grub.tamtime.data.map.StopZone)11 Intent (android.content.Intent)5 Bundle (android.os.Bundle)5 Line (flying.grub.tamtime.data.map.Line)5 RecyclerView (android.support.v7.widget.RecyclerView)4 View (android.view.View)4 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)3 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)3 ArrayList (java.util.ArrayList)3 SharedPreferences (android.content.SharedPreferences)2 TextView (android.widget.TextView)2 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)2 FavoriteStopLine (flying.grub.tamtime.data.persistence.FavoriteStopLine)2 FavHomeView (flying.grub.tamtime.layout.FavHomeView)2 SearchView (flying.grub.tamtime.layout.SearchView)2 PopupMenu (android.support.v7.widget.PopupMenu)1 MenuItem (android.view.MenuItem)1 ImageView (android.widget.ImageView)1 LinearLayout (android.widget.LinearLayout)1 OneStopActivity (flying.grub.tamtime.activity.OneStopActivity)1