diff --git a/.bzrignore b/.bzrignore
new file mode 100644
index 0000000..ee70358
--- /dev/null
+++ b/.bzrignore
@@ -0,0 +1,4 @@
+gen
+bin
+assets
+libs
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index c1b3e60..47d7b8f 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,30 +1,39 @@
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/activity_about.xml b/res/layout/activity_about.xml
new file mode 100644
index 0000000..9899073
--- /dev/null
+++ b/res/layout/activity_about.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/res/layout/main_activity.xml b/res/layout/main_activity.xml
index 72d8f65..e4cbb58 100644
--- a/res/layout/main_activity.xml
+++ b/res/layout/main_activity.xml
@@ -1,69 +1,71 @@
+ android:id="@+id/searchTitleTextView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignLeft="@+id/annoyingFedbackProgress"
+ android:layout_alignRight="@+id/searchButton"
+ android:text="@string/insert_bus_stop_number" />
diff --git a/res/menu/main.xml b/res/menu/main.xml
index 01f3340..ec1a7f3 100644
--- a/res/menu/main.xml
+++ b/res/menu/main.xml
@@ -1,11 +1,16 @@
-
+
+
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index f463fce..07da9b8 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -1,13 +1,39 @@
BusTO
- Ciao mondo!
Impostazioni
Cerca
Inserisci il numero della fermata.
Errore di rete. Verifica l\'accesso ad Internet
Nessun arrivo previsto per questa fermata :(
Passaggi fermata %1$s:
+ Info
+ Informazioni
+ BENVENUTO!
-
+ Grazie per usare BusTO, un\'app indipendente nata dalla necessità di spostarsi a Torino attraverso software libero .
+
+ Perchè amare quest\'app?
+
+
+ - Non verrai mai monitorato
+ - Non vedrai mai noiose pubblicità
+ - La tua privacy sarà sempre al sicuro
+ - Inoltre, è molto leggera!
+
+
+ Come funziona
+ Quest\'app ottiene i passaggi dei bus attraverso i dati forniti pubblicamente dal sito http://www.5t.torino.it .
+
+ Crediti e note
+ L\'app e il relativo codice sorgente sono distribuiti da Valerio Bozzolan attraverso doppia licenza:
+ la Gnu General Public License v3+ (GNU GPLv3+ ) e la Creative Commons Attribuzione - Condividi allo stesso modo 4.0 Internazionale (CC 4.0 By-Sa ).
+ Ciò è per permettere a chiunque di usare, studiare, migliorare e ricondividere quest\'app in qualunque mezzo e per qualsiasi scopo : A patto di mantenere sempre questi diritti e attribuendo sempre a Valerio Bozzolan il codice sorgente originario.
+
+ Quest\'applicazione è rilasciata nella speranza che sia utile a tutti ma senza alcuna garanzia (nè garanzie di commerciabilità). Se ti accorgi di qualche difetto o se hai idee, riportale .
+
+ Codice sorgente: lp:bus-torino .
+ ]]>
+
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 58aeff8..cbf7625 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1,13 +1,13 @@
BusTO
- Hello world!
Settings
Search
Please insert the number of the bus stop.
Network Error. Is network available?
No arrival times for this station :(
Passages bus stop %1$s:
-
+ About
+ About
diff --git a/src/it/reyboz/bustorino/AboutActivity.java b/src/it/reyboz/bustorino/AboutActivity.java
new file mode 100644
index 0000000..cb93500
--- /dev/null
+++ b/src/it/reyboz/bustorino/AboutActivity.java
@@ -0,0 +1,42 @@
+package it.reyboz.bustorino;
+
+import android.support.v7.app.ActionBarActivity;
+import android.text.Html;
+import android.text.Spanned;
+import android.text.method.LinkMovementMethod;
+import android.os.Bundle;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.widget.TextView;
+
+public class AboutActivity extends ActionBarActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_about);
+ Spanned htmlText = Html.fromHtml(getResources().getString(R.string.about_history));
+ TextView aboutTextView = (TextView) findViewById(R.id.aboutTextView);
+ aboutTextView.setText(htmlText);
+ aboutTextView.setMovementMethod(LinkMovementMethod.getInstance());
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu; this adds items to the action bar if it is present.
+ // getMenuInflater().inflate(R.menu.about, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle action bar item clicks here. The action bar will
+ // automatically handle clicks on the Home/Up button, so long
+ // as you specify a parent activity in AndroidManifest.xml.
+ int id = item.getItemId();
+/* if (id == R.id.action_settings) {
+ return true;
+ }*/
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/src/it/reyboz/bustorino/MainActivity.java b/src/it/reyboz/bustorino/MainActivity.java
index b92e530..1a736c0 100644
--- a/src/it/reyboz/bustorino/MainActivity.java
+++ b/src/it/reyboz/bustorino/MainActivity.java
@@ -1,107 +1,114 @@
package it.reyboz.bustorino;
import java.util.ArrayList;
import java.util.HashMap;
import it.reyboz.bustorino.GTTSiteSucker.ArrivalsAtBusStop;
import it.reyboz.bustorino.GTTSiteSucker.BusStop;
import android.support.v7.app.ActionBarActivity;
+import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends ActionBarActivity {
private TextView busStationName;
- private EditText bus_stop_number_editText;
+ private EditText busStopNumberEditText;
private ProgressBar annoyingFedbackProgressBar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
busStationName = (TextView) findViewById(R.id.busStationName);
- bus_stop_number_editText = (EditText) findViewById(R.id.busStopNumberEditText);
+ busStopNumberEditText = (EditText) findViewById(R.id.busStopNumberEditText);
annoyingFedbackProgressBar = (ProgressBar) findViewById(R.id.annoyingFedbackProgress);
annoyingFedbackProgressBar.setVisibility(View.INVISIBLE);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
- int id = item.getItemId();
- if (id == R.id.action_settings) {
- return true;
+ switch(item.getItemId()) {
+ /*case R.id.action_settings:
+ Intent intentSettings = new Intent(MainActivity.this,AboutActivity.class);
+ startActivity(intentSettings);
+ return true;*/
+ case R.id.action_about:
+ Intent intentAbout = new Intent(MainActivity.this,AboutActivity.class);
+ startActivity(intentAbout);
+ return true;
}
return super.onOptionsItemSelected(item);
}
/**
* Catch the Async action!
*
* @author boz
*/
public class MyAsyncWget extends AsyncWget {
protected void onPostExecute(String result) {
ArrayList> data = new ArrayList>();
BusStop busStop = GTTSiteSucker.arrivalTimesBylineHTMLSucker(result);
ArrivalsAtBusStop[] arrivalsAtBusStop = busStop.getArrivalsAtBusStop();
for (ArrivalsAtBusStop arrivalAtBusStop : arrivalsAtBusStop) {
HashMap personMap = new HashMap();
personMap.put("icon", arrivalAtBusStop.getLineaGTT());
personMap.put("line-name", arrivalAtBusStop.getTimePassagesString());
data.add(personMap);
}
if (arrivalsAtBusStop.length == 0) {
Toast.makeText(getApplicationContext(),
R.string.no_arrival_times, Toast.LENGTH_SHORT).show();
} else {
busStationName.setText(String.format(getResources().getString(R.string.passages), busStop.getStationName()));
}
String[] from = { "icon", "line-name" };
int[] to = { R.id.busLineIcon, R.id.busLine };
SimpleAdapter adapter = new SimpleAdapter(getApplicationContext(),
data,
R.layout.bus_stop_entry,
from, to);
ListView tpm = ((ListView) findViewById(R.id.listView1));
tpm.setAdapter(adapter);
annoyingFedbackProgressBar.setVisibility(View.INVISIBLE);
}
}
public void searchClick(View v) {
if (!NetworkTools.isConnected(this)) {
NetworkTools.showNetworkError(this);
} else {
annoyingFedbackProgressBar.setVisibility(View.VISIBLE);
new MyAsyncWget().execute(GTTSiteSucker
- .arrivalTimesByLineQuery(bus_stop_number_editText.getText()
+ .arrivalTimesByLineQuery(busStopNumberEditText.getText()
.toString()));
}
}
}