Changeset View
Changeset View
Standalone View
Standalone View
app/src/main/java/it/reyboz/bustorino/adapters/ArrivalsStopAdapter.java
| Show All 13 Lines | BusTO - UI components | ||||
| You should have received a copy of the GNU General Public License | You should have received a copy of the GNU General Public License | ||||
| along with this program. If not, see <http://www.gnu.org/licenses/>. | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
| */ | */ | ||||
| package it.reyboz.bustorino.adapters; | package it.reyboz.bustorino.adapters; | ||||
| import android.content.Context; | import android.content.Context; | ||||
| import android.content.SharedPreferences; | import android.content.SharedPreferences; | ||||
| import android.location.Location; | |||||
| import androidx.annotation.NonNull; | import androidx.annotation.NonNull; | ||||
| import androidx.annotation.Nullable; | import androidx.annotation.Nullable; | ||||
| import androidx.core.util.Pair; | import androidx.core.util.Pair; | ||||
| import androidx.preference.PreferenceManager; | import androidx.preference.PreferenceManager; | ||||
| import androidx.recyclerview.widget.DiffUtil; | import androidx.recyclerview.widget.DiffUtil; | ||||
| import androidx.recyclerview.widget.RecyclerView; | import androidx.recyclerview.widget.RecyclerView; | ||||
| import android.util.Log; | import android.util.Log; | ||||
| import android.view.LayoutInflater; | import android.view.LayoutInflater; | ||||
| import android.view.View; | import android.view.View; | ||||
| import android.view.ViewGroup; | import android.view.ViewGroup; | ||||
| import android.widget.TextView; | import android.widget.TextView; | ||||
| import it.reyboz.bustorino.R; | import it.reyboz.bustorino.R; | ||||
| import it.reyboz.bustorino.backend.*; | import it.reyboz.bustorino.backend.*; | ||||
| import it.reyboz.bustorino.fragments.FragmentListenerMain; | import it.reyboz.bustorino.fragments.FragmentListenerMain; | ||||
| import java.util.*; | import java.util.*; | ||||
| public class ArrivalsStopAdapter extends RecyclerView.Adapter<ArrivalsStopAdapter.ViewHolder> implements SharedPreferences.OnSharedPreferenceChangeListener { | public class ArrivalsStopAdapter extends RecyclerView.Adapter<ArrivalsStopAdapter.ViewHolder> implements SharedPreferences.OnSharedPreferenceChangeListener { | ||||
| private final static int layoutRes = R.layout.arrivals_nearby_card; | private final static int layoutRes = R.layout.item_arrivals_nearby_card; | ||||
| //private List<Stop> stops; | //private List<Stop> stops; | ||||
| private @NonNull GPSPoint userPosition; | private @NonNull GPSPoint userPosition; | ||||
| private FragmentListenerMain listener; | private FragmentListenerMain listener; | ||||
| private List< RouteWithStop > routesPairList; | private List< RouteWithStop > routesPairList; | ||||
| private final Context context; | private final Context context; | ||||
| //Maximum number of stops to keep | //Maximum number of stops to keep | ||||
| private final int MAX_STOPS = 20; //TODO: make it programmable | private final int MAX_STOPS = 20; //TODO: make it programmable | ||||
| private final String KEY_CAPITALIZE; | private final String KEY_CAPITALIZE; | ||||
| ▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines | |||||
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register