Page MenuHomeGitPull.it

D223.1776776810.diff
No OneTemporary

Size
38 KB
Referenced Files
None
Subscribers
None

D223.1776776810.diff

diff --git a/app/src/main/java/it/reyboz/bustorino/backend/Palina.java b/app/src/main/java/it/reyboz/bustorino/backend/Palina.java
--- a/app/src/main/java/it/reyboz/bustorino/backend/Palina.java
+++ b/app/src/main/java/it/reyboz/bustorino/backend/Palina.java
@@ -42,7 +42,7 @@
* Not in a way that makes sense and keeps the code readable, at least.
*/
public class Palina extends Stop implements Parcelable {
- private ArrayList<Route> routes = new ArrayList<>();
+ private ArrayList<Route> routes = new ArrayList<>(); // the routes with arrival times
private boolean routesModified = false;
private Passaggio.Source allSource = null;
@@ -52,7 +52,7 @@
public Palina(Stop s){
super(s.ID,s.getStopDefaultName(),s.getStopUserName(),s.location,s.type,
- s.getRoutesThatStopHere(),s.getLatitude(),s.getLongitude(), null);
+ s.getRoutesThatStopHere(),s.getLatitude(),s.getLongitude(), s.gtfsID);
}
public Palina(@NonNull String ID, @Nullable String name, @Nullable String userName,
@@ -111,6 +111,21 @@
routes = new ArrayList<>(routeList);
}
+ /**
+ * Remove all arrivals from this Palina
+ */
+ public void clearRoutes(){
+ routes.clear();
+ }
+
+ /**
+ * Check how many routes (from arrival times) we have
+ * @return the number of routes
+ */
+ public int getNumRoutesWithArrivals(){
+ return routes.size();
+ }
+
@Nullable
@Override
protected String buildRoutesString() {
diff --git a/app/src/main/java/it/reyboz/bustorino/backend/mato/MapiArrivalRequest.java b/app/src/main/java/it/reyboz/bustorino/backend/mato/MapiArrivalRequest.java
--- a/app/src/main/java/it/reyboz/bustorino/backend/mato/MapiArrivalRequest.java
+++ b/app/src/main/java/it/reyboz/bustorino/backend/mato/MapiArrivalRequest.java
@@ -86,7 +86,7 @@
throw new AuthFailureError("Error with JSON enconding",e);
}
String requestBody = data.toString();
- Log.d(DEBUG_TAG, "Request variables: "+ variables);
+ Log.d(DEBUG_TAG, "MaTO arrivals request variables: "+ variables);
return requestBody.getBytes();
}
@@ -111,7 +111,7 @@
p = MatoAPIFetcher.Companion.parseStopJSON(currentObj);
if (p.gtfsID != null) {
- if(p.gtfsID.contains("gtt:")){
+ if(p.gtfsID.contains("gtt:")){ // this is apparently sufficient
//valid stop
stopFound = true;
break;
@@ -139,15 +139,4 @@
*/
return Response.success(p, HttpHeaderParser.parseCacheHeaders(response));
}
-
- public class StopNotFoundError extends VolleyError{
-
- public StopNotFoundError(String message) {
- super(message);
- }
-
- public StopNotFoundError() {
- super();
- }
- }
}
diff --git a/app/src/main/java/it/reyboz/bustorino/backend/mato/MatoAPIFetcher.kt b/app/src/main/java/it/reyboz/bustorino/backend/mato/MatoAPIFetcher.kt
--- a/app/src/main/java/it/reyboz/bustorino/backend/mato/MatoAPIFetcher.kt
+++ b/app/src/main/java/it/reyboz/bustorino/backend/mato/MatoAPIFetcher.kt
@@ -21,7 +21,6 @@
import android.util.Log
import com.android.volley.DefaultRetryPolicy
import com.android.volley.toolbox.RequestFuture
-import it.reyboz.bustorino.BuildConfig
import it.reyboz.bustorino.backend.*
import it.reyboz.bustorino.data.gtfs.GtfsAgency
import it.reyboz.bustorino.data.gtfs.GtfsFeed
@@ -52,15 +51,16 @@
stopID!!
val now = Calendar.getInstance().time
- var numMinutes = 30
+ var numMinutes = 60
var palina = Palina(stopID)
- var numPassaggi = 0
var trials = 0
val numDepartures = 8
- while (numPassaggi < minNumPassaggi && trials < 2) {
+ var moreTime = false
+ var palinaOK = false
+ while (trials <20 && !palinaOK) {
//numDepartures+=2
- numMinutes += 20
+ if (moreTime) numMinutes *= 2 //duplicate time
val future = RequestFuture.newFuture<Palina>()
val request = MapiArrivalRequest(stopID, now, numMinutes * 60, numDepartures, res, future, future)
if (appContext == null || res == null) {
@@ -71,15 +71,17 @@
request.setTag(getVolleyReqTag(MatoQueries.QueryType.ARRIVALS))
requestQueue.add(request)
+ moreTime = false
try {
- val palinaResult = future.get(5, TimeUnit.SECONDS)
+ val palinaResult = future.get(15, TimeUnit.SECONDS)
if (palinaResult!=null) {
- /*if (BuildConfig.DEBUG)
- for (r in palinaResult.queryAllRoutes()){
- Log.d(DEBUG_TAG, "route " + r.gtfsId + " has " + r.passaggi.size + " passaggi: "+ r.passaggiToString)
- }*/
+
palina = palinaResult
- numPassaggi = palina.minNumberOfPassages
+ if(palina.totalNumberOfPassages < minNumPassaggi && numMinutes < MAX_MINUTES_SEARCH) {
+ moreTime = true
+ } else{
+ palinaOK = true
+ }
} else{
Log.d(DEBUG_TAG, "Result palina is null")
}
@@ -109,8 +111,8 @@
const val VOLLEY_TAG = "MatoAPIFetcher"
const val DEBUG_TAG = "BusTO:MatoAPIFetcher"
- const val DEF_MIN_NUMPASSAGGI=2
-
+ const val DEF_MIN_NUMPASSAGGI = 5
+ const val MAX_MINUTES_SEARCH = 24*60 // a day in minutes
val REQ_PARAMETERS = mapOf(
"Content-Type" to "application/json; charset=utf-8",
"DNT" to "1",
diff --git a/app/src/main/java/it/reyboz/bustorino/fragments/ArrivalsFragment.kt b/app/src/main/java/it/reyboz/bustorino/fragments/ArrivalsFragment.kt
--- a/app/src/main/java/it/reyboz/bustorino/fragments/ArrivalsFragment.kt
+++ b/app/src/main/java/it/reyboz/bustorino/fragments/ArrivalsFragment.kt
@@ -66,7 +66,7 @@
//Views
protected lateinit var addToFavorites: ImageButton
protected lateinit var openInMapButton: ImageButton
- protected lateinit var timesSourceTextView: TextView
+ protected lateinit var arrivalsSourceTextView: TextView
private lateinit var messageTextView: TextView
private lateinit var preMessageTextView: TextView // this hold the "Arrivals at: " text
protected lateinit var arrivalsRecyclerView: RecyclerView
@@ -187,21 +187,20 @@
manager.orientation
)
arrivalsRecyclerView.addItemDecoration(mDividerItemDecoration)
- timesSourceTextView = root.findViewById(R.id.timesSourceTextView)
- timesSourceTextView.setOnLongClickListener { view: View? ->
+ arrivalsSourceTextView = root.findViewById(R.id.timesSourceTextView)
+ arrivalsSourceTextView.setOnLongClickListener { view: View? ->
if (!fetchersChangeRequestPending) {
rotateFetchers()
//Show we are changing provider
- timesSourceTextView.setText(R.string.arrival_source_changing)
+ arrivalsSourceTextView.setText(R.string.arrival_source_changing)
- //mListener.requestArrivalsForStopID(stopID)
requestArrivalsForTheFragment()
fetchersChangeRequestPending = true
return@setOnLongClickListener true
}
false
}
- timesSourceTextView.setOnClickListener(View.OnClickListener { view: View? ->
+ arrivalsSourceTextView.setOnClickListener(View.OnClickListener { view: View? ->
Toast.makeText(
context, R.string.change_arrivals_source_message, Toast.LENGTH_SHORT
)
@@ -246,35 +245,52 @@
timesSourceTextView.setText(sourcesTextViewData);
}*/
//need to do this when we recreate the fragment but we haven't updated the arrival times
- lastUpdatedPalina?.let { showArrivalsSources(it) }
- /*if (lastUpdatedPalina?.queryAllRoutes() != null && lastUpdatedPalina!!.queryAllRoutes()!!.size >0){
- showArrivalsSources(lastUpdatedPalina!!)
- } else{
- Log.d(DEBUG_TAG, "No routes names")
+ if(lastUpdatedPalina == null && arrivalsViewModel.palinaLiveData.value != null) {
+ //this updates lastUpdatedPalina and also shows the arrival source
+ updateFragmentData(arrivalsViewModel.palinaLiveData.value!!)
+
}
+ //lastUpdatedPalina?.let { showArrivalsSources(it) }
- */
+ arrivalsViewModel.arrivalsRequestRunningLiveData.observe(viewLifecycleOwner, { running ->
+ //UI CHANGES TO APPLY WHEN THE REQUEST IS RUNNING
+ mListener.toggleSpinner(running)
+ if(running){
+ //different way of setting this flag
+ if(lastUpdatedPalina == null || lastUpdatedPalina?.totalNumberOfPassages==0) {
+ showLoadingMessageForFirstTime()
+ }
+ } else{
+ //stopped running, we can show the palina
+ //val uname = lastUpdatedPalina?.stopDisplayName
+ if (lastUpdatedPalina == null || lastUpdatedPalina?.numRoutesWithArrivals == 0) {
+ //no passages and result is not valid
+ setUIForNoStopFound()
+ }
+ }
+ })
arrivalsViewModel.palinaLiveData.observe(viewLifecycleOwner){
- mListener.toggleSpinner(false)
- Log.d(DEBUG_TAG, "New result palina observed, has coords: ${it.hasCoords()}")
- if(arrivalsViewModel.resultLiveData.value==Fetcher.Result.OK){
- //the result is true
- changeUIFirstSearchActive(false)
+ Log.d(DEBUG_TAG, "New result palina observed, has coords: ${it.hasCoords()}, title ${it?.stopDisplayName}, number of passages: ${it.totalNumberOfPassages}")
+
+ val palinaIsValid = it!=null && (it.totalNumberOfPassages>0 || it.stopDisplayName!=null)
+ if (palinaIsValid){
updateFragmentData(it)
- } else{
- progressBar.visibility=View.INVISIBLE
- // Avoid showing this ugly message if we have found the stop, clearly it exists but GTT doesn't provide arrival times
- if (stopName==null)
- loadingMessageTextView.text = getString(R.string.no_bus_stop_have_this_name)
- else
- loadingMessageTextView.text = getString(R.string.no_arrivals_stop)
+ }
+ if(arrivalsViewModel.arrivalsRequestRunningLiveData.value ==false) {
+ //finished loading
+ if (palinaIsValid) {
+ //the result is true
+ hideLoadingMessageAndShowResults()
+ } else {
+ setUIForNoStopFound()
+ }
}
}
-
+ // this is only for the progress
arrivalsViewModel.sourcesLiveData.observe(viewLifecycleOwner){
Log.d(DEBUG_TAG, "Using arrivals source: $it")
val srcString = getDisplayArrivalsSource(it,requireContext())
@@ -282,24 +298,25 @@
}
arrivalsViewModel.resultLiveData.observe(viewLifecycleOwner){res ->
+ val src = arrivalsViewModel.sourcesLiveData.value
when (res) {
Fetcher.Result.OK -> {}
- Fetcher.Result.CLIENT_OFFLINE -> showToastMessage(R.string.network_error, true)
+ Fetcher.Result.CLIENT_OFFLINE -> showFetcherMessage(R.string.network_error, src)
Fetcher.Result.SERVER_ERROR -> {
if (utils.isConnected(context)) {
- showToastMessage(R.string.parsing_error, true)
+ showFetcherMessage(R.string.parsing_error, src)
} else {
- showToastMessage(R.string.network_error, true)
+ showFetcherMessage(R.string.network_error, src)
}
- showToastMessage(R.string.internal_error,true)
+ showFetcherMessage(R.string.internal_error,src)
}
- Fetcher.Result.PARSER_ERROR -> showShortToast(R.string.internal_error)
- Fetcher.Result.QUERY_TOO_SHORT -> showShortToast(R.string.query_too_short)
- Fetcher.Result.EMPTY_RESULT_SET -> showShortToast(R.string.no_arrivals_stop)
+ Fetcher.Result.PARSER_ERROR -> showFetcherMessage(R.string.internal_error, src)
+ Fetcher.Result.QUERY_TOO_SHORT -> showFetcherMessage(R.string.query_too_short, src)
+ Fetcher.Result.EMPTY_RESULT_SET -> showFetcherMessage(R.string.no_arrivals_stop, src)
- Fetcher.Result.NOT_FOUND -> showShortToast(R.string.no_bus_stop_have_this_name)
- else -> showShortToast(R.string.internal_error)
+ Fetcher.Result.NOT_FOUND -> showFetcherMessage(R.string.no_bus_stop_have_this_name, src)
+ else -> showFetcherMessage(R.string.internal_error, src)
}
}
return root
@@ -308,8 +325,18 @@
private fun showShortToast(id: Int) = showToastMessage(id,true)
+ private fun showFetcherMessage(id: Int, source: Source?){
+ val srcString = source?.let{ getDisplayArrivalsSource(it,requireContext())}
+ if (srcString!=null){
+ Toast.makeText(requireContext(), id, Toast.LENGTH_SHORT).show()
+ } else{
+ val message = getString(id)
- private fun changeUIFirstSearchActive(yes: Boolean){
+ Toast.makeText(requireContext(), "$srcString : $message", Toast.LENGTH_SHORT).show()
+ }
+ }
+
+ /*private fun changeUIFirstSearchActive(yes: Boolean){
if(yes){
resultsLayout.visibility = View.GONE
progressBar.visibility = View.VISIBLE
@@ -321,18 +348,32 @@
}
}
+ */
+ private fun showLoadingMessageForFirstTime(){
+ resultsLayout.visibility = View.GONE
+ progressBar.visibility = View.VISIBLE
+ loadingMessageTextView.visibility = View.VISIBLE
+ }
+ private fun hideLoadingMessageAndShowResults(){
+ resultsLayout.visibility = View.VISIBLE
+ progressBar.visibility = View.GONE
+ loadingMessageTextView.visibility = View.GONE
+ }
+
+ private fun setUIForNoStopFound(){
+ progressBar.visibility=View.INVISIBLE
+ // Avoid showing this ugly message if we have found the stop, clearly it exists but GTT doesn't provide arrival times
+ if (stopName==null)
+ loadingMessageTextView.text = getString(R.string.no_bus_stop_have_this_name)
+ else
+ loadingMessageTextView.text = getString(R.string.no_arrivals_stop)
+ }
+
override fun onResume() {
super.onResume()
val loaderManager = loaderManager
Log.d(DEBUG_TAG, "OnResume, justCreated $justCreated, lastUpdatedPalina is: $lastUpdatedPalina")
- /*if(needUpdateOnAttach){
- updateFragmentData(null);
- needUpdateOnAttach=false;
- }*/
- /*if(lastUpdatedPalina!=null){
- updateFragmentData(null);
- showArrivalsSources(lastUpdatedPalina);
- }*/
+
mListener.readyGUIfor(FragmentKind.ARRIVALS)
//fix bug when the list adapter is null
@@ -350,7 +391,7 @@
} else {
//start first search
requestArrivalsForTheFragment()
- changeUIFirstSearchActive(true)
+ showLoadingMessageForFirstTime()
justCreated = false
}
//start the loader
@@ -421,15 +462,6 @@
setOption(requireContext(), OPTION_SHOW_LEGEND, false)
}
- /*val currentFetchersAsArray: Array<ArrivalsFetcher?>
- get() {
- val arr = arrayOfNulls<ArrivalsFetcher>(fetchers!!.size)
- fetchers!!.toArray<ArrivalsFetcher>(arr)
- return arr
- }
-
- */
-
fun getCurrentFetchersAsArray(): Array<out ArrivalsFetcher?> {
val r= fetchers.toTypedArray()
//?: emptyArray<ArrivalsFetcher>()
@@ -462,7 +494,11 @@
}
val adapter = PalinaAdapter(context, lastUpdatedPalina, palinaClickListener, true)
- showArrivalsSources(lastUpdatedPalina!!)
+ p?.let {
+ //only update the sources if we have actual passaggi
+ if (arrivalsViewModel.arrivalsRequestRunningLiveData.value == false)
+ showArrivalsSources(lastUpdatedPalina!!)
+ }
resetListAdapter(adapter)
lastUpdatedPalina?.let{ pal ->
openInMapButton.setOnClickListener {
@@ -508,13 +544,13 @@
val updatedFetchers = adjustFetchersToSource(source)
if (!updatedFetchers) Log.w(DEBUG_TAG, "Tried to update the source fetcher but it didn't work")
val base_message = getString(R.string.times_source_fmt, source_txt)
- timesSourceTextView.text = base_message
- timesSourceTextView.visibility = View.VISIBLE
+ arrivalsSourceTextView.text = base_message
+ arrivalsSourceTextView.visibility = View.VISIBLE
if (p.totalNumberOfPassages > 0) {
- timesSourceTextView.visibility = View.VISIBLE
+ arrivalsSourceTextView.visibility = View.VISIBLE
} else {
- timesSourceTextView.visibility = View.INVISIBLE
+ arrivalsSourceTextView.visibility = View.INVISIBLE
}
fetchersChangeRequestPending = false
}
@@ -716,7 +752,7 @@
override fun onDestroyView() {
//arrivalsRecyclerView = null
if (arguments != null) {
- requireArguments().putString(SOURCES_TEXT, timesSourceTextView.text.toString())
+ requireArguments().putString(SOURCES_TEXT, arrivalsSourceTextView.text.toString())
requireArguments().putString(MESSAGE_TEXT_VIEW, messageTextView.text.toString())
}
super.onDestroyView()
@@ -738,8 +774,7 @@
fun requestArrivalsForTheFragment(){
// Run with previous fetchers
- //fragment.getCurrentFetchers().toArray()
- //AsyncArrivalsSearcher(, getCurrentFetchersAsArray(), context).execute(stopID)
+
context?.let {
mListener.toggleSpinner(true)
val fetcherSources = fetchers.map { f-> f?.sourceForFetcher?.name ?: "" }
diff --git a/app/src/main/java/it/reyboz/bustorino/fragments/MainScreenFragment.java b/app/src/main/java/it/reyboz/bustorino/fragments/MainScreenFragment.java
--- a/app/src/main/java/it/reyboz/bustorino/fragments/MainScreenFragment.java
+++ b/app/src/main/java/it/reyboz/bustorino/fragments/MainScreenFragment.java
@@ -101,9 +101,6 @@
private final Runnable refreshStop = new Runnable() {
public void run() {
if(getContext() == null) return;
- List<ArrivalsFetcher> fetcherList = utils.getDefaultArrivalsFetchers(getContext());
- ArrivalsFetcher[] arrivalsFetchers = new ArrivalsFetcher[fetcherList.size()];
- arrivalsFetchers = fetcherList.toArray(arrivalsFetchers);
if (childFragMan.findFragmentById(R.id.resultFrame) instanceof ArrivalsFragment) {
ArrivalsFragment fragment = (ArrivalsFragment) childFragMan.findFragmentById(R.id.resultFrame);
@@ -117,8 +114,12 @@
//new AsyncArrivalsSearcher(fragmentHelper, fragment.getCurrentFetchersAsArray(), getContext()).execute(stopName);
fragment.requestArrivalsForTheFragment();
}
- } else //we create a new fragment, which is WRONG
+ } else { //we create a new fragment, which is WRONG
+ List<ArrivalsFetcher> fetcherList = utils.getDefaultArrivalsFetchers(getContext());
+ ArrivalsFetcher[] arrivalsFetchers = new ArrivalsFetcher[fetcherList.size()];
+ arrivalsFetchers = fetcherList.toArray(arrivalsFetchers);
new AsyncArrivalsSearcher(fragmentHelper, arrivalsFetchers, getContext()).execute();
+ }
}
};
//
diff --git a/app/src/main/java/it/reyboz/bustorino/viewmodels/ArrivalsViewModel.kt b/app/src/main/java/it/reyboz/bustorino/viewmodels/ArrivalsViewModel.kt
--- a/app/src/main/java/it/reyboz/bustorino/viewmodels/ArrivalsViewModel.kt
+++ b/app/src/main/java/it/reyboz/bustorino/viewmodels/ArrivalsViewModel.kt
@@ -25,7 +25,7 @@
val palinaLiveData = MediatorLiveData<Palina>()
val sourcesLiveData = MediatorLiveData<Passaggio.Source>()
- val resultLiveData = MediatorLiveData<Fetcher.Result>()
+ val resultLiveData = MutableLiveData<Fetcher.Result>()
val currentFetchers = MediatorLiveData<List<ArrivalsFetcher>>()
@@ -35,6 +35,9 @@
private var stopIdRequested = ""
private val stopFromDB = MutableLiveData<Stop>()
+
+ val arrivalsRequestRunningLiveData = MutableLiveData(false)
+
private val oldRepoStopCallback = OldDataRepository.Callback<List<Stop>>{ stopListRes ->
if(stopIdRequested.isEmpty()) return@Callback
@@ -53,23 +56,36 @@
init {
appContext = application.applicationContext
+
palinaLiveData.addSource(stopFromDB){
s ->
val hasSource = palinaLiveData.value?.passaggiSourceIfAny
Log.d(DEBUG_TAG, "Have current palina ${palinaLiveData.value!=null}, source passaggi $hasSource, new incoming stop $s from database")
- val newp = Palina.mergePaline(palinaLiveData.value, Palina(s))
- newp?.let { palinaLiveData.value = it }
+ val newp = if(palinaLiveData.value == null) Palina(s) else Palina.mergePaline(palinaLiveData.value, Palina(s))
+ Log.d(DEBUG_TAG, "Merged palina: $newp, num passages: ${newp?.totalNumberOfPassages}, has coords: ${newp?.hasCoords()}")
+ newp?.let { pal -> palinaLiveData.postValue(pal) }
}
+
}
+ fun clearPalinaArrivals(palina: Palina) : Palina{
+ palina.clearRoutes()
+ return palina
+ }
fun requestArrivalsForStop(stopId: String, fetchers: List<ArrivalsFetcher>){
val context = appContext //application.applicationContext
currentFetchers.value = fetchers
+ //THIS IS TOTALLY WRONG!!!
+ /*palinaLiveData.value?.let{
+ palinaLiveData.value = clearPalinaArrivals(it)
+ }
+
+ */
//request stop from the DB
stopIdRequested = stopId
oldRepo.requestStopsWithGtfsIDs(listOf("gtt:$stopId"), oldRepoStopCallback)
-
+ arrivalsRequestRunningLiveData.value = true
viewModelScope.launch(Dispatchers.IO){
runArrivalsFetching(stopId, fetchers, context)
}
@@ -84,6 +100,7 @@
if (fetchers.isEmpty()) {
//do nothing
+ arrivalsRequestRunningLiveData.postValue(false)
return
}
@@ -166,7 +183,7 @@
// Se abbiamo un risultato OK, restituiamo la palina
if (resultRef.get() == Fetcher.Result.OK) {
setResultAndPalinaFromFetchers(palina, Fetcher.Result.OK)
- //TODO: Rotate the fetchers appropriately
+
return
}
//end Fetchers loop
@@ -179,10 +196,13 @@
resultPalina?.let {
setResultAndPalinaFromFetchers(it, resultRef.get())
}
-
+ //in ogni caso, settiamo la richiesta come conclusa
+ arrivalsRequestRunningLiveData.postValue(false)
+ Log.d(DEBUG_TAG, "Finished fetchers available to search arrivals for palina stop $stopId")
}
private fun setResultAndPalinaFromFetchers(palina: Palina, fetcherResult: Fetcher.Result) {
+ arrivalsRequestRunningLiveData.postValue(false)
resultLiveData.postValue(fetcherResult)
Log.d(DEBUG_TAG, "Have new result palina for stop ${palina.ID}, source ${palina.passaggiSourceIfAny} has coords: ${palina.hasCoords()}")
Log.d(DEBUG_TAG, "Old palina liveData is: ${palinaLiveData.value?.stopDisplayName}, has Coords ${palinaLiveData.value?.hasCoords()}")
diff --git a/app/src/main/res/layout/fragment_arrivals.xml b/app/src/main/res/layout/fragment_arrivals.xml
--- a/app/src/main/res/layout/fragment_arrivals.xml
+++ b/app/src/main/res/layout/fragment_arrivals.xml
@@ -13,11 +13,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="5dp"
- app:cardElevation="5dp"
+ app:cardElevation="4dp"
android:layout_alignParentTop="true"
- android:layout_marginStart="8sp"
- android:layout_marginEnd="8sp"
+ android:layout_marginStart="10sp"
+ android:layout_marginEnd="10sp"
android:layout_marginTop="5sp"
+ android:layout_marginBottom="2sp"
android:padding="8sp"
>
<androidx.constraintlayout.widget.ConstraintLayout
@@ -221,7 +222,7 @@
<View
android:id="@+id/divider_arr"
android:layout_width="match_parent"
- android:layout_height="1dp"
+ android:layout_height="2dp"
android:background="@color/grey_200"
/>
@@ -231,7 +232,6 @@
android:id="@+id/timesSourceTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
android:text=""
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20sp"
diff --git a/app/src/main/res/layout/fragment_lines_detail.xml b/app/src/main/res/layout/fragment_lines_detail.xml
--- a/app/src/main/res/layout/fragment_lines_detail.xml
+++ b/app/src/main/res/layout/fragment_lines_detail.xml
@@ -9,40 +9,49 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
- <TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:textAppearance="@style/TextAppearance.AppCompat.Headline"
- android:text="Line 10"
- android:id="@+id/titleTextView"
- android:textAlignment="center"
- android:textSize="28sp"
+ <TextView
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:textAppearance="@style/TextAppearance.AppCompat.Headline"
+ android:text="Line 10"
+ android:id="@+id/titleTextView"
+ android:textAlignment="center"
+ android:textSize="25sp"
+ android:fontFamily="@font/lato_bold"
- app:layout_constraintTop_toTopOf="parent"
- android:layout_marginTop="8dp" android:gravity="center_horizontal|center_vertical"
- app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
- android:layout_marginStart="8dp" android:layout_marginEnd="8dp"/>
+ app:layout_constraintTop_toTopOf="parent"
+ android:layout_marginTop="8dp" android:gravity="center_horizontal|center_vertical"
+ app:layout_constraintEnd_toStartOf="@id/switchImageButton"
+ app:layout_constraintStart_toEndOf="@id/starCardView"
+ android:layout_marginStart="8dp" android:layout_marginEnd="8dp"
+ app:layout_constraintBottom_toBottomOf="@+id/switchImageButton"/>
<ImageButton
android:src="@drawable/ic_list_30"
android:layout_width="wrap_content"
- android:layout_height="wrap_content" android:id="@+id/switchImageButton"
+ android:layout_height="wrap_content"
+ android:id="@+id/switchImageButton"
app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintRight_toRightOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@id/titleTextView"
android:layout_margin="6dp"
android:backgroundTint="@color/blue_620"
/>
<androidx.cardview.widget.CardView
- android:layout_width="wrap_content" android:layout_height="30dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/switchImageButton"
app:layout_constraintBottom_toBottomOf="@id/switchImageButton"
+ app:layout_constraintEnd_toStartOf="@id/titleTextView"
android:id="@+id/starCardView"
android:layout_marginStart="10dp"
- android:minHeight="20sp"
- android:elevation="10dp"
+ android:elevation="8dp"
android:padding="5dp">
<ImageButton
android:id="@+id/favoritesButton"
- android:layout_width="45dp"
- android:layout_height="match_parent"
+ android:layout_width="40dp"
+ android:layout_height="40dp"
android:layout_gravity="end"
android:background="@android:color/transparent"
android:foreground="?attr/selectableItemBackground"
@@ -51,22 +60,27 @@
</androidx.cardview.widget.CardView>
<TextView
android:text="DCCII"
- android:layout_width="wrap_content"
+ android:layout_width="0dp"
+ android:layout_marginStart="18dp"
+ android:layout_marginEnd="18dp"
android:layout_height="wrap_content" android:id="@+id/lineDescripTextView"
app:layout_constraintTop_toBottomOf="@id/switchImageButton"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:textColor="@color/grey_700"
- android:textSize="16sp"
+ android:fontFamily="@font/lato_regular"
+ android:textSize="18sp"
+ android:gravity="center"
android:maxWidth="300sp"
- android:layout_marginTop="8dp"/>
+ android:layout_marginTop="12dp"
+ />
<Spinner
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/patternsSpinner"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/headingToTextView"
- android:layout_marginTop="4dp" app:layout_constraintTop_toBottomOf="@+id/lineDescripTextView"
- android:layout_marginStart="4dp"/>
+ android:layout_marginTop="6dp" app:layout_constraintTop_toBottomOf="@+id/lineDescripTextView"
+ android:layout_marginStart="5dp"/>
<TextView
android:text="@string/direction_duep"
android:layout_width="wrap_content"
@@ -77,7 +91,7 @@
android:textColor="?android:attr/textColorPrimary"
android:gravity="center_vertical"
android:textSize="18sp"
- android:layout_marginLeft="10dp"
+ android:layout_marginStart="10dp"
app:layout_constraintTop_toTopOf="@+id/patternsSpinner"
app:layout_constraintBottom_toBottomOf="@+id/patternsSpinner"
diff --git a/app/src/main/res/layout/fragment_list_view.xml b/app/src/main/res/layout/fragment_list_view.xml
--- a/app/src/main/res/layout/fragment_list_view.xml
+++ b/app/src/main/res/layout/fragment_list_view.xml
@@ -8,9 +8,11 @@
android:id="@+id/messageCardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- fab:cardElevation="2dp"
+ fab:cardElevation="4dp"
fab:cardCornerRadius="5dp"
- android:layout_margin="16dp">
+ android:layout_marginStart="10sp"
+ android:layout_marginEnd="10sp"
+ android:layout_marginTop="10sp">
<TextView
android:id="@+id/messageTextView"
diff --git a/app/src/main/res/layout/fragment_main_screen.xml b/app/src/main/res/layout/fragment_main_screen.xml
--- a/app/src/main/res/layout/fragment_main_screen.xml
+++ b/app/src/main/res/layout/fragment_main_screen.xml
@@ -1,20 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context=".fragments.MainScreenFragment"
- android:paddingTop="10dip"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto"
+ tools:context=".fragments.MainScreenFragment"
+ android:paddingTop="10dip"
+>
>
-
<ImageButton
android:id="@+id/QRButton"
style="?android:attr/borderlessButtonStyle"
android:layout_width="40dip"
android:layout_height="40dip"
android:layout_alignBottom="@+id/searchButton"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:background="@drawable/qrcode_button_custom"
@@ -86,10 +84,9 @@
android:layout_width="match_parent"
android:layout_height="8dp"
android:layout_alignParentEnd="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentRight="true"
android:layout_alignParentStart="true"
- android:layout_below="@+id/searchButton"
+ android:layout_below="@+id/QRButton"
+ android:layout_marginTop="3dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:indeterminateOnly="true"
@@ -108,6 +105,7 @@
android:layout_alignParentRight="true"
android:layout_gravity="bottom|end"
android:layout_below="@+id/searchButton"
+ android:layout_marginTop="5dp"
>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -67,7 +67,7 @@
<string name="database_update_req">Forcer la mise à jour de la base de données</string>
<string name="arrivals_card_at_the_stop">à l\'arrêt</string>
<string name="show_arrivals">Afficher les arrivées</string>
- <string name="source_mato">Appli Muoversi a Torino</string>
+ <string name="source_mato">Muoversi a Torino</string>
<string name="mqtt_notification_text">Le service de localisation en temps réel MaTO live bus est en cours d\'exécution</string>
<string name="storage_permission">stockage</string>
<string name="stop_search_view_title">Rechercher par arrêt</string>
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -166,7 +166,7 @@
<string name="fivetapifetcher">App GTT</string>
<string name="gttjsonfetcher">Sito GTT</string>
<string name="fivetscraper">Sito 5T Torino</string>
- <string name="source_mato">App Muoversi a Torino</string>
+ <string name="source_mato">Muoversi a Torino</string>
<string name="undetermined_source">Sconosciuta</string>
<string name="arrival_times_choice_title">Fonti orari di arrivo</string>
<string name="arrival_times_choice_explanation">Scegli le fonti di orari da usare</string>
diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml
--- a/app/src/main/res/values-nl/strings.xml
+++ b/app/src/main/res/values-nl/strings.xml
@@ -104,7 +104,7 @@
<string name="fivetapifetcher">GTT Applicatie</string>
<string name="gttjsonfetcher">GTT Website</string>
<string name="fivetscraper">5T Torino website</string>
- <string name="source_mato">Muoversi a Torino app</string>
+ <string name="source_mato">Muoversi a Torino</string>
<string name="undetermined_source">Onbepaald</string>
<string name="change_arrivals_source_message">Ingedrukt houden om aankomsten bron te veranderen</string>
<string name="arrival_times_choice_title">Bronnen van aankomsttijden</string>
diff --git a/app/src/main/res/values/keys.xml b/app/src/main/res/values/keys.xml
--- a/app/src/main/res/values/keys.xml
+++ b/app/src/main/res/values/keys.xml
@@ -24,7 +24,6 @@
<array name="arrivals_sources_values_default">
<item>matofetcher</item>
<item>gttjsonfetcher</item>
- <item>fivetscraper</item>
</array>
<string name="pref_positions_source">pref_positions_source</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -207,7 +207,7 @@
<string name="fivetapifetcher">GTT App</string>
<string name="gttjsonfetcher">GTT Website</string>
<string name="fivetscraper">5T Torino website</string>
- <string name="source_mato">Muoversi a Torino app</string>
+ <string name="source_mato">Muoversi a Torino</string>
<string name="undetermined_source">Undetermined</string>
<string name="arrival_source_changing">Changing arrival times source…</string>
<string name="change_arrivals_source_message">Long press to change the source of arrivals</string>

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 21, 15:06 (21 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1859810
Default Alt Text
D223.1776776810.diff (38 KB)

Event Timeline