Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
andreynovikov committed Jan 17, 2024
2 parents 7c09446 + 2bd78b6 commit a3e5103
Show file tree
Hide file tree
Showing 15 changed files with 850 additions and 768 deletions.
11 changes: 4 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,16 @@ repositories {
maven { url "https://jitpack.io" }
}

configurations {
configureEach {
// https://stackoverflow.com/questions/69817925/problem-duplicate-class-androidx-lifecycle-viewmodel-found-in-modules
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test:rules:1.5.0'
implementation "androidx.lifecycle:lifecycle-viewmodel:2.7.0"
implementation "androidx.lifecycle:lifecycle-livedata:2.7.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.7.0"
implementation "androidx.lifecycle:lifecycle-common-java8:2.7.0"
implementation "androidx.fragment:fragment:1.6.2"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
Expand Down
156 changes: 81 additions & 75 deletions app/src/main/java/mobi/maptrek/MainActivity.java

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions app/src/main/java/mobi/maptrek/MapHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,5 @@ public interface MapHolder {

void setMapLocation(@NonNull GeoPoint point);

void showMarker(@NonNull GeoPoint point, @Nullable String name, boolean amenity);

void removeMarker();

void setObjectInteractionEnabled(boolean enabled);
}
332 changes: 120 additions & 212 deletions app/src/main/java/mobi/maptrek/fragments/AmenityInformation.java

Large diffs are not rendered by default.

19 changes: 7 additions & 12 deletions app/src/main/java/mobi/maptrek/fragments/BaseMapDownload.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Andrey Novikov
* Copyright 2024 Andrey Novikov
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -28,30 +28,25 @@

import androidx.annotation.NonNull;
import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.ViewModelProvider;

import mobi.maptrek.R;
import mobi.maptrek.maps.maptrek.Index;
import mobi.maptrek.viewmodels.MapIndexViewModel;

public class BaseMapDownload extends DialogFragment {
@NonNull
private final Index mMapIndex;

public BaseMapDownload(@NonNull Index mapIndex) {
super();
mMapIndex = mapIndex;
}

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final View dialogView = getLayoutInflater().inflate(R.layout.fragment_basemap_download, null);

MapIndexViewModel mapIndexViewModel = new ViewModelProvider(requireActivity()).get(MapIndexViewModel.class);

TextView messageView = dialogView.findViewById(R.id.message);
long size = mMapIndex.getBaseMapSize();
long size = mapIndexViewModel.nativeIndex.getBaseMapSize();
messageView.setText(getString(R.string.msgBaseMapDownload, Formatter.formatFileSize(getContext(), size)));

AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getContext());
dialogBuilder.setPositiveButton(R.string.actionDownload, (dialog, which) -> mMapIndex.downloadBaseMap());
dialogBuilder.setPositiveButton(R.string.actionDownload, (dialog, which) -> mapIndexViewModel.nativeIndex.downloadBaseMap());
dialogBuilder.setNegativeButton(R.string.actionSkip, (dialog, which) -> {});
dialogBuilder.setView(dialogView);

Expand Down
Loading

0 comments on commit a3e5103

Please sign in to comment.