Search in sources :

Example 6 with Line

use of flying.grub.tamtime.data.map.Line 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

Line (flying.grub.tamtime.data.map.Line)6 StopZone (flying.grub.tamtime.data.map.StopZone)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 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 ArrayList (java.util.ArrayList)2 Intent (android.content.Intent)1 SharedPreferences (android.content.SharedPreferences)1 Bundle (android.os.Bundle)1 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