Changeset View
Changeset View
Standalone View
Standalone View
app/src/main/java/it/reyboz/bustorino/adapters/SquareStopAdapter.java
| Show All 11 Lines | BusTO - UI components | ||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
| GNU General Public License for more details. | GNU General Public License for more details. | ||||
| 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.location.Location; | |||||
| import androidx.annotation.Nullable; | import androidx.annotation.Nullable; | ||||
| 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.GPSPoint; | import it.reyboz.bustorino.backend.GPSPoint; | ||||
| import it.reyboz.bustorino.backend.RouteWithStop; | |||||
| import it.reyboz.bustorino.backend.Stop; | import it.reyboz.bustorino.backend.Stop; | ||||
| import it.reyboz.bustorino.util.StopSorterByDistance; | import it.reyboz.bustorino.util.StopSorterByDistance; | ||||
| import it.reyboz.bustorino.fragments.FragmentListenerMain; | import it.reyboz.bustorino.fragments.FragmentListenerMain; | ||||
| import java.util.Collections; | import java.util.Collections; | ||||
| import java.util.List; | import java.util.List; | ||||
| public class SquareStopAdapter extends RecyclerView.Adapter<SquareStopAdapter.SquareViewHolder> { | public class SquareStopAdapter extends RecyclerView.Adapter<SquareStopAdapter.SquareViewHolder> { | ||||
| private final static int layoutRes = R.layout.stop_card; | private final static int layoutRes = R.layout.item_stop_nearby_card; | ||||
| //private List<Stop> stops; | //private List<Stop> stops; | ||||
| private @Nullable GPSPoint userPosition; | private @Nullable GPSPoint userPosition; | ||||
| private FragmentListenerMain listener; | private FragmentListenerMain listener; | ||||
| private List<Stop> stops; | private List<Stop> stops; | ||||
| public SquareStopAdapter(@Nullable List<Stop> stopList, FragmentListenerMain fragmentListener, @Nullable GPSPoint pos) { | public SquareStopAdapter(@Nullable List<Stop> stopList, FragmentListenerMain fragmentListener, @Nullable GPSPoint pos) { | ||||
| listener = fragmentListener; | listener = fragmentListener; | ||||
| userPosition = pos; | userPosition = pos; | ||||
| ▲ Show 20 Lines • Show All 111 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