Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove sternfahrt feature #102

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions app/src/main/java/de/stephanlindauer/criticalmaps/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@

import butterknife.Bind;
import butterknife.ButterKnife;
import de.stephanlindauer.criticalmaps.events.NewOverlayConfigEvent;
import de.stephanlindauer.criticalmaps.handler.ApplicationCloseHandler;
import de.stephanlindauer.criticalmaps.handler.PrerequisitesChecker;
import de.stephanlindauer.criticalmaps.handler.ProcessCameraResultHandler;
import de.stephanlindauer.criticalmaps.handler.StartCameraHandler;
import de.stephanlindauer.criticalmaps.helper.clientinfo.BuildInfo;
import de.stephanlindauer.criticalmaps.helper.clientinfo.DeviceInformation;
import de.stephanlindauer.criticalmaps.model.SternfahrtModel;
import de.stephanlindauer.criticalmaps.model.UserModel;
import de.stephanlindauer.criticalmaps.provider.EventBusProvider;
import de.stephanlindauer.criticalmaps.provider.FragmentProvider;
Expand All @@ -42,7 +40,6 @@ public class Main extends AppCompatActivity implements NavigationView.OnNavigati
private final LocationUpdatesService locationUpdatesService = LocationUpdatesService.getInstance();
private final UserModel userModel = UserModel.getInstance();
private final EventBusProvider eventService = EventBusProvider.getInstance();
private final SternfahrtModel sternfahrtModel = SternfahrtModel.getInstance();

//misc
private File newCameraOutputFile;
Expand Down Expand Up @@ -105,9 +102,6 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.take_picture:
new StartCameraHandler(this).execute();
break;
case R.id.show_sternfahrt:
handleShowSternfahrt(item);
break;
case R.id.settings_feedback:
startFeedbackIntent();
break;
Expand All @@ -126,12 +120,6 @@ public void handleCloseRequested() {
new ApplicationCloseHandler(this).execute();
}

private void handleShowSternfahrt(MenuItem item) {
item.setChecked(!item.isChecked());
sternfahrtModel.shouldShowSternfahrtRoutes = item.isChecked();
eventService.post(new NewOverlayConfigEvent());
}

private void startFeedbackIntent() {
Intent Email = new Intent(Intent.ACTION_SEND);
Email.setType("text/email");
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,17 @@
import com.squareup.otto.Subscribe;

import org.osmdroid.DefaultResourceProxyImpl;
import org.osmdroid.bonuspack.overlays.Polyline;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.MapView;

import java.util.ArrayList;

import butterknife.Bind;
import butterknife.BindDrawable;
import butterknife.ButterKnife;
import de.stephanlindauer.criticalmaps.R;
import de.stephanlindauer.criticalmaps.events.NewLocationEvent;
import de.stephanlindauer.criticalmaps.events.NewOverlayConfigEvent;
import de.stephanlindauer.criticalmaps.events.NewServerResponseEvent;
import de.stephanlindauer.criticalmaps.model.OtherUsersLocationModel;
import de.stephanlindauer.criticalmaps.model.OwnLocationModel;
import de.stephanlindauer.criticalmaps.model.SternfahrtModel;
import de.stephanlindauer.criticalmaps.overlays.LocationMarker;
import de.stephanlindauer.criticalmaps.provider.EventBusProvider;
import de.stephanlindauer.criticalmaps.service.LocationUpdatesService;
Expand All @@ -39,7 +34,6 @@ public class MapFragment extends Fragment {
private OwnLocationModel ownLocationModel = OwnLocationModel.getInstance();
private OtherUsersLocationModel otherUsersLocationModel = OtherUsersLocationModel.getInstance();
private EventBusProvider eventService = EventBusProvider.getInstance();
private SternfahrtModel sternfahrtModel = SternfahrtModel.getInstance();
private LocationUpdatesService locationManager = LocationUpdatesService.getInstance();

//view
Expand Down Expand Up @@ -112,13 +106,6 @@ private void setMapAndOverlayState() {
private void refreshView() {
mapView.getOverlays().clear();

if (sternfahrtModel.shouldShowSternfahrtRoutes) {
ArrayList<Polyline> sternfahrtOverlays = sternfahrtModel.getAllOverlays(getActivity().getApplication());
for (Polyline route : sternfahrtOverlays) {
mapView.getOverlays().add(route);
}
}

for (GeoPoint currentOtherUsersLocation : otherUsersLocationModel.getOtherUsersLocations()) {
LocationMarker otherPeoplesMarker = new LocationMarker(mapView, resourceProxy);
otherPeoplesMarker.setPosition(currentOtherUsersLocation);
Expand Down Expand Up @@ -185,11 +172,6 @@ public void handleNewLocation(NewLocationEvent e) {
refreshView();
}

@Subscribe
public void handleNewOverlayConfig(NewOverlayConfigEvent e) {
refreshView();
}

private void animateToLocation(final GeoPoint location) {
mapView.getController().animateTo(location);
}
Expand Down

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/menu/actionbar_buttons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@
<!--android:checked="true"-->
<!--android:showAsAction="collapseActionView"-->
<!--android:title="@string/tracking" />-->
<item
android:id="@+id/show_sternfahrt"
android:checkable="true"
android:checked="false"
app:showAsAction="never"
android:title="@string/show_sternfahrt_routes" />
<item
android:id="@+id/settings_feedback"
app:showAsAction="never"
Expand Down
Loading