diff --git a/.forgejo/workflows/on_release.yml b/.forgejo/workflows/on_release.yml index a9706bcf..fd1a0309 100644 --- a/.forgejo/workflows/on_release.yml +++ b/.forgejo/workflows/on_release.yml @@ -44,17 +44,20 @@ jobs: export keyPassword=${{ secrets.KEY_PASSWORD }} ./gradlew build ./gradlew assembleRelease - rm -rf app/build/outputs/apk/release/baselineProfiles - rm -rf app/build/outputs/apk/release/output-metadata.json - - - name: Upload APK to hetzner - shell: bash - run: | TAG=$( echo ${{ env.GITHUB_REF_NAME }} ) scp app/build/outputs/apk/release/app-release.apk hetzner:~/public/apk/mapcomplete-$TAG.apk - if [[ ! $tag =~ -sfw$ ]]; then - ssh hetzner 'rm -f public/apk/mapcomplete-latest.apk && cp "public/apk/$(ls -v public/apk/ | tail -n 1)" public/apk/mapcomplete-latest.apk' - fi + ssh hetzner 'rm -f public/apk/mapcomplete-latest.apk && cp "public/apk/$(ls -v public/apk/ | tail -n 1)" public/apk/mapcomplete-latest.apk' + # Build versions for legacy versions + ./scripts/compile_version.sh $TAG 9-PIE 28 + ./scripts/compile_version.sh $TAG 10-QUINCE-TART 29 + ./scripts/compile_version.sh $TAG 11-RED-VELVET-CAKE 30 + ./scripts/compile_version.sh $TAG 12-SNOW-CONE 31 + ./scripts/compile_version.sh $TAG 13-TIRAMISU 32 + + - name: clean intermediate files + run: | + rm -rf app/build/outputs/apk/release/baselineProfiles + rm -rf app/build/outputs/apk/release/output-metadata.json - name: Upload APK to forgejo releases (MapComplete) uses: https://source.mapcomplete.org/actions/forgejo-release@v2.6.0 diff --git a/app/build.gradle b/app/build.gradle index cb92a36e..3642aaff 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,9 +5,9 @@ android { compileSdk rootProject.ext.compileSdkVersion defaultConfig { applicationId "org.mapcomplete" - minSdkVersion rootProject.ext.minSdkVersion - targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 9 + minSdk 28 + targetSdkVersion 35 + versionCode 10 versionName "debug" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { @@ -75,3 +75,9 @@ try { } catch(Exception e) { logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work") } +android { + lintOptions { + checkReleaseBuilds false + abortOnError false + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 817307d1..1bebc67d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ - + + { - var view = getWindow().getDecorView(); - var insets = view.getRootWindowInsets(); - var topInsetPxSize= insets.getInsetsIgnoringVisibility(WindowInsets.Type.statusBars()).top; - var bottomInsetPxSize= insets.getInsetsIgnoringVisibility(WindowInsets.Type.navigationBars()).bottom; - - var json = "{ \"top\": "+topInsetPxSize+", \"bottom\":"+bottomInsetPxSize+"}"; - Log.i("insets","Inset sizes are:"+topInsetPxSize+" bottom:"+ bottomInsetPxSize); - Databridge.sendAnswerTo(responder, json); + Databridge.addResponder("exit", responder -> { + Log.i("databridge","got exit request"); + finishAffinity(); }); - getOnBackInvokedDispatcher().registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_OVERLAY, - () -> { - System.out.println("Back button pressed"); - if (this.backbutton != null) { - Databridge.sendAnswerTo(this.backbutton, "backbutton pressed"); + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + + var useInsets = Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE; + Log.i("Insets","Using insets:"+useInsets+", sdk_int:"+Build.VERSION.SDK_INT+" "+Build.VERSION_CODES.UPSIDE_DOWN_CAKE); + WindowCompat.setDecorFitsSystemWindows(getWindow(), !useInsets); + if(useInsets) { + Databridge.addResponder("insets", (responder) -> { + var view = getWindow().getDecorView(); + var insets = view.getRootWindowInsets(); + var topInsetPxSize = insets.getInsetsIgnoringVisibility(WindowInsets.Type.statusBars()).top; + var bottomInsetPxSize = insets.getInsetsIgnoringVisibility(WindowInsets.Type.navigationBars()).bottom; + + var json = "{ \"top\": " + topInsetPxSize + ", \"bottom\":" + bottomInsetPxSize + "}"; + Log.i("insets", "Inset sizes are:" + topInsetPxSize + " bottom:" + bottomInsetPxSize); + Databridge.sendAnswerTo(responder, json); + }); + }else{ + Log.i("insets","Not enabling insets, version to low"); + Databridge.addResponder("insets", (responder) -> { + var json = "{ \"top\": 0, \"bottom\": 0}"; + Databridge.sendAnswerTo(responder, json); + }); + } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + getOnBackInvokedDispatcher().registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_OVERLAY, + () -> { + System.out.println("Back button pressed"); + if (this.backbutton != null) { + Databridge.sendAnswerTo(this.backbutton, "backbutton pressed"); + } } - } - ); + ); + } } + @Override + public void onBackPressed() { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) { + System.out.println("Back button pressed (old)"); + if (this.backbutton != null) { + Databridge.sendAnswerTo(this.backbutton, "backbutton pressed"); + } + }else{ + super.onBackPressed(); + } + + } + + private boolean hasGeolocationPermission() { return ContextCompat.checkSelfPermission( diff --git a/metadata/en-US/full_description.txt b/metadata/en-US/full_description.txt index a627fea4..1fed9fa5 100644 --- a/metadata/en-US/full_description.txt +++ b/metadata/en-US/full_description.txt @@ -1,15 +1,15 @@ -MapComplete has more then 70 maps, each showing features withing a certain topic. For example: +MapComplete has more than 70 maps, each showing features within a certain topic. For example: -- Restaurants, including information about vegan, vegetarian, glutenfree and lactosefree options +- Restaurants, including information about vegan, vegetarian, gluten-free and lactose-free options - Shops -- healthcare providers such as doctors, pharmacies, dentists, physical therapists,... +- Healthcare providers such as doctors, pharmacies, dentists, physical therapists... - Vending machines - Drinking water fountains - Public bookcases - Public toilets -- Defibrillators (AED) +- Defibrillators (AEDs) - Bicycle pumps and bicycle shops -- Artworks and status +- Artworks and statues - Benches - Waste baskets and containers - Pubs @@ -17,7 +17,7 @@ MapComplete has more then 70 maps, each showing features withing a certain topic - Charging stations - Surveillance cameras - Advertisement billboards -- cClimbing gyms +- Climbing gyms - Schools - Memorials - Hackerspaces @@ -25,6 +25,5 @@ MapComplete has more then 70 maps, each showing features withing a certain topic When selecting an item, all the relevant information is shown in a user-friendly way. Unknown information can be easily added by answering the questions, which will be saved into OpenStreetMap directly (this requires a free account). -An (anonymous) review can left for some types of features, which is hosted by https://Mangrove.reviews, an libre and open data review project. -Images can be added via Panoramax, but will also be pulled from various sources such as Wikipedia and Mapillary. - +An (anonymous) review can be left for some types of features, hosted by https://Mangrove.reviews, a libre and open data review project. +Images are fetched from various sources, such as Panoramax, Wikipedia and Mapillary. New images can be contributed to Panoramax directly from within MapComplete. diff --git a/scripts/compile_version.sh b/scripts/compile_version.sh new file mode 100755 index 00000000..b43d25cc --- /dev/null +++ b/scripts/compile_version.sh @@ -0,0 +1,16 @@ +#! /bin/bash + +# Edit the 'build.gradle' file to a certain target sdk +TAG="$1" +LABEL="$2" +VERSION="$3" + +echo "Setting $VERSION" +# sed -i "s/compileSdkVersion *[0-9]\+/compileSdkVersion $VERSION/" app/build.gradle +sed -i "s/minSdk *[0-9]\+/minSdk $VERSION/" app/build.gradle +sed -i "s/targetSdkVersion *[0-9]\+/targetSdkVersion $VERSION/" app/build.gradle + +./gradlew build + +scp app/build/outputs/apk/release/app-release.apk hetzner:~/public/apk/mapcomplete-$TAG-$LABEL.apk +ssh hetzner "cp ~/public/apk/mapcomplete-$TAG-$LABEL.apk ~/public/apk/mapcomplete-latest-$LABEL.apk"