From 260d850ca95e55654dd32c7aa192fc07e8748995 Mon Sep 17 00:00:00 2001 From: woheller69 Date: Mon, 19 Aug 2024 09:26:13 +0200 Subject: [PATCH] V2.9 --- app/build.gradle | 4 ++-- .../weather/activities/RainViewerActivity.java | 13 +++++++++---- fastlane/metadata/android/en-US/changelogs/29.txt | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/29.txt diff --git a/app/build.gradle b/app/build.gradle index 0025fef..4743f7e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "org.woheller69.omweather" minSdkVersion 21 targetSdkVersion 34 - versionCode 28 - versionName "2.8" + versionCode 29 + versionName "2.9" buildConfigField "String", "BASE_URL", "\"https://api.open-meteo.com/v1/\"" buildConfigField "String", "GITHUB_URL","\"https://github.com/woheller69/omweather/\"" diff --git a/app/src/main/java/org/woheller69/weather/activities/RainViewerActivity.java b/app/src/main/java/org/woheller69/weather/activities/RainViewerActivity.java index 14412f6..b3dc1cb 100644 --- a/app/src/main/java/org/woheller69/weather/activities/RainViewerActivity.java +++ b/app/src/main/java/org/woheller69/weather/activities/RainViewerActivity.java @@ -116,6 +116,7 @@ protected void onCreate(Bundle savedInstanceState) { mapPreload.setTilesScaledToDpi(true); Configuration.getInstance().load(this, PreferenceManager.getDefaultSharedPreferences(this)); + Configuration.getInstance().setUserAgentValue(getPackageName()); mapView.setMultiTouchControls(true); mapView.getZoomController().setVisibility(CustomZoomButtonsController.Visibility.ALWAYS); @@ -143,7 +144,7 @@ protected void onCreate(Bundle savedInstanceState) { @Override public boolean onZoom(ZoomEvent event) { Handler handler = new Handler(Looper.getMainLooper()); - handler.postDelayed(() -> mapView.getController().animateTo(mapView.getMapCenter()),200); //Refresh after 200ms + handler.postDelayed(() -> refreshMap(mapView),200); //Refresh after 200ms return false; } }); @@ -155,7 +156,7 @@ public boolean onZoom(ZoomEvent event) { @Override public boolean onZoom(ZoomEvent event) { Handler handler = new Handler(Looper.getMainLooper()); - handler.postDelayed(() -> mapView2.getController().animateTo(mapView2.getMapCenter()),200); //Refresh after 200ms + handler.postDelayed(() -> refreshMap(mapView2),200); //Refresh after 200ms return false; } }); @@ -313,7 +314,7 @@ public void showFrame(int position){ private void crossFade(MapView fromMap, MapView toMap) { int animationDuration; - if (radarTilesOverlayEntries.size() <= 1) animationDuration = 1000; //slowdown intro + if (radarTilesOverlayEntries.size() <= 1) animationDuration = 2000; //slowdown intro else animationDuration = 200; //milliseconds toMap.setAlpha(0f); toMap.setVisibility(View.VISIBLE); @@ -331,12 +332,16 @@ private void crossFade(MapView fromMap, MapView toMap) { @Override public void onAnimationEnd(Animator animation) { fromMap.setVisibility(View.INVISIBLE); - toMap.getController().animateTo(toMap.getMapCenter()); //another refresh, sometimes overlays do not fully load + refreshMap(toMap); //another refresh, sometimes overlays do not fully load crossfadeRunning = false; } }); } + private static void refreshMap(MapView map) { + map.getController().animateTo(map.getMapCenter()); + } + private void replaceLayer(MapView map, TilesOverlay newRadarOverlay, TilesOverlay newInfraredOverlay, IGeoPoint center, double zoom) { map.getOverlays().clear(); map.getOverlays().add(newInfraredOverlay); diff --git a/fastlane/metadata/android/en-US/changelogs/29.txt b/fastlane/metadata/android/en-US/changelogs/29.txt new file mode 100644 index 0000000..0624a3a --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/29.txt @@ -0,0 +1 @@ +Minor fixes for rain radar \ No newline at end of file