Skip to content

Commit

Permalink
Align main activity with changes in @33df3d8
Browse files Browse the repository at this point in the history
- Renamed GUI element IDs to reflect the naming changes made in commit
@33df3d8.
  • Loading branch information
DimitrisMantas committed Jun 15, 2022
1 parent a65bb1e commit e1f6d07
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/src/main/java/com/dimitrismantas/torch/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_map);
mapView = findViewById(R.id.mapView);
map = mapView.map();
odTextField = findViewById(R.id.odTextField);
odMarkerLegend = findViewById(R.id.odMarkerLegend);
odTextField = findViewById(R.id.textInput);
odMarkerLegend = findViewById(R.id.markerHint);
routeAttributeTextView = findViewById(R.id.routeAttributes);
// Instantiate the UI sections.
instantiateMap(FileManager.concatenateNestedPaths(FileManager.getPrimaryStorageDevicePath(), "map/grc.map"));
Expand All @@ -132,7 +132,7 @@ protected void onCreate(Bundle savedInstanceState) {
// Unpack the non-critical application assets.

ThreadManager.instantiateRoutingServices(getApplicationContext());
final ImageButton helpButton = findViewById(R.id.helpButton);
final ImageButton helpButton = findViewById(R.id.info);
helpButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down Expand Up @@ -230,7 +230,7 @@ private void addMapDataCredits() {

private void instantiateMapController() {
MapController mapController = new MapController(map, pointsOnMap);
final ImageButton resetMapButton = this.findViewById(R.id.resetMapPositionButton);
final ImageButton resetMapButton = this.findViewById(R.id.resetMapPosition);
resetMapButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand All @@ -249,15 +249,15 @@ public boolean onLongClick(View resetMapButtonView) {
private void instantiateRoutingManager() {
// Android throws a NullPointerException if this view is instantiated in onCreate()...
final ImageView routingInProgressNotifier = findViewById(R.id.routingInProgressNotifier);
final ImageButton clearButton = findViewById(R.id.deletePreviousRouteButton);
final ImageButton clearButton = findViewById(R.id.clearRoute);
final RouteManager routeManager = new RouteManager(this, map, pointsOnMap, odTextField, odMarkerLegend, routingInProgressNotifier, clearButton, routeAttributeTextView);
clearButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
routeManager.deleteRoute();
}
});
final ImageButton routeButton = findViewById(R.id.routeButton);
final ImageButton routeButton = findViewById(R.id.route);
registerForContextMenu(routeButton);
routeButton.setOnClickListener(new View.OnClickListener() {
@Override
Expand All @@ -270,7 +270,7 @@ public void onClick(View view) {
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
if (v.getId() == R.id.routeButton) {
if (v.getId() == R.id.route) {
menu.setHeaderTitle("Optimization Modes");
getMenuInflater().inflate(R.menu.menu_optimization_mode, menu);
}
Expand All @@ -279,7 +279,7 @@ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMen
@Override
public boolean onContextItemSelected(@NonNull MenuItem item) {
final ImageView routingInProgressNotifier = findViewById(R.id.routingInProgressNotifier);
final ImageButton clearButton = findViewById(R.id.deletePreviousRouteButton);
final ImageButton clearButton = findViewById(R.id.clearRoute);
final RouteManager routeManager = new RouteManager(this, map, pointsOnMap, odTextField, odMarkerLegend, routingInProgressNotifier, clearButton, routeAttributeTextView);
if (item.getItemId() == R.id.minimizeDistance) {
routeManager.route(AStar.OptimizationMode.MINIMIZE_DISTANCE);
Expand Down

0 comments on commit e1f6d07

Please sign in to comment.