kopia lustrzana https://github.com/ge0rg/aprsdroid
helper function for station details
rodzic
730531ccfd
commit
f64aed3220
|
@ -35,9 +35,7 @@ class HubActivity extends MainListActivity("hub", R.id.hub) {
|
||||||
//super.onListItemClick(l, v, position, id)
|
//super.onListItemClick(l, v, position, id)
|
||||||
val c = getListView().getItemAtPosition(position).asInstanceOf[Cursor]
|
val c = getListView().getItemAtPosition(position).asInstanceOf[Cursor]
|
||||||
val call = c.getString(StorageDatabase.Position.COLUMN_CALL)
|
val call = c.getString(StorageDatabase.Position.COLUMN_CALL)
|
||||||
Log.d("HubActivity", "onListItemClick: %s".format(call))
|
uihelper.openDetails(call)
|
||||||
|
|
||||||
startActivity(new Intent(this, classOf[StationActivity]).putExtra("call", call));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,7 +246,7 @@ class StationOverlay(icons : Drawable, context : MapAct, db : StorageDatabase) e
|
||||||
override def onTap(index : Int) : Boolean = {
|
override def onTap(index : Int) : Boolean = {
|
||||||
val s = stations(index)
|
val s = stations(index)
|
||||||
Log.d(TAG, "user clicked on " + s.call)
|
Log.d(TAG, "user clicked on " + s.call)
|
||||||
context.startActivity(new Intent(context, classOf[StationActivity]).putExtra("call", s.call));
|
context.uihelper.openDetails(s.call)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ class StationActivity extends LoadingListActivity with OnClickListener {
|
||||||
// click on own callssid
|
// click on own callssid
|
||||||
uihelper.trackOnMap(call)
|
uihelper.trackOnMap(call)
|
||||||
} else {
|
} else {
|
||||||
startActivity(new Intent(this, classOf[StationActivity]).putExtra("call", call));
|
uihelper.openDetails(call)
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,10 @@ class UIHelper(ctx : Activity, menu_id : Int, prefs : PrefsWrapper)
|
||||||
ctx.asInstanceOf[LoadingIndicator].onStartLoading()
|
ctx.asInstanceOf[LoadingIndicator].onStartLoading()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def openDetails(call : String) {
|
||||||
|
ctx.startActivity(new Intent(ctx, classOf[StationActivity]).putExtra("call", call))
|
||||||
|
}
|
||||||
|
|
||||||
def trackOnMap(call : String) {
|
def trackOnMap(call : String) {
|
||||||
val text = ctx.getString(R.string.map_track_call, call)
|
val text = ctx.getString(R.string.map_track_call, call)
|
||||||
Toast.makeText(ctx, text, Toast.LENGTH_SHORT).show()
|
Toast.makeText(ctx, text, Toast.LENGTH_SHORT).show()
|
||||||
|
@ -249,7 +253,7 @@ class UIHelper(ctx : Activity, menu_id : Int, prefs : PrefsWrapper)
|
||||||
def callsignAction(id : Int, targetcall : String) : Boolean = {
|
def callsignAction(id : Int, targetcall : String) : Boolean = {
|
||||||
id match {
|
id match {
|
||||||
case R.id.details =>
|
case R.id.details =>
|
||||||
ctx.startActivity(new Intent(ctx, classOf[StationActivity]).putExtra("call", targetcall));
|
openDetails(targetcall)
|
||||||
true
|
true
|
||||||
case R.id.mapbutton =>
|
case R.id.mapbutton =>
|
||||||
trackOnMap(targetcall)
|
trackOnMap(targetcall)
|
||||||
|
|
Ładowanie…
Reference in New Issue